winIDEA SDK
isys::CTestStub Class Reference

Description

This class contains specification for one stub.

Since stubbed function will not be called, we have to specify its return values and other side effects. This information is stored in this class.

 

#include <CTestStub.h>

Inheritance diagram for isys::CTestStub:
isys::CTestBase

Public Types

enum  EStubSectionIds
 Ids of test specification sections.
 

Public Member Functions

 CTestStub (const CTestBaseSPtr &parent)
 Initializes new instance. More...
 
bool isMerged () const
 Returns true, if the CTestSpecification section containing this object is merged. More...
 
std::string getFunctionName ()
 Returns the name of stubbed function.
 
bool isActive ()
 Returns true, if stub is active during test execution.
 
iconnect::ETristate getActive ()
 Returns string setting as specified in YAML file. More...
 
bool isCustomActivation ()
 Returns true, if test point will not be activated before test execution, but during test execution from custom script. More...
 
std::string getRetValName ()
 Returns name assigned to the stub return value.
 
void getParamNames (iconnect::StrVector &params)
 Returns names of parameters assigned to stubbed function parameters.
 
std::string getScriptFunctionName ()
 Returns the function to be called in the test suite, instead of the stubbed one on the target. More...
 
isys::CTestLogSPtr getLogConfig (bool isConst)
 Returns logging configuration.
 
isys::CTestMinMaxSPtr getHitLimits (bool isConst)
 Returns hit limits.
 
CTestBaseListSPtr getAssignmentSteps (bool isConst)
 Returns assignment steps.
 
void setFunctionName (const std::string &functionName)
 Sets the name of the function to be stubbed.
 
void setActive (iconnect::ETristate isActive)
 If parameter is true, then the stub is active during test execution. More...
 
void setCustomActivation (iconnect::ETristate isActive)
 If parameter is true, then the stub will not be activated before test execution, but during test execution from custom script. More...
 
void setRetValName (const std::string &retValName)
 Sets name assigned to the stub return value.
 
void setScriptFunctionName (const std::string &scriptFuncName)
 Sets name assigned to the stub return value.
 
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
 
virtual void serialize (const isys::IEmitterSPtr &emitter)
 Sends contents of this class to emitter.
 
virtual std::string toString ()
 Returns object data as YAML string.
 

Static Public Member Functions

static CTestStubSPtr cast (const CTestBaseSPtr &testBase)
 Casts the given object to this class. More...
 

Protected Member Functions

void setStaticTagsAsConst ()
 This method is called by all objects which are immediately contained in CTestSpecification, for example CTestCoverage, CTestHIL, ...
 

Constructor & Destructor Documentation

◆ CTestStub()

isys::CTestStub::CTestStub ( const CTestBaseSPtr parent)

Initializes new instance.

Parameters
parentan instance of parent CTestSpecification class. Used only when parsing YAML declaration. Can be specified as NULL if the object is not initialized by parser.

Member Function Documentation

◆ cast()

static CTestStubSPtr isys::CTestStub::cast ( const CTestBaseSPtr testBase)
static

Casts the given object to this class.

Returns NULL if input is NULL.

Exceptions
IllegalArgumentExceptionif input object is not instance of this class.

◆ getActive()

iconnect::ETristate isys::CTestStub::getActive ( )

Returns string setting as specified in YAML file.

Empty string means default setting.

See also
isActive

◆ getScriptFunctionName()

std::string isys::CTestStub::getScriptFunctionName ( )

Returns the function to be called in the test suite, instead of the stubbed one on the target.

This function may simulate side effects normally caused by the stubbed function.

◆ isCustomActivation()

bool isys::CTestStub::isCustomActivation ( )

Returns true, if test point will not be activated before test execution, but during test execution from custom script.

This functionality can be used when the order of test point hits is known, and there are not enough hardware breakpoints available.

◆ isMerged()

bool isys::CTestStub::isMerged ( ) const
virtual

Returns true, if the CTestSpecification section containing this object is merged.


Reimplemented from isys::CTestBase.

◆ setActive()

void isys::CTestStub::setActive ( iconnect::ETristate  isActive)

If parameter is true, then the stub is active during test execution.

Otherwise it will be ignored - the function on the target is called.

◆ setCustomActivation()

void isys::CTestStub::setCustomActivation ( iconnect::ETristate  isActive)

If parameter is true, then the stub will not be activated before test execution, but during test execution from custom script.

This functionality can be used when the order of test point hits is known, and there are not enough hardware breskpoints available.