OTest2
A C++ testing framework
|
Assertion stream. More...
#include <assertstream.h>
Public Member Functions | |
AssertStream (const AssertStream &)=delete | |
AssertStream & | operator= (const AssertStream &)=delete |
AssertStream (const Context &context_, AssertBufferPtr buffer_, bool result_, std::initializer_list< const char * > parameters_) | |
Ctor. More... | |
AssertStream (AssertStream &&other_) | |
Move ctor. More... | |
virtual | ~AssertStream () |
Dtor. More... | |
void | setForeground (Color color_) |
Set foreground color. More... | |
void | setBackground (Color color_) |
Set background color. More... | |
void | setTextStyle (Style style_) |
Set text style. More... | |
void | resetAttributes () |
Reset the color and style attributes. More... | |
void | printParameter (int index_) |
Print assertion parameter at the zero based index_. More... | |
void | commitMessage () |
Commit the assertion message. More... | |
bool | getResult () |
Return the assertion result. More... | |
Assertion stream.
The assertion stream is used to construct assertion messages. Beside traditional text formatting it allows to colorize the output.
Definition at line 40 of file assertstream.h.
|
delete |
|
explicit |
Ctor.
context_ | OTest2 context |
buffer_ | An assertion buffer |
result_ | Result of the assertion |
parameters_ | Text strings representing assertion parameters. |
Definition at line 29 of file assertstream.cpp.
OTest2::AssertStream::AssertStream | ( | AssertStream && | other_ | ) |
Move ctor.
Definition at line 43 of file assertstream.cpp.
|
virtual |
Dtor.
Definition at line 52 of file assertstream.cpp.
void OTest2::AssertStream::commitMessage | ( | ) |
Commit the assertion message.
Definition at line 88 of file assertstream.cpp.
bool OTest2::AssertStream::getResult | ( | ) |
Return the assertion result.
This is a helper method which is designated to be used at the end of the assertion function. The user doesn't keep the result flag himself.
Definition at line 93 of file assertstream.cpp.
|
delete |
void OTest2::AssertStream::printParameter | ( | int | index_ | ) |
Print assertion parameter at the zero based index_.
Definition at line 80 of file assertstream.cpp.
void OTest2::AssertStream::resetAttributes | ( | ) |
Reset the color and style attributes.
Definition at line 75 of file assertstream.cpp.
void OTest2::AssertStream::setBackground | ( | Color | color_ | ) |
void OTest2::AssertStream::setForeground | ( | Color | color_ | ) |
void OTest2::AssertStream::setTextStyle | ( | Style | style_ | ) |