testMacros.h
Go to the documentation of this file.00001
00014 #ifndef _DLR_TESTMACROS_H_
00015 #define _DLR_TESTMACROS_H_
00016
00017
00018
00019 #include <dlrTest/testException.h>
00020
00027 #define DLR_TEST_ASSERT(assertion) { \
00028 if(!(assertion)) { \
00029 DLR_THROW2(dlr::TestException, (#assertion)); \
00030 } \
00031 }
00032
00033
00040 #define DLR_TEST_ASSERT_EXCEPTION(exceptionType, assertion) { \
00041 try { \
00042 assertion; \
00043 DLR_THROW2(dlr::TestException, \
00044 (#assertion " should throw " #exceptionType)); \
00045 } catch(const exceptionType&) {} \
00046 }
00047
00048
00055 #define DLR_TEST_REGISTER_MEMBER(test) { \
00056 this->registerTest((#test), &TestFixtureType::test); \
00057 }
00058
00059
00060 #endif // #ifndef _DLR_TESTMACROS_H_