test/test_tools.h
changeset 1284 ad40f7d32846
parent 810 93cd93e82f9b
     1.1 --- a/test/test_tools.h	Fri Aug 09 11:07:27 2013 +0200
     1.2 +++ b/test/test_tools.h	Sun Aug 11 15:28:12 2013 +0200
     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-2009
     1.8 + * Copyright (C) 2003-2010
     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