00001
00010 #ifndef TESTTOOLS_EXPECT_EXCEPTION_H
00011 #define TESTTOOLS_EXPECT_EXCEPTION_H
00012
00013
00014 #include <cassert>
00015
00016
00029 #define EXPECT_EXCEPTION(EXC, CODE) do { \
00030 bool caught = false; \
00031 try { \
00032 CODE; \
00033 } \
00034 catch (const EXC&) { \
00035 caught = true; \
00036 } \
00037 assert (caught); \
00038 } while(0)
00039
00040
00041 #endif // not TESTTOOLS_EXPECT_EXCEPTION_H