SmartTester  2.0.0
Smart Tester is unit testing and regression testing framework used for testing SmartCGMS system.
Public Member Functions | List of all members
tester::MappingFilterUnitTester Class Reference

#include <MappingFilterUnitTester.h>

Inheritance diagram for tester::MappingFilterUnitTester:
Inheritance graph
[legend]
Collaboration diagram for tester::MappingFilterUnitTester:
Collaboration graph
[legend]

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 ()
 
- Public Member Functions inherited from tester::FilterUnitTester
 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 ()
 
- Public Member Functions inherited from tester::EntityUnitTester< scgms::IFilter >
 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)
 
- Public Member Functions inherited from tester::TestRunner
void executeTest (const std::wstring &testName, const std::function< HRESULT(void)> &test)
 

Additional Inherited Members

- Protected Member Functions inherited from tester::FilterUnitTester
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)
 
TestFiltergetTestFilter ()
 
- Protected Member Functions inherited from tester::EntityUnitTester< scgms::IFilter >
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...
 
- Protected Attributes inherited from tester::TestRunner
std::mutex m_testMutex
 
std::condition_variable m_testCv
 
HRESULT m_lastTestResult = S_OK
 

Detailed Description

Derived class from GenericUnitTester responsible for the testing of Mapping filter.

Member Function Documentation

◆ allSourceIdTest()

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.

Returns
S_OK if every executed event was correctly mapped, otherwise E_FAIL

◆ differentSrcIdNullDestinationIdTest()

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.

Returns
S_OK if the event arrived to the appended filter, otherwise E_FAIL

Setting the signal_id to something different than configured source id

Checking no other attribute has been modified

◆ executeSpecificTests()

void tester::MappingFilterUnitTester::executeSpecificTests ( )
overridevirtual

Executes all tests for a specific filter. Needs to be implemented by derived class.

Configuration tests

Functional tests

Implements tester::FilterUnitTester.

◆ infoEventMappingTest()

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.

Returns
S_OK if the signal_id of executed was correctly mapped and no other attribute was modified, otherwise false

◆ levelEventMappingTest()

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.

Returns
S_OK if the signal_id of executed was correctly mapped and no other attribute was modified, otherwise false

◆ notConfiguredSignalMappingTest()

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.

Returns
S_OK if the signal_id of executed event was not mapped and no other attribute was modified, otherwise false

Setting the signal id to something other than the configured source id

Checking no other attribute has been modified

◆ nullDestinationIdTest()

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.

Returns
S_OK if the event did not arrive to the appended filter, otherwise E_FAIL

◆ parametersEventMappingTest()

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.

Returns
S_OK if the signal_id of executed was correctly mapped and no other attribute was modified, otherwise false

The documentation for this class was generated from the following files: