testMacros.h

Go to the documentation of this file.
00001 
00014 #ifndef _DLR_TESTMACROS_H_
00015 #define _DLR_TESTMACROS_H_
00016 
00017 // Anyone who is using these macros will also want to have included
00018 // testException.h .
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_

Generated on Wed Nov 25 01:02:07 2009 for dlrTest Utility Library by  doxygen 1.5.8