1#ifndef TEST_EXCEPTION_H
2#define TEST_EXCEPTION_H
47 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__)
An exception thrown by a failed unit test.
const std::string & message()
Return the error message.
void write(std::ostream &out)
Write error message to output stream.
TestException()
Default constructor.
std::string message_
Error message.
~TestException()
Destructor.