src/graph/test.h

00001 #ifndef _HT_GRAPH_TEST_H
00002 #define _HT_GRAPH_TEST_H
00003 
00004 #define ASSERT_ERROR_MESSAGE(expr, ExceptionType, msg) {                \
00005     try {                                                               \
00006         expr;                                                           \
00007       CPPUNIT_NS::Asserter::fail( "No exception thrown",                \
00008                                   CPPUNIT_SOURCELINE() );               \
00009     } catch(ExceptionType & e) {                                        \
00010         std::string err = e.what();                                     \
00011         CPPUNIT_ASSERT(err.find(msg) != std::string::npos);             \
00012     } catch (...) {                                                     \
00013       CPPUNIT_NS::Asserter::fail( "Unexpected exception caught",        \
00014                                   CPPUNIT_SOURCELINE() );               \
00015     }                                                                   \
00016 }
00017 
00018 #endif

Generated on Thu Jan 3 15:26:45 2008 by  doxygen 1.5.2