SmartTester
2.0.0
Smart Tester is unit testing and regression testing framework used for testing SmartCGMS system.
|
#include <DrawingFilterUnitTester.h>
Public Member Functions | |
void | executeSpecificTests () override |
HRESULT | imageGenerationTest () |
HRESULT | svgRetrievingTest () |
HRESULT | newDataAvailableTest () |
![]() | |
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 unit testing of Drawing filter.
|
overridevirtual |
Executes all tests specific to filter tested by this UnitTester.
Configuration tests
Functional tests
Implements tester::FilterUnitTester.
HRESULT tester::DrawingFilterUnitTester::imageGenerationTest | ( | ) |
After successful configuration and executing an event upon the DrawingFilter, there should be an image created on every given path in the configuration. This test configures the DrawingFilter with graph image path and day image path and executes level event upon it. There should be images created at both given paths.
HRESULT tester::DrawingFilterUnitTester::newDataAvailableTest | ( | ) |
After any event is executed upon the DrawingFilter, executing the New_Data_Available should return true, meaning that there is new data available to be drawn. Then the method should return false until new event is executed. This test executes level event upon the DrawingFilter and calls the New_Data_Available method, which should return true. Then, the method is called again, which should return false.
HRESULT tester::DrawingFilterUnitTester::svgRetrievingTest | ( | ) |
After any event is executed upon the DrawingFilter, executing the Draw method should return the svg, describing the executed event. This test executes level event upon the DrawingFilter and retrieves the svg using the Draw method.