SmartTester
2.0.0
Smart Tester is unit testing and regression testing framework used for testing SmartCGMS system.
|
#include <LogReplayFilterUnitTester.h>
Public Member Functions | |
void | executeSpecificTests () override |
Executes all tests for a specific filter. Needs to be implemented by derived class. More... | |
HRESULT | invalidHeaderLogFileTest () |
HRESULT | invalidBodyLogFileTest () |
HRESULT | emittedEventCountTest () |
HRESULT | emitShutdownFlagTest () |
HRESULT | logReplayFolderTest () |
HRESULT | filenameAsSegmentIdTest () |
![]() | |
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 for execution of log replay filter unit tests.
HRESULT tester::LogReplayFilterUnitTester::emitShutdownFlagTest | ( | ) |
When configured with Emit_Shutdown_Message = true, at the end of the log processing, shut down event should be sent. This test checks, if this shut down event is sent in the end.
HRESULT tester::LogReplayFilterUnitTester::emittedEventCountTest | ( | ) |
When configured with valid log, number of emitted events from LogReplay filter should be the same as the number of non-header lines in the log file. This test checks, whether the number of emitted events is the same as the number of log lines.
|
overridevirtual |
Executes all tests for a specific filter. Needs to be implemented by derived class.
Configuration tests
Implements tester::FilterUnitTester.
HRESULT tester::LogReplayFilterUnitTester::filenameAsSegmentIdTest | ( | ) |
When configured with a Interpret_Filename_As_Segment_ID = true, segment id's in every log file should be rewritten to a unique one. This test checks, whether the number of unique segment id's on received events is higher or equal to the number of log files replayed.
HRESULT tester::LogReplayFilterUnitTester::invalidBodyLogFileTest | ( | ) |
When configured with invalid log, that cannot be parsed, LogReplay filter should send an error event to indicate parsing error. This test checks, whether the error event is sent or not.
HRESULT tester::LogReplayFilterUnitTester::invalidHeaderLogFileTest | ( | ) |
When configured with log that has invalid header, LogReplay filter should send a warning event to indicate that the header is corrupted. This test checks whether the warning event is sent or not.
HRESULT tester::LogReplayFilterUnitTester::logReplayFolderTest | ( | ) |
When configured with a folder as an input, LogReplay filter should replay all valid logs in that folder. This test checks, if all valid logs were replayed.