SmartTester
2.0.0
Smart Tester is unit testing and regression testing framework used for testing SmartCGMS system.
|
#include <MappingFilterUnitTester.h>
Public Member Functions | |
void | executeSpecificTests () override |
Executes all tests for a specific filter. Needs to be implemented by derived class. More... | |
HRESULT | levelEventMappingTest () |
HRESULT | infoEventMappingTest () |
HRESULT | parametersEventMappingTest () |
HRESULT | notConfiguredSignalMappingTest () |
HRESULT | nullDestinationIdTest () |
HRESULT | differentSrcIdNullDestinationIdTest () |
HRESULT | allSourceIdTest () |
![]() | |
FilterUnitTester (GUID guid, const EntityType &type) | |
HRESULT | infoEventTest () |
HRESULT | warningEventTest () |
HRESULT | errorEventTest () |
HRESULT | warmResetEventTest () |
HRESULT | shutDownEventTest () |
void | executeConfigTest (const std::wstring &testName, const tester::FilterConfig &configuration, HRESULT expectedResult) |
void | executeAllTests () override |
Every derived class has to override this method to execute all tests. More... | |
void | executeGenericTests () |
![]() | |
EntityUnitTester (const GUID &entityGuid) | |
bool | isEntityLoaded () const noexcept |
CDynamic_Library & | getEntityLib () noexcept |
const GUID & | getEntityGuid () const noexcept |
void | loadEntityLibrary () |
const wchar_t * | getEntityName (const std::string &symbolName) |
![]() | |
void | executeTest (const std::wstring &testName, const std::function< HRESULT(void)> &test) |
Additional Inherited Members | |
![]() | |
HRESULT | configurationTest (const tester::FilterConfig &config, HRESULT expectedResult) |
HRESULT | shutDownTest () override |
Creates shut down event and executes it with tested filter. | |
HRESULT | configureFilter (const tester::FilterConfig &configuration) |
TestFilter & | getTestFilter () |
![]() | |
void | setEntityLib (const std::wstring &libPath) |
void | setLibraryPath (const std::wstring &libraryPath) noexcept |
const std::wstring & | getLibraryPath () const |
scgms::IFilter * | getTestedEntity () noexcept |
void | setTestedEntity (scgms::IFilter *entity) |
void | runTest (const std::function< HRESULT()> &test) override |
We need special behavior of the test execution sequence, so we override this method. More... | |
![]() | |
std::mutex | m_testMutex |
std::condition_variable | m_testCv |
HRESULT | m_lastTestResult = S_OK |
Derived class from GenericUnitTester responsible for the testing of Mapping filter.
HRESULT tester::MappingFilterUnitTester::allSourceIdTest | ( | ) |
When the configured source id is scgms::signal_All, every with any signal_id should be mapped to the configured destination id. This test checks, if every executed event's signal id is mapped to the configured destination id.
HRESULT tester::MappingFilterUnitTester::differentSrcIdNullDestinationIdTest | ( | ) |
When the source id of executed event does not match the configured source signal id and the destination signal id is scgms::signal:Null, the event should not be thrown away and should arrive to the appended filter. This test checks, if the event really not thrown away.
Setting the signal_id to something different than configured source id
Checking no other attribute has been modified
|
overridevirtual |
Executes all tests for a specific filter. Needs to be implemented by derived class.
Configuration tests
Functional tests
Implements tester::FilterUnitTester.
HRESULT tester::MappingFilterUnitTester::infoEventMappingTest | ( | ) |
When the MappingFilter is correctly configured, executed info event's signal_id should be mapped to the configured destination signal_id. This test executes info event upon the MappingFilter and checks, if the signal_id was correctly mapped.
HRESULT tester::MappingFilterUnitTester::levelEventMappingTest | ( | ) |
When the MappingFilter is correctly configured, executed level event's signal_id should be mapped to the configured destination signal_id. This test executes level event upon the MappingFilter and checks, if the signal_id was correctly mapped.
HRESULT tester::MappingFilterUnitTester::notConfiguredSignalMappingTest | ( | ) |
MappingFilter should map only the configured signal source id to the configured signal destination id. This test checks that event with signal id that is not configured as the source signal id is not mapped, because it should not be.
Setting the signal id to something other than the configured source id
Checking no other attribute has been modified
HRESULT tester::MappingFilterUnitTester::nullDestinationIdTest | ( | ) |
When destination signal id is configured to scgms::signal_Null, all executed events with signal_id equal to configured source signal id should be thrown away - they should not arrive to the next filter. This test checks, if the event is really thrown away.
HRESULT tester::MappingFilterUnitTester::parametersEventMappingTest | ( | ) |
When the MappingFilter is correctly configured, executed parameter event's signal_id should be mapped to the configured destination signal_id. This test executes parameter event upon the MappingFilter and checks, if the signal_id was correctly mapped.