OTest2
A C++ testing framework
Classes | Public Member Functions | List of all members
OTest2::TestMark Class Referenceabstract

Generic interface of a test mark node. More...

#include <testmark.h>

Inheritance diagram for OTest2::TestMark:
Inheritance graph
[legend]

Classes

struct  LinearizedRecord
 One item of linearized test mark. More...
 

Public Member Functions

virtual void doLinearizedMark (int level_, const std::string &label_, std::vector< LinearizedRecord > &array_) const =0
 Create linearized test mark. More...
 
 TestMark ()
 Ctor. More...
 
virtual ~TestMark ()
 Dtor. More...
 
 TestMark (const TestMark &)=delete
 
TestMarkoperator= (const TestMark &)=delete
 
TestMarkHashCode getHashCode () const noexcept
 Get testmarks' hash code. More...
 
bool isEqual (const TestMark &other_, long double precision_=DEFAULT_FLOAT_PRECISION) const
 Compare two marks for equality. More...
 
bool isEqualValue (const TestMark &other_, long double precision_=DEFAULT_FLOAT_PRECISION) const
 Compare values of 2 test mark nodes. More...
 
bool isEqualValueHash (const TestMark &other_, long double precision_=DEFAULT_FLOAT_PRECISION) const
 Compare values of 2 testmark nodes and their hash codes. More...
 
void linearizedMark (std::vector< LinearizedRecord > &array_) const
 Create the linearized test mark. More...
 
void printOpen (std::ostream &os_, const std::string &prefix_) const
 Print opening of the node into a stream. More...
 
void printClose (std::ostream &os_, const std::string &prefix_) const
 Print closing of the node into a stream. More...
 
void serializeMark (TestMarkOut &serializer_) const
 Serialize the testmark into a serializer. More...
 
void deserializeMark (TestMarkFactory &factory_, TestMarkIn &deserializer_)
 Deserialize the testmark. More...
 
void computeDiff (const TestMark &other_, std::vector< LinearizedRecord > &left_, std::vector< LinearizedRecord > &right_, DiffLogBuilder &diff_) const
 Compute difference of two test marks. More...
 
void printMark (TestMarkFormatter &formatter_) const
 Print the testmark. More...
 
void printAddMark (TestMarkFormatter &formatter_) const
 Print the testmark as it's completely new. More...
 

Detailed Description

Generic interface of a test mark node.

Definition at line 41 of file testmark.h.

Constructor & Destructor Documentation

◆ TestMark() [1/2]

OTest2::TestMark::TestMark ( )

Ctor.

Definition at line 75 of file testmark.cpp.

◆ ~TestMark()

OTest2::TestMark::~TestMark ( )
virtual

Dtor.

Definition at line 79 of file testmark.cpp.

◆ TestMark() [2/2]

OTest2::TestMark::TestMark ( const TestMark )
delete

Member Function Documentation

◆ computeDiff()

void OTest2::TestMark::computeDiff ( const TestMark other_,
std::vector< LinearizedRecord > &  left_,
std::vector< LinearizedRecord > &  right_,
DiffLogBuilder diff_ 
) const

Compute difference of two test marks.

Parameters
[in]other_The second test mark
[out]left_Linearized this testmark
[out]right_Linearized other testmark
[out]diff_Generated log

Definition at line 294 of file testmark.cpp.

◆ deserializeMark()

void OTest2::TestMark::deserializeMark ( TestMarkFactory factory_,
TestMarkIn deserializer_ 
)

Deserialize the testmark.

This method reads content of the testmark from a deserializer. The object must have been created by special constructor with the CtorMark parameter.

Behavior of this method is undefined if it's invoked on an object which has not been just created.

Parameters
factory_A testmark factory
deserializer_A deserializer object

Definition at line 137 of file testmark.cpp.

◆ doLinearizedMark()

virtual void OTest2::TestMark::doLinearizedMark ( int  level_,
const std::string &  label_,
std::vector< LinearizedRecord > &  array_ 
) const
pure virtual

Create linearized test mark.

Parameters
[in]level_Nested level
[in]label_Label of the mark
[out]array_The array

◆ getHashCode()

TestMarkHashCode OTest2::TestMark::getHashCode ( ) const
noexcept

Get testmarks' hash code.

Definition at line 83 of file testmark.cpp.

◆ isEqual()

bool OTest2::TestMark::isEqual ( const TestMark other_,
long double  precision_ = DEFAULT_FLOAT_PRECISION 
) const

Compare two marks for equality.

Parameters
other_The other mark
precision_Optional precision of comparison of floating point numbers
Returns
True if the marks are equal

Definition at line 87 of file testmark.cpp.

◆ isEqualValue()

bool OTest2::TestMark::isEqualValue ( const TestMark other_,
long double  precision_ = DEFAULT_FLOAT_PRECISION 
) const

Compare values of 2 test mark nodes.

This method compares just value of current node and the other node. It doesn't traverse the test mark subtrees.

Parameters
other_The other node
precision_Optional precision of comparison of floating point numbers
Returns
True if the values of the marks are equal

Definition at line 96 of file testmark.cpp.

◆ isEqualValueHash()

bool OTest2::TestMark::isEqualValueHash ( const TestMark other_,
long double  precision_ = DEFAULT_FLOAT_PRECISION 
) const

Compare values of 2 testmark nodes and their hash codes.

This method compares just value of current node and the value of the other_ node. Furthermore, it compares the hash codes of both nodes (it's a kind of weak comparison of the whole subtree).

Parameters
other_The other node
precision_Optional precision of comparison of floating point numbers
Returns
True if the values of the marks are equal

Definition at line 105 of file testmark.cpp.

◆ linearizedMark()

void OTest2::TestMark::linearizedMark ( std::vector< LinearizedRecord > &  array_) const

Create the linearized test mark.

Parameters
[out]array_The array

Definition at line 115 of file testmark.cpp.

◆ operator=()

TestMark& OTest2::TestMark::operator= ( const TestMark )
delete

◆ printAddMark()

void OTest2::TestMark::printAddMark ( TestMarkFormatter formatter_) const

Print the testmark as it's completely new.

Parameters
formatter_A formatter object

Definition at line 324 of file testmark.cpp.

◆ printClose()

void OTest2::TestMark::printClose ( std::ostream &  os_,
const std::string &  prefix_ 
) const

Print closing of the node into a stream.

Parameters
os_The stream
prefix_Prefix just before the printed value

Definition at line 126 of file testmark.cpp.

◆ printMark()

void OTest2::TestMark::printMark ( TestMarkFormatter formatter_) const

Print the testmark.

Parameters
formatter_A formatter object

Definition at line 315 of file testmark.cpp.

◆ printOpen()

void OTest2::TestMark::printOpen ( std::ostream &  os_,
const std::string &  prefix_ 
) const

Print opening of the node into a stream.

Parameters
os_The stream
prefix_Prefix just before the printed value

Definition at line 120 of file testmark.cpp.

◆ serializeMark()

void OTest2::TestMark::serializeMark ( TestMarkOut serializer_) const

Serialize the testmark into a serializer.

Parameters
serializer_The serializer

Definition at line 132 of file testmark.cpp.


The documentation for this class was generated from the following files: