This interface defines methods for unit testing without code instrumentation. More...
#include <i_Connect.h>
Public Types | |
| enum | EControlFlags { controlReset = 0x00000000 , controlTestCaseInit = 0x00000001 , controlTestCaseClean = 0x00000002 , controlTestCaseRun = 0x00000003 , controlTestCaseAbort = 0x00000004 , controlTestCasePause = 0x00000005 , controlTestCaseSetDebugMode = 0x00000006 , controlTestBatchBegin = 0x00000014 , controlTestBatchEnd = 0x00000015 , controlPersistentVariablesInit = 0x00000065 , controlPersistentVariablesClean = 0x00000066 , controlPersistentVariablesApply = 0x00000067 , controlSystemTest = 0x00000100 , controlSystemTestInit = controlSystemTest | controlTestCaseInit , controlSystemTestClean = controlSystemTest | controlTestCaseClean , controlSystemTestRun = controlSystemTest | controlTestCaseRun , controlSystemTestStop = 0x00000104 } |
| Defines constants for test case actions. More... | |
| enum | ECreateVariableExFlags { cveRegularVariable = isys::IConnectTest::ECreateVariableExFlags::cveRegularVariable , cvePersistentVariable = isys::IConnectTest::ECreateVariableExFlags::cvePersistentVariable } |
| enum | EDeleteVariableExFlags { dveRegularVariable = 0x0001 , dvePersistentVariable = 0x0002 } |
| Defines the flags used in the DeleteVariableEx function. More... | |
| enum | EErrorCode |
| Defines constants describing test case status. | |
| enum | EEvaluateFlags { efVagueFloatEqual = isys::IConnectTest::EEvaluateFlags::efVagueFloatEqual , efIgnoreLocalScope = isys::IConnectTest::EEvaluateFlags::efIgnoreLocalScope , efUseRealTimeAccess = isys::IConnectTest::EEvaluateFlags::efUseRealTimeAccess , efModifyParameter = isys::IConnectTest::EEvaluateFlags::efModifyParameter } |
| enum | EInfoFlags { infoSupported = 1 } |
| Defines the flags used by the GetInfo function. More... | |
| enum | EState { stateOffline = isys::IConnectTest::EState::stateOffline , stateInitialized = isys::IConnectTest::EState::stateInitialized , stateRunning = isys::IConnectTest::EState::stateRunning , stateEnded = isys::IConnectTest::EState::stateEnded , stateStub = isys::IConnectTest::EState::stateStub , stateUnexpectedStop = isys::IConnectTest::EState::stateUnexpectedStop , stateAborted = isys::IConnectTest::EState::stateAborted , statePaused = isys::IConnectTest::EState::statePaused , statePersistentReady = isys::IConnectTest::EState::statePersistentReady , stateSystemTest = isys::IConnectTest::EState::stateSystemTest , stateStop = isys::IConnectTest::EState::stateStop , stateException = isys::IConnectTest::EState::stateException , stateTimeOut = isys::IConnectTest::EState::stateTimeOut } |
| enum | EStatusFlags { sfQueryTestCase = isys::IConnectTest::EStatusFlags::sfQueryTestCase , sfQueryStub = isys::IConnectTest::EStatusFlags::sfQueryStub , sfTestCase = isys::IConnectTest::EStatusFlags::sfTestCase , sfStub = isys::IConnectTest::EStatusFlags::sfStub , sfException = isys::IConnectTest::EStatusFlags::sfException } |
| enum | EStubFlags { sfeAutoBreakpoints = isys::IConnectTest::EStubFlags::sfeAutoBreakpoints , sfeCustomBreakpoints = isys::IConnectTest::EStubFlags::sfeCustomBreakpoints } |
| enum | EStubState { stateStubNotActive = isys::IConnectTest::EStubState::stateStubNotActive , stateStubActive = isys::IConnectTest::EStubState::stateStubActive } |
Public Member Functions | |
| virtual isys::HResult | Control (DWORD dwControlFlags, DWORD dwHandle)=0 |
| This method modifies the state of the test case. | |
| virtual isys::HResult | CreateParameter (DWORD dwTestCase, DWORD dwIndex, const char *pszName, const char *pszType="")=0 |
| Creates a name for a parameter that can be used for accessing it. | |
| virtual isys::HResult | CreateRealtimeStub (DWORD *pdwStub, const char *pszFunctionName)=0 |
| Obsolete. | |
| virtual isys::HResult | CreateReturnValue (DWORD dwTestCase, const char *pszName)=0 |
| Creates a name for the function return value that can be used for accessing it during evaluation and modification. | |
| virtual isys::HResult | CreateStub (DWORD *pdwStub, const char *pszFunctionName)=0 |
| Creates stub for function called by function under test. | |
| virtual isys::HResult | CreateStubEx (DWORD dwStubFlags, const char *pszFunctionName, DWORD *pdwStub)=0 |
| Creates stub for function called by function under test. | |
| virtual isys::HResult | CreateStubParameter (DWORD dwStub, DWORD dwIndex, const char *pszName)=0 |
| This method assigns a name to stub parameter at the given position. | |
| virtual isys::HResult | CreateStubReturnValue (DWORD dwStub, const char *pszName)=0 |
| This method assigns a name to stub return value. | |
| virtual isys::HResult | CreateTestCase (DWORD *pdwTestCase, const char *pszFunctionName)=0 |
| Creates a new test case. | |
| virtual isys::HResult | CreateUserStub (DWORD *pdwStub, const char *pszFunctionName, const char *pszUserFunctionName)=0 |
| Creates stub for function called by function under test. | |
| virtual isys::HResult | CreateVariable (DWORD *pdwVariable, const char *pszName, const char *pszType)=0 |
| Creates temporary variable, which can be used as a function parameter. | |
| virtual isys::HResult | CreateVariableEx (DWORD dwCreateVariableExFlags, DWORD *pdwVariable, const char *pszName, const char *pszType)=0 |
| Creates temporary variable, which can be used as a function parameter. | |
| virtual isys::HResult | DeleteVariableEx (DWORD dwDeleteVariableExFlags, const char *pszName)=0 |
| Delete temporary variable, which can be used as a function parameter. | |
| virtual isys::HResult | DestroyStub (DWORD dwStub)=0 |
| Destroys a stub. | |
| virtual isys::HResult | DestroyTestCase (DWORD dwTestCase)=0 |
| Deletes test case created by CreateTestCase(). | |
| virtual isys::HResult | DestroyVariable (DWORD dwVariable)=0 |
| Destroys variable created by CreateVariable(). | |
| virtual isys::HResult | EvaluateExpression (DWORD dwEvaluateFlags, const char *pszExpression, LPSTR pszResult, DWORD dwResultLen)=0 |
| Evaluates the given expression and returns result as a string. | |
| virtual isys::HResult | GetInfo (DWORD dwInfoFlags, DWORD *pdwInfo, LPSTR pszInfo, DWORD dwInfoLen)=0 |
| Gets information about the iTest module and the TestManager. | |
| virtual isys::HResult | GetLastError (DWORD dwErrorFlags, DWORD *pdwErrorCode, LPSTR pszError, DWORD dwErrorLen)=0 |
| Gets the last error code and it's string description. | |
| virtual isys::HResult | GetStatus (DWORD dwStatusFlags, DWORD dwHandle, DWORD *pdwStatus)=0 |
| Provides status information. | |
| virtual isys::HResult | ModifyExpression (DWORD dwModifyFlags, const char *pszExpression, LPSTR pszResult, DWORD dwResultLen, const char *pszValue)=0 |
| Modifies expression to the given value. | |
| virtual isys::HResult | SetTestCaseTimeOut (DWORD dwTimeOut=0)=0 |
| Set a timeout for a testcase. | |
This interface defines methods for unit testing without code instrumentation.
Defines constants for test case actions.
| Enumerator | |
|---|---|
| cveRegularVariable | |
| cvePersistentVariable | |
| Enumerator | |
|---|---|
| efVagueFloatEqual | |
| efIgnoreLocalScope | |
| efUseRealTimeAccess | |
| efModifyParameter | |
| enum IConnectTest::EState |
| Enumerator | |
|---|---|
| stateOffline | |
| stateInitialized | |
| stateRunning | |
| stateEnded | |
| stateStub | |
| stateUnexpectedStop | |
| stateAborted | |
| statePaused | |
| statePersistentReady | |
| stateSystemTest | |
| stateStop | |
| stateException | |
| stateTimeOut | |
| Enumerator | |
|---|---|
| sfQueryTestCase | |
| sfQueryStub | |
| sfTestCase | |
| sfStub | |
| sfException | |
| Enumerator | |
|---|---|
| sfeAutoBreakpoints | |
| sfeCustomBreakpoints | |
| Enumerator | |
|---|---|
| stateStubNotActive | |
| stateStubActive | |
|
pure virtual |
This method modifies the state of the test case.
| dwControlFlags | defines action to be performed. See IConnectTest::EControlFlags for valid values. |
| dwHandle | handle, depending on the control flags |
|
pure virtual |
Creates a name for a parameter that can be used for accessing it.
If the variable name with this name already exists, it is hidden by the created variable.
| dwTestCase | test case handle as returned by CreateTestCase() |
| dwIndex | zero based index of the parameter |
| pszName | name of the parameter to be created |
| pszType | type of parameter to be created |
|
pure virtual |
Creates a name for the function return value that can be used for accessing it during evaluation and modification.
If the variable name with this name already exists, it is hidden by the created variable.
| dwTestCase | test case handle as returned by CreateTestCase() |
| pszName | name of the variable to be created |
|
pure virtual |
Creates stub for function called by function under test.
Since no code instrumentation is allowed, only breakpoint is set at the given function. When the function is called, the test case execution stops, and then the test framework can define next actions. Usually it will simulate desired side effects of a stubbed function (for example set global variables), and then continue execution of the function under test.
This method must be called BEFORE test case is initialized by method Control(controlTestCaseInit).
| pdwStub | contains a new stub handle on return |
| pszFunctionName | name of the stubbed function |
|
pure virtual |
Creates stub for function called by function under test.
Since no code instrumentation is allowed, breakpoint is set automatically or manually (depending on flags) at the given function. When the function is called, the test case execution stops, and then the test framework can define next actions. Usually it will simulate desired side effects of a stubbed function (for example set global variables), and then continue execution of the function under test.
This method must be called BEFORE test case is initialized by method Control(controlTestCaseInit).
| pdwStub | contains a new stub handle on return |
| pszFunctionName | name of the stubbed function |
| dwStubFlags | flags used for specified stub |
|
pure virtual |
This method assigns a name to stub parameter at the given position.
This could be done only with regular stubs. This is not supported in real-time or user stubs. The assigned name may be used in expressions by EvaluateExpression() and ModifyExpression(). This function can be called anytime after the stub is setup and before it is hit.
| dwStub | stub handle as returned by CreateStub() |
| dwIndex | 0 - based parameter index |
| pszName | name assigned to parameter |
|
pure virtual |
This method assigns a name to stub return value.
This could be done only with regular stubs. This is not supported in real-time or user stubs. The assigned name may be used in expressions by EvaluateExpression() and ModifyExpression() to define value returned to the function under test. This function can be called anytime after the stub is setup and before it is hit.
| dwStub | stub handle as returned by CreateStub() |
| pszName | name assigned to return value |
|
pure virtual |
Creates a new test case.
| pdwTestCase | contains a new test case handle on return |
| pszFunctionName | name of the function to be tested |
|
pure virtual |
Creates stub for function called by function under test.
User stubs are used to replace a function with another. Both functions have to have the same parameters and return value. When setting up the stub, code will be patched to achieve this behavior. This could be used to test parts of the code with alternative implementations of functions.
This method must be called BEFORE test case is initialized by method Control(controlTestCaseInit).
| pdwStub | contains a new stub handle on return |
| pszFunctionName | name of the stubbed function |
| pszUserFunctionName | name of replacement function |
|
pure virtual |
Creates temporary variable, which can be used as a function parameter.
If the variable name with this name already exists, it is hidden by the created variable.
| pdwVariable | variable handle as returned by CreateVariable() |
| pszName | name of the variable to be created |
| pszType | type of the variable. This should be one of the existing types in the application under test. |
|
pure virtual |
Creates temporary variable, which can be used as a function parameter.
If the variable name with this name already exists, it is hidden by the created variable.
| dwCreateVariableExFlags | flags to set variable type (regular or persistent) |
| pdwVariable | variable handle as returned by CreateVariable() |
| pszName | name of the variable to be created |
| pszType | type of the variable. This should be one of the existing types in the application under test. |
|
pure virtual |
Delete temporary variable, which can be used as a function parameter.
If the variable name with this name already exists, it is hidden by the created variable.
| dwDeleteVariableExFlags | flags to set variable type (regular or persistent) |
| pszName | name of the variable to be created |
|
pure virtual |
Destroys a stub.
| dwStub | stub handle as returned by CreateStub(), CreateRealtimeStub() or CreateUserStub(). |
|
pure virtual |
Deletes test case created by CreateTestCase().
| dwTestCase | test case handle as returned by CreateTestCase() |
|
pure virtual |
Destroys variable created by CreateVariable().
| dwVariable | variable handle as returned by CreateVariable(). |
|
pure virtual |
Evaluates the given expression and returns result as a string.
This method is similar to IConnectDebug::Evaluate(). The difference is in variable scope, since this method takes into account also variables created by CreateVariable() or CreateParameter(), return value, and stub related data.
| dwEvaluateFlags | modifies the behavior of the evaluate function. See IConnectTest::EEvaluateFlags |
| pszExpression | the expression to be evaluated |
| pszResult | pointer to string, which will contain evaluation result |
| dwResultLen | the length of allocated array pointed to by pszResult |
|
pure virtual |
Gets information about the iTest module and the TestManager.
This method can be called independently of the status of the TestManager
| dwInfoFlags | specifies the type of information that is being queried |
| pdwInfo | returns numeric information |
| pszInfo | returns string information to a user allocated buffer |
| dwInfoLen | length of the user allocated buffer |
|
pure virtual |
Gets the last error code and it's string description.
Call this method, when other methods of this interface do not return S_OK, to get detailed error code and description.
| dwErrorFlags | flags that modify the behavior of the function |
| pdwErrorCode | error code |
| pszError | buffer for the error string |
| dwErrorLen | length of the error string buffer |
|
pure virtual |
Provides status information.
| dwStatusFlags | the function operation and the meaning of the other parameters depend on this, for more information see IConnectTest::EStatusFlags |
| dwHandle | handle to a test object (test case, variable, stub, call), its meaning depends on the flags passed to the function |
| pdwStatus | contains data on return |
|
pure virtual |
Modifies expression to the given value.
Expression must be an lvalue.
| dwModifyFlags | modifies the behavior of the modify function. See IConnectTest::EEvaluateFlags |
| pszExpression | lvalue to be modified |
| pszResult | result of evaluated pszValue is stored here. May be NULL, if we don't need the evaluation result. |
| dwResultLen | the length of allocated array pointed to by pszResult |
| pszValue | the value to be assigned to pszExpression |
|
pure virtual |
Set a timeout for a testcase.
| dwTimeOut | when to timeout in ms |