test/test_tools.h
changeset 799 6be1f9bd2ac0
parent 440 88ed40ad0d4f
child 877 141f9c0db4a3
     1.1 --- a/test/test_tools.h	Sun Oct 04 10:15:32 2009 +0200
     1.2 +++ b/test/test_tools.h	Wed Dec 09 11:14:06 2009 +0100
     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