40 :
public std::exception
44 : m_strMessage(strMessage)
85 static void RunUnitTests(
int& nSucceeded,
int& nFailures);
110 static int RunTests();
129 static void Assert(
const string& strFailMessage,
bool condition);
143 static void Assert(
const string& strFailMessage,
144 uint64_t actualValue, uint64_t expectedValue);
158 static void Assert(
const string& strFailMessage,
159 const string& actualValue,
const string& expectedValue);
167 static void Fail(
const string& strMessage);
184 #define UNITTESTS(class) \ 185 void class::RunUnitTests(int& nSucceeded, int& nFailures) 217 #define UNITTEST(functionname) try { \ 218 std::cout << "### " #functionname "\n"; \ 221 } catch (UnitTestFailedException& ex) { \ 223 std::cerr << "\n### " #functionname " (" __FILE__ " line " \ 224 << __LINE__ << ") failed!\n" \ 225 " > " << ex.GetMessage() << "\n"; \
const string & GetMessage() const
Retrieves the error message associated with the exception.
virtual ~UnitTestFailedException()
An exception thrown by unit test cases that fail.
UnitTestFailedException(const string &strMessage)
A collection of helper functions, for writing simple unit tests.
Base class for unit testable classes.