Back to home page

Enduro/X

 
 

    


0001 #ifndef CGREEN_CPP_ASSERTIONS_H
0002 #define CGREEN_CPP_ASSERTIONS_H
0003 
0004 #define assert_throws(exceptionType, expr)                              \
0005     try {                                                               \
0006         expr;                                                           \
0007         fail_test("Expected [" #expr "] to throw [" #exceptionType "]"); \
0008     } catch (const exceptionType& ex) {                                 \
0009         pass_test();                                                    \
0010     } catch (const exceptionType* ex) {                 \
0011     pass_test();                            \
0012     }
0013 
0014 #endif