OTest2
A C++ testing framework
|
Generic interface of a test mark node. More...
#include <testmark.h>
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 | |
TestMark & | operator= (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... | |
Generic interface of a test mark node.
Definition at line 41 of file testmark.h.
OTest2::TestMark::TestMark | ( | ) |
Ctor.
Definition at line 75 of file testmark.cpp.
|
virtual |
Dtor.
Definition at line 79 of file testmark.cpp.
|
delete |
void OTest2::TestMark::computeDiff | ( | const TestMark & | other_, |
std::vector< LinearizedRecord > & | left_, | ||
std::vector< LinearizedRecord > & | right_, | ||
DiffLogBuilder & | diff_ | ||
) | const |
Compute difference of two test marks.
[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.
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.
factory_ | A testmark factory |
deserializer_ | A deserializer object |
Definition at line 137 of file testmark.cpp.
|
pure virtual |
Create linearized test mark.
[in] | level_ | Nested level |
[in] | label_ | Label of the mark |
[out] | array_ | The array |
|
noexcept |
Get testmarks' hash code.
Definition at line 83 of file testmark.cpp.
bool OTest2::TestMark::isEqual | ( | const TestMark & | other_, |
long double | precision_ = DEFAULT_FLOAT_PRECISION |
||
) | const |
Compare two marks for equality.
other_ | The other mark |
precision_ | Optional precision of comparison of floating point numbers |
Definition at line 87 of file testmark.cpp.
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.
other_ | The other node |
precision_ | Optional precision of comparison of floating point numbers |
Definition at line 96 of file testmark.cpp.
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).
other_ | The other node |
precision_ | Optional precision of comparison of floating point numbers |
Definition at line 105 of file testmark.cpp.
void OTest2::TestMark::linearizedMark | ( | std::vector< LinearizedRecord > & | array_ | ) | const |
Create the linearized test mark.
[out] | array_ | The array |
Definition at line 115 of file testmark.cpp.
void OTest2::TestMark::printAddMark | ( | TestMarkFormatter & | formatter_ | ) | const |
Print the testmark as it's completely new.
formatter_ | A formatter object |
Definition at line 324 of file testmark.cpp.
void OTest2::TestMark::printClose | ( | std::ostream & | os_, |
const std::string & | prefix_ | ||
) | const |
Print closing of the node into a stream.
os_ | The stream |
prefix_ | Prefix just before the printed value |
Definition at line 126 of file testmark.cpp.
void OTest2::TestMark::printMark | ( | TestMarkFormatter & | formatter_ | ) | const |
Print the testmark.
formatter_ | A formatter object |
Definition at line 315 of file testmark.cpp.
void OTest2::TestMark::printOpen | ( | std::ostream & | os_, |
const std::string & | prefix_ | ||
) | const |
Print opening of the node into a stream.
os_ | The stream |
prefix_ | Prefix just before the printed value |
Definition at line 120 of file testmark.cpp.
void OTest2::TestMark::serializeMark | ( | TestMarkOut & | serializer_ | ) | const |
Serialize the testmark into a serializer.
serializer_ | The serializer |
Definition at line 132 of file testmark.cpp.