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::DrawingFilterUnitTester Class Reference

#include <DrawingFilterUnitTester.h>

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

Public Member Functions

void executeSpecificTests () override
 
HRESULT imageGenerationTest ()
 
HRESULT svgRetrievingTest ()
 
HRESULT newDataAvailableTest ()
 
- 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 unit testing of Drawing filter.

Member Function Documentation

◆ executeSpecificTests()

void tester::DrawingFilterUnitTester::executeSpecificTests ( )
overridevirtual

Executes all tests specific to filter tested by this UnitTester.

Configuration tests

Functional tests

Implements tester::FilterUnitTester.

◆ imageGenerationTest()

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.

Returns
S_OK if the images were successfully created, otherwise E_FAIL

◆ newDataAvailableTest()

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.

Returns
S_OK if the tested method returns right values, otherwise E_FAIL

◆ svgRetrievingTest()

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.

Returns
S_OK if the svg was successfully retrieved, otherwise E_FAIL

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