winIDEA SDK
isys::CTestUserStub Class Reference

Description

stub.

User stubs are implemented as replacement functions on target - this class contains information which function to call instead. During test execution the stubbed function in target memory is modified so that the function specified in this class is called instead of the stubbed function.

 

#include <CTestUserStub.h>

Inheritance diagram for isys::CTestUserStub:
isys::CTestBase

Public Types

enum  EUserStubSections
 Ids of test specification sections.
 

Public Member Functions

 CTestUserStub ()
 Initializes new instance.
 
 CTestUserStub (const CTestBaseSPtr &parent)
 Initializes new instance. More...
 
bool isMerged () const
 Returns true, if the CTestSpecification section containing this object is merged. More...
 
const std::string getFunctionName ()
 Returns the name of stubbed function.
 
iconnect::ETristate isActive ()
 Returns true, if stub is active during test execution.
 
std::string getReplacementFuncName ()
 Returns name of the function which will be called instead of the stubbed function.
 
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 setReplacementFuncName (const std::string &replacementFuncName)
 Sets name of the function to be called instead of the stubbed function.
 
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 CTestUserStubSPtr 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

◆ CTestUserStub()

isys::CTestUserStub::CTestUserStub ( 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 CTestUserStubSPtr isys::CTestUserStub::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.

◆ isMerged()

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

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


Reimplemented from isys::CTestBase.

◆ setActive()

void isys::CTestUserStub::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.