#include <dlrTest/testException.h>
Go to the source code of this file.
Defines | |
| #define | DLR_TEST_ASSERT(assertion) |
| This macro throws a TestException if its argument does not evaluate to true. | |
| #define | DLR_TEST_ASSERT_EXCEPTION(exceptionType, assertion) |
| This macro throws a TestException if its argument does not throw the specified exception when evaluated. | |
| #define | DLR_TEST_REGISTER_MEMBER(test) |
| This macro makes it easier to call the TestFixture<>::registerTest() member function. | |
Copyright (C) 2004 David LaRose, dlr@cs.cmu.edu See accompanying file, LICENSE.TXT, for details.
Definition in file testMacros.h.
| #define DLR_TEST_ASSERT | ( | assertion | ) |
Value:
{ \
if(!(assertion)) { \
DLR_THROW2(dlr::TestException, (#assertion)); \
} \
}
Example: DLR_TEST_ASSERT(x == 10);
Definition at line 27 of file testMacros.h.
| #define DLR_TEST_ASSERT_EXCEPTION | ( | exceptionType, | |||
| assertion | ) |
Value:
{ \
try { \
assertion; \
DLR_THROW2(dlr::TestException, \
(#assertion " should throw " #exceptionType)); \
} catch(const exceptionType&) {} \
}
Example: DLR_TEST_ASSERT_EXCEPTION(ValueException, functionWhichThrows());
Definition at line 40 of file testMacros.h.
| #define DLR_TEST_REGISTER_MEMBER | ( | test | ) |
Value:
{ \
this->registerTest((#test), &TestFixtureType::test); \
}
It only makes sense to use this macro from within a member function of a subclass of TestFixture.
Definition at line 55 of file testMacros.h.
1.5.8