winIDEA SDK
isys::CProfilerTestResult Class Reference

Description

This class can be used to store arbitrary information as key-value pairs.

The order is preserved, which means that items are serialized in the same order as they are put into the container. If strings contain characters, which have special meaning in the output format, they have to be escaped or the appropriate add...() method used. Keys should contain alphanumeric characters and underscore '_' only.

Removed, because this info was added to CTestReportConfig as userInfo of type CYAMLMap. This way serialization.deserialization to/from YAML was more consistent.

class CSerializableInfo : public ISerializable { private: class StrStrPair { public: std::string m_key; std::string m_value;

StrStrPair(const std::string &key, const std::string &value) : m_key(key), m_value(value) {} };

std::vector<StrStrPair> m_infoVector;

public:

/ Default ctor. Do not use it from other languages than C++. Call createInstance()
   instead./
CSerializableInfo() {}

/ Adds key / value pair without any modifications. /
void add(const std::string &key, const std::string &value);

/ Writes object's data to report!. /
void serialize(isys::IEmitterSPtr &emitter) const;

/ This method converts pointer to derived class to base class. It is required
   for scripting languages, which can not perform such conversion automatically. /
isys::ISerializableSPtr upcast(const isys::CSerializableInfoSPtr &ptr);

/ Create a new instance of this class. /
static isys::CSerializableInfoSPtr createInstance();

}; This class contains expected results of coverage test. All values are in range [0..1], where 1 means 100%. Shared pointer for CCoverageTestResult. This class stores result of profiler test. This class is not intended to be instantiated by clients. Call isys::CTestCase::getTestResults() or similar method in the scripting language wrapper to get test results.

#include <CTestResult.h>

Public Types

enum  ProfilerErrCode {
  ERR_NONE , ERR_MIN ,
  ERR_MAX , ERR_BOTH
}
 Profiler result error codes. More...
 

Public Member Functions

bool isValueSet () const
 Returns true, if data value in the test specification was set. More...
 
bool isResultSet () const
 Returns true, if result was set for this area.
 
CProfilerStatistics2 getMeasuredResult () const
 Returns measured data, but only if isResultSet() returns true.
 
bool isError ()
 Returns true, if any error occurred. More...
 
ProfilerErrCode validateError (CTestProfilerStatistics::EProfilerStatisticsSectionId statsId, CTestProfilerTime::EProfilerTimeSectionId timeId)
 Returns error status for the given time scope and time type.
 
ProfilerErrCode validateAllTimes (ProfilerErrCode prevError)
 Returns error status for all time measurements.
 
ProfilerErrCode validateTimeScopeForAllTimeTypes (CTestProfilerStatistics::EProfilerStatisticsSectionId statsId)
 Returns error status for the given time scope for all time types.
 
ProfilerErrCode validateTimeTypeForAllScopes (CTestProfilerTime::EProfilerTimeSectionId timeTypeId)
 Returns error status for the given time type for all time scopes.
 
ProfilerErrCode validateHits ()
 Checks for hits error.
 
std::string getMeasuredTime (CTestProfilerStatistics::EProfilerStatisticsSectionId statsId, CTestProfilerTime::EProfilerTimeSectionId timeId)
 Returns the number of hits as string. More...
 
std::string getMeasuredHits ()
 Returns the number of hits as string. More...
 
CTestProfilerStatisticsSPtr getExpectedResult ()
 Returns constraints as specified in test specification.
 
std::string getValue () const
 Returns min time as specified in test specification. More...
 
void serialize (const isys::IEmitterSPtr &emitter)
 Writes object data to destination object.
 
void serializeErrorsOnly (const isys::IEmitterSPtr &emitter)
 Writes object error data to destination object.
 

Member Enumeration Documentation

◆ ProfilerErrCode

Profiler result error codes.

Enumerator
ERR_NONE 

no error

ERR_MIN 

error on lower boundary

ERR_MAX 

error on upper boundary

ERR_BOTH 

used for data values without value specified,

which means that multiple values map to the same specification, so both boundaries may cause error.

Member Function Documentation

◆ getMeasuredHits()

std::string isys::CProfilerTestResult::getMeasuredHits ( )

Returns the number of hits as string.

If this is data area with multiple measurements (for multiple states), then string 'min / max' is returned.

◆ getMeasuredTime()

std::string isys::CProfilerTestResult::getMeasuredTime ( CTestProfilerStatistics::EProfilerStatisticsSectionId  statsId,
CTestProfilerTime::EProfilerTimeSectionId  timeId 
)

Returns the number of hits as string.

If this is data area with multiple measurements (for multiple states), then string 'min / max' is returned.

◆ getValue()

std::string isys::CProfilerTestResult::getValue ( ) const

Returns min time as specified in test specification.

Returns max time as specified in test specification. Returns total time as specified in test specification. Returns hits as specified in test specification. Returns value for this result. The value is valid only when isValueSet() returns true.

◆ isError()

bool isys::CProfilerTestResult::isError ( )

Returns true, if any error occurred.

Calls all validate...() methods.

◆ isValueSet()

bool isys::CProfilerTestResult::isValueSet ( ) const

Returns true, if data value in the test specification was set.

For function profiling it always returns false.