1 #ifndef TEST_EXCEPTION_H 2 #define TEST_EXCEPTION_H 47 const char *file,
int line);
56 TestException(
const char *message,
const char *file,
int line);
68 void write(std::ostream &out);
95 const char *file,
int line)
107 std::ostringstream s;
125 std::ostringstream s;
156 #define TEST_FUNC __PRETTY_FUNCTION__ 162 #define TEST_ASSERT(expr) \ 163 if (!(expr)) throw TestException(TEST_FUNC, #expr , __FILE__, __LINE__) 165 #define TEST_ASSERT(expr) \ 166 if (!(expr)) throw TestException( #expr , __FILE__, __LINE__) 173 #define TEST_THROW(msg) \ 174 throw TestException(TEST_FUNC, #msg , __FILE__, __LINE__) 176 #define TEST_THROW(msg) \ 177 throw TestException( #msg , __FILE__, __LINE__) TestException()
Default constructor.
std::string message_
Error message.
~TestException()
Destructor.
void write(std::ostream &out)
Write error message to output stream.
const std::string & message()
Return the error message.
An exception thrown by a failed unit test.