test/test_tools.h
changeset 784 1a7fe3bef514
parent 440 88ed40ad0d4f
child 877 141f9c0db4a3
     1.1 --- a/test/test_tools.h	Fri Oct 16 10:21:37 2009 +0200
     1.2 +++ b/test/test_tools.h	Thu Nov 05 15:50:01 2009 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2008
     1.8 + * Copyright (C) 2003-2009
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -37,10 +37,14 @@
    1.13  ///\code check(0==1,"This is obviously false.");\endcode will
    1.14  ///print something like this (and then exits).
    1.15  ///\verbatim file_name.cc:123: error: This is obviously false. \endverbatim
    1.16 -#define check(rc, msg) \
    1.17 -  if(!(rc)) { \
    1.18 -    std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \
    1.19 -    abort(); \
    1.20 -  } else { } \
    1.21 +#define check(rc, msg)                                                  \
    1.22 +  {                                                                     \
    1.23 +    if(!(rc)) {                                                         \
    1.24 +      std::cerr << __FILE__ ":" << __LINE__ << ": error: "              \
    1.25 +                << msg << std::endl;                                    \
    1.26 +      abort();                                                          \
    1.27 +    } else { }                                                          \
    1.28 +  }                                                                     \
    1.29 +    
    1.30  
    1.31  #endif