FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
Asserts.h
1 #ifndef ASSERTS_H
2 #define ASSERTS_H
3 
4 // Abbreviations for assertions in cppunit.
5 
6 #define EQMSG(msg, a, b) CPPUNIT_ASSERT_EQUAL_MESSAGE(msg,a,b)
7 #define EQ(a,b) CPPUNIT_ASSERT_EQUAL(a,b)
8 #define ASSERT(expr) CPPUNIT_ASSERT(expr)
9 #define FAIL(msg) CPPUNIT_FAIL(msg)
10 
11 // Macro to test for exceptions:
12 
13 #define EXCEPTION(operation, type) \
14  { \
15  bool ok = false; \
16  try { \
17  operation; \
18  } \
19  catch (type e) { \
20  ok = true; \
21  } \
22  ASSERT(ok); \
23  }
24 
25 
26 #endif