winIDEA SDK
Loading...
Searching...
No Matches
isys::CTestStub Class Reference

This class contains specification for one stub. More...

#include <CTestStub.h>

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

Public Types

enum  EStubSectionIds
 Ids of test specification sections.

Public Member Functions

virtual void assign (const CTestObjectSPtr &base)
 Assigns members of base to this.
bool containsSection (int section) const
 Returns true, if the specified section exists for this object.
virtual CTestObjectSPtr copy () const
 Creates a deep copy of this object.
virtual CTestBaseSPtr createInstance (const CTestBaseSPtr &parent) const
void createInstance (CTestBaseSPtr &obj, const CTestBaseSPtr &parent) const
 CTestStub ()
 CTestStub (const CTestBaseSPtr &parent)
 Initializes new instance.
iconnect::ETristate getActive ()
 Returns string setting as specified in YAML file.
CTestBaseListSPtr getAssignmentSteps (bool isConst)
 Returns assignment steps.
std::string getClassName () const
virtual CTestTreeNodeSPtr getContainerTestNode ()
 virtual CTestSpecificationSPtr getContainerTestSpec();
int getEnumTagValue (int section)
 Returns value of enum type.
std::string getFunctionName ()
 Returns the name of stubbed function.
isys::CTestMinMaxSPtr getHitLimits (bool isConst)
 Returns hit limits.
isys::CTestLogSPtr getLogConfig (bool isConst)
 Returns logging configuration.
void getParamNames (iconnect::StrVector &params)
 Returns names of parameters assigned to stubbed function parameters.
CTestBaseSPtr getParent () const
 Returns parent.
std::string getRetValName ()
 Returns name assigned to the stub return value.
std::string getScriptFunctionName ()
 Returns the function to be called in the test suite, instead of the stubbed one on the target.
int getSectionId (const std::string &sectionName)
 Returns section ID for the given section name.
CTestBaseSPtr getTestBase (int section, bool isConst)
CTestBaseListSPtr getTestBaseList (int section, bool isConst)
CTestObject::ETestObjType getTestObjType () const
 Returns type of this object, which is CTestObject::ETestBase.
bool isActive ()
 Returns true, if stub is active during test execution.
bool isCustomActivation ()
 Returns true, if test point will not be activated before test execution, but during test execution from custom script.
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
bool isMerged () const
 Returns true, if the CTestSpecification section containing this object is merged.
bool isSectionEmpty (int sectionId)
 Returns true, if the given section is empty.
virtual bool isSerializedAsList (bool isParsing)
 Returns true if object should be serialized as list, for example CTestFunction.
virtual void serialize (const isys::IEmitterSPtr &emitter)
 Sends contents of this class to emitter.
void setActive (iconnect::ETristate isActive)
 If parameter is true, then the stub is active during test execution.
virtual void setComment (int section, int idx, const std::string &nlComment, const std::string &eolComment)
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.
void setEnumTagValue (int section, int enumValue)
 Sets value of enum type.
void setFunctionName (const std::string &functionName)
 Sets the name of the function to be stubbed.
virtual void setMainMapStyle (isys::IEmitter::EYamlStyle mappingStyle)
 Sets style of the mapping for complete object.
void setParent (CTestBaseSPtr parent)
 Sets parent.
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 std::string toString ()
 Returns object data as YAML string.
 ~CTestStub ()

Static Public Member Functions

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

Protected Member Functions

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

Detailed 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.

 

Constructor & Destructor Documentation

◆ CTestStub() [1/2]

isys::CTestStub::CTestStub ( )
Since
9.12.288

◆ CTestStub() [2/2]

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.
Since
9.12.288

◆ ~CTestStub()

isys::CTestStub::~CTestStub ( )
Since
9.12.288

Member Function Documentation

◆ assign()

virtual void isys::CTestBase::assign ( const CTestObjectSPtr & base)
virtualinherited

Assigns members of base to this.

Since
9.12.288

Reimplemented in isys::CTestFunction.

◆ cast()

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.

◆ containsSection()

bool isys::CTestBase::containsSection ( int section) const
inherited

Returns true, if the specified section exists for this object.

Since
9.12.288

◆ copy()

virtual CTestObjectSPtr isys::CTestBase::copy ( ) const
virtualinherited

Creates a deep copy of this object.

Parent is set.

Since
9.12.288

◆ createInstance() [1/2]

virtual CTestBaseSPtr isys::CTestStub::createInstance ( const CTestBaseSPtr & parent) const
virtual
Since
9.12.288

Implements isys::CTestBase.

◆ createInstance() [2/2]

void isys::CTestStub::createInstance ( CTestBaseSPtr & obj,
const CTestBaseSPtr & parent ) const
Since
9.12.288

◆ getActive()

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

Returns string setting as specified in YAML file.

Empty string means default setting.

See also
isActive
Since
9.12.288

◆ getAssignmentSteps()

CTestBaseListSPtr isys::CTestStub::getAssignmentSteps ( bool isConst)

Returns assignment steps.

Since
9.12.288

◆ getClassName()

std::string isys::CTestBase::getClassName ( ) const
inherited
Since
9.12.288

◆ getContainerTestNode()

virtual CTestTreeNodeSPtr isys::CTestBase::getContainerTestNode ( )
virtualinherited

virtual CTestSpecificationSPtr getContainerTestSpec();

Since
9.12.288

◆ getEnumTagValue()

int isys::CTestBase::getEnumTagValue ( int section)
inherited

Returns value of enum type.

Since
9.12.288

◆ getFunctionName()

std::string isys::CTestStub::getFunctionName ( )

Returns the name of stubbed function.

Since
9.12.288

◆ getHitLimits()

isys::CTestMinMaxSPtr isys::CTestStub::getHitLimits ( bool isConst)

Returns hit limits.

Since
9.12.288

◆ getLogConfig()

isys::CTestLogSPtr isys::CTestStub::getLogConfig ( bool isConst)

Returns logging configuration.

Since
9.12.288

◆ getParamNames()

void isys::CTestStub::getParamNames ( iconnect::StrVector & params)

Returns names of parameters assigned to stubbed function parameters.

Since
9.12.288

◆ getParent()

CTestBaseSPtr isys::CTestBase::getParent ( ) const
inherited

Returns parent.

Since
9.12.288

◆ getRetValName()

std::string isys::CTestStub::getRetValName ( )

Returns name assigned to the stub return value.

Since
9.12.288

◆ 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.

Since
9.12.288

◆ getSectionId()

int isys::CTestBase::getSectionId ( const std::string & sectionName)
inherited

Returns section ID for the given section name.

Since
9.12.288

◆ getTestBase()

CTestBaseSPtr isys::CTestBase::getTestBase ( int section,
bool isConst )
inherited
Since
9.12.288

◆ getTestBaseList()

CTestBaseListSPtr isys::CTestBase::getTestBaseList ( int section,
bool isConst )
inherited
Since
9.12.288

◆ getTestObjType()

CTestObject::ETestObjType isys::CTestBase::getTestObjType ( ) const
inherited

Returns type of this object, which is CTestObject::ETestBase.

Since
9.12.288

◆ isActive()

bool isys::CTestStub::isActive ( )

Returns true, if stub is active during test execution.

Since
9.12.288

◆ 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.

Since
9.12.288

◆ isEmpty()

virtual bool isys::CTestBase::isEmpty ( ) const
virtualinherited

This method returns true, if the object contains no data.

Since
9.12.288

◆ isMerged()

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

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


Since
9.12.288

Reimplemented from isys::CTestBase.

◆ isSectionEmpty()

bool isys::CTestBase::isSectionEmpty ( int sectionId)
inherited

Returns true, if the given section is empty.

Since
9.12.288

◆ isSerializedAsList()

virtual bool isys::CTestBase::isSerializedAsList ( bool isParsing)
virtualinherited

Returns true if object should be serialized as list, for example CTestFunction.

Since
9.12.288

Reimplemented in isys::CTestFunction.

◆ serialize()

virtual void isys::CTestBase::serialize ( const isys::IEmitterSPtr & emitter)
virtualinherited

Sends contents of this class to emitter.

Since
9.12.288

Reimplemented in isys::CLogResult, and isys::CTestEnvironmentConfig.

◆ 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.

Since
9.12.288

◆ setComment()

virtual void isys::CTestBase::setComment ( int section,
int idx,
const std::string & nlComment,
const std::string & eolComment )
virtualinherited
Since
9.12.288

◆ 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.

Since
9.12.288

◆ setEnumTagValue()

void isys::CTestBase::setEnumTagValue ( int section,
int enumValue )
inherited

Sets value of enum type.

Since
9.12.288

◆ setFunctionName()

void isys::CTestStub::setFunctionName ( const std::string & functionName)

Sets the name of the function to be stubbed.

Since
9.12.288

◆ setMainMapStyle()

virtual void isys::CTestBase::setMainMapStyle ( isys::IEmitter::EYamlStyle mappingStyle)
virtualinherited

Sets style of the mapping for complete object.

Since
9.12.288

◆ setParent()

void isys::CTestBase::setParent ( CTestBaseSPtr parent)
inherited

Sets parent.

Since
9.12.288

◆ setRetValName()

void isys::CTestStub::setRetValName ( const std::string & retValName)

Sets name assigned to the stub return value.

Since
9.12.288

◆ setScriptFunctionName()

void isys::CTestStub::setScriptFunctionName ( const std::string & scriptFuncName)

Sets name assigned to the stub return value.

Since
9.12.288

◆ toString()

virtual std::string isys::CTestBase::toString ( )
virtualinherited

Returns object data as YAML string.

Since
9.12.288