Asserts.h

Go to the documentation of this file.
00001 #ifndef __ASSERTS_H
00002 #define __ASSERTS_H
00003 
00004 // Abbreviations for assertions in cppunit.
00005 
00006 #define EQMSG(msg, a, b)   CPPUNIT_ASSERT_EQUAL_MESSAGE(msg,a,b)
00007 #define EQ(a,b)            CPPUNIT_ASSERT_EQUAL(a,b)
00008 #define ASSERT(expr)       CPPUNIT_ASSERT(expr)
00009 #define FAIL(msg)          CPPUNIT_FAIL(msg)
00010 
00011 // Macro to test for exceptions:
00012 //   Peforms operation and requires an
00013 //   exception of `type'.
00014 //
00015 
00016 #define EXCEPTION(operation, type) \
00017    {                               \
00018      bool ok = false;              \
00019      try {                         \
00020          operation;                 \
00021      }                             \
00022      catch (type& e) {              \
00023        ok = true;                  \
00024      }                             \
00025      ASSERT(ok);                   \
00026    }
00027 
00028 
00029 #endif

Generated on Wed Sep 17 08:38:09 2008 for NSCL Device support. by  doxygen 1.5.1