winIDEA SDK
|
This interface defines methods for unit testing without code instrumentation.
#include <i_Connect.h>
Inherits IUnknown.
Public Types | |
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 | 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 | 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 | 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 | EStubState { stateStubNotActive = isys::IConnectTest::EStubState::stateStubNotActive , stateStubActive = isys::IConnectTest::EStubState::stateStubActive } |
enum | EInfoFlags { infoSupported = 1 } |
Defines the flags used by the GetInfo function. 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 | EStubFlags { sfeAutoBreakpoints = isys::IConnectTest::EStubFlags::sfeAutoBreakpoints , sfeCustomBreakpoints = isys::IConnectTest::EStubFlags::sfeCustomBreakpoints } |
Public Member Functions | |
virtual HRESULT | GetLastError (DWORD dwErrorFlags, DWORD *pdwErrorCode, LPSTR pszError, DWORD dwErrorLen) PURE |
Gets the last error code and it's string description. More... | |
virtual HRESULT | CreateTestCase (DWORD *pdwTestCase, LPCSTR pszFunctionName) PURE |
Creates a new test case. More... | |
virtual HRESULT | DestroyTestCase (DWORD dwTestCase) PURE |
Deletes test case created by CreateTestCase(). More... | |
virtual HRESULT | CreateParameter (DWORD dwTestCase, DWORD dwIndex, LPCSTR pszName, LPCSTR pszType="") PURE |
Creates a name for a parameter that can be used for accessing it. More... | |
virtual HRESULT | CreateReturnValue (DWORD dwTestCase, LPCSTR pszName) PURE |
Creates a name for the function return value that can be used for accessing it during evaluation and modification. More... | |
virtual HRESULT | CreateVariable (DWORD *pdwVariable, LPCSTR pszName, LPCSTR pszType) PURE |
Creates temporary variable, which can be used as a function parameter. More... | |
virtual HRESULT | DestroyVariable (DWORD dwVariable) PURE |
Destroys variable created by CreateVariable(). More... | |
virtual HRESULT | CreateStub (DWORD *pdwStub, LPCSTR pszFunctionName) PURE |
Creates stub for function called by function under test. More... | |
virtual HRESULT | DestroyStub (DWORD dwStub) PURE |
Destroys a stub. More... | |
virtual HRESULT | CreateStubParameter (DWORD dwStub, DWORD dwIndex, LPCSTR pszName) PURE |
This method assigns a name to stub parameter at the given position. More... | |
virtual HRESULT | CreateStubReturnValue (DWORD dwStub, LPCSTR pszName) PURE |
This method assigns a name to stub return value. More... | |
virtual HRESULT | EvaluateExpression (DWORD dwEvaluateFlags, LPCSTR pszExpression, LPSTR pszResult, DWORD dwResultLen) PURE |
Evaluates the given expression and returns result as a string. More... | |
virtual HRESULT | ModifyExpression (DWORD dwModifyFlags, LPCSTR pszExpression, LPSTR pszResult, DWORD dwResultLen, LPCSTR pszValue) PURE |
Modifies expression to the given value. More... | |
virtual HRESULT | Control (DWORD dwControlFlags, DWORD dwHandle) PURE |
This method modifies the state of the test case. More... | |
virtual HRESULT | GetStatus (DWORD dwStatusFlags, DWORD dwHandle, DWORD *pdwStatus) PURE |
Provides status information. More... | |
virtual HRESULT | CreateRealtimeStub (DWORD *pdwStub, LPCSTR pszFunctionName) PURE |
Obsolete. | |
virtual HRESULT | CreateUserStub (DWORD *pdwStub, LPCSTR pszFunctionName, LPCSTR pszUserFunctionName) PURE |
Creates stub for function called by function under test. More... | |
virtual HRESULT | GetInfo (DWORD dwInfoFlags, DWORD *pdwInfo, LPSTR pszInfo, DWORD dwInfoLen) PURE |
Gets information about the iTest module and the TestManager. More... | |
virtual HRESULT | CreateVariableEx (DWORD dwCreateVariableExFlags, DWORD *pdwVariable, LPCSTR pszName, LPCSTR pszType) PURE |
Creates temporary variable, which can be used as a function parameter. More... | |
virtual HRESULT | DeleteVariableEx (DWORD dwDeleteVariableExFlags, LPCSTR pszName) PURE |
Delete temporary variable, which can be used as a function parameter. More... | |
virtual HRESULT | SetTestCaseTimeOut (DWORD dwTimeOut=0) PURE |
Set a timeout for a testcase. More... | |
virtual HRESULT | CreateStubEx (DWORD dwStubFlags, LPCSTR pszFunctionName, DWORD *pdwStub) PURE |
Creates stub for function called by function under test. More... | |
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
virtual |
Creates a new test case.
pdwTestCase | contains a new test case handle on return |
pszFunctionName | name of the function to be tested |
|
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 |
|
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. |
|
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. |
|
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 |
|
virtual |
Destroys a stub.
dwStub | stub handle as returned by CreateStub(), CreateRealtimeStub() or CreateUserStub(). |
|
virtual |
Deletes test case created by CreateTestCase().
dwTestCase | test case handle as returned by CreateTestCase() |
|
virtual |
Destroys variable created by CreateVariable().
dwVariable | variable handle as returned by CreateVariable(). |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
virtual |
Set a timeout for a testcase.
dwTimeOut | when to timeout in ms |