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

#include <GenericUnitTester.h>

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

Public Member Functions

void executeModuleTests ()
 Executes all tests for the loaded module.
 
HRESULT descriptorsMethodsTest ()
 
HRESULT descriptorsMethodParamsTest ()
 
HRESULT factoryMethodsTest ()
 
HRESULT entityCreationTest ()
 
bool loadModule (const std::string &modulePath)
 
- Public Member Functions inherited from tester::TestRunner
void executeTest (const std::wstring &testName, const std::function< HRESULT(void)> &test)
 

Static Public Member Functions

static bool isModuleTested (const std::string &module)
 

Additional Inherited Members

- Protected Attributes inherited from tester::TestRunner
std::mutex m_testMutex
 
std::condition_variable m_testCv
 
HRESULT m_lastTestResult = S_OK
 

Detailed Description

Contains generic tests for any module.

Member Function Documentation

◆ descriptorsMethodParamsTest()

HRESULT tester::ModuleUnitTester::descriptorsMethodParamsTest ( )

This test checks whether the do_get_*_descriptors methods validate their input parameters properly.

Returns
S_OK if all input parameters were correctly validated, otherwise E_FAIL

◆ descriptorsMethodsTest()

HRESULT tester::ModuleUnitTester::descriptorsMethodsTest ( )

Every module has to implement at least one do_get_*_descriptors method. This test checks if tested module implements one.

Returns
S_OK if at least one descriptors method is found, otherwise E_FAIL

◆ entityCreationTest()

HRESULT tester::ModuleUnitTester::entityCreationTest ( )

When module implements do_create_* factory method, a valid object should be constructed when this method is called. This test checks if every factory method is able to create a valid object.

Returns
S_OK if valid objects were successfully created, otherwise false

◆ factoryMethodsTest()

HRESULT tester::ModuleUnitTester::factoryMethodsTest ( )

When module implements a do_get_*_descriptors method, it also has to implement corresponding do_create_* factory method. This test checks if tested module implements one.

Returns
S_OK if all factory methods are found, otherwise false

◆ isModuleTested()

bool tester::ModuleUnitTester::isModuleTested ( const std::string &  module)
static

Checks if module on given path has already been tested.

Parameters
modulemodule to check
Returns
true if the module was already tested, otherwise false

◆ loadModule()

bool tester::ModuleUnitTester::loadModule ( const std::string &  modulePath)

Loads given module for future test execution.

Parameters
modulePathpath to the module
Returns
true, if successfully loaded, otherwise false

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