test/test_tools.h
changeset 763 93cd93e82f9b
parent 440 88ed40ad0d4f
child 877 141f9c0db4a3
     1.1 --- a/test/test_tools.h	Thu Aug 06 20:31:04 2009 +0200
     1.2 +++ b/test/test_tools.h	Fri Aug 07 14:52:40 2009 +0200
     1.3 @@ -37,10 +37,14 @@
     1.4  ///\code check(0==1,"This is obviously false.");\endcode will
     1.5  ///print something like this (and then exits).
     1.6  ///\verbatim file_name.cc:123: error: This is obviously false. \endverbatim
     1.7 -#define check(rc, msg) \
     1.8 -  if(!(rc)) { \
     1.9 -    std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \
    1.10 -    abort(); \
    1.11 -  } else { } \
    1.12 +#define check(rc, msg)                                                  \
    1.13 +  {                                                                     \
    1.14 +    if(!(rc)) {                                                         \
    1.15 +      std::cerr << __FILE__ ":" << __LINE__ << ": error: "              \
    1.16 +                << msg << std::endl;                                    \
    1.17 +      abort();                                                          \
    1.18 +    } else { }                                                          \
    1.19 +  }                                                                     \
    1.20 +    
    1.21  
    1.22  #endif