A container to hold all assertions. Note everything is static here. More...
#include <DwmUnitAssert.hh>
Static Public Member Functions | |
| static bool | Failed (const std::string &filename, const std::string &function, int lineNumber, const std::string &test) |
| Adds a failed assertion. | |
| static bool | Passed (const std::string &filename, const std::string &function, int lineNumber, const std::string &test) |
| Adds a passed assertion. | |
| static AssertionCounter | Total () |
| Returns the total passed and failed counter. | |
| static std::ostream & | Print (std::ostream &os, bool onlyFailed=false) |
| Prints to an ostream. | |
| static int | PrintAndReturn () |
| Prints failed tests to cerr and successful test count to cout in a simple form that I use in unit test applications. | |
| static std::ostream & | PrintJson (std::ostream &os, bool onlyFailed=false) |
| Prints to an ostream in JSON format. | |
| static std::ostream & | PrintXML (std::ostream &os, bool onlyFailed=false) |
| Prints to an ostream in XML format. | |
A container to hold all assertions. Note everything is static here.
|
static |
Adds a failed assertion.
Not called directly; UnitAssert() calls this member. Always returns false.
|
static |
Adds a passed assertion.
Not called directly; UnitAssert() calls this member. Always returns true.
|
static |
Prints to an ostream.
If onlyFailed is true, prints only information for failed assertions.
|
static |
Prints failed tests to cerr and successful test count to cout in a simple form that I use in unit test applications.
Returns 0 if all unit tests passed, else returns 1. The return value can be used as the exit value of a unit test application to signal to the shell as to whether or not all unit tests passed.