61 #define INPUT_CHECK(i,...) do { if (!(i)) xprintf(UsrErr,__VA_ARGS__); } while (0)
76 #ifdef Flow123d_NODEBUG
87 #define DEBUG_MESSAGES
89 #define DEBUG_PROFILER
103 #ifdef DEBUG_ASSERTS_WITHOUT_MPI
104 #define MPI_Comm_rank(A, B)
105 #endif // DEBUG_ASSERTS_WITHOUT_MPI
107 #define ASSERT(i,...) do {\
110 sprintf( msg, __VA_ARGS__);\
112 MPI_Comm_rank(MPI_COMM_WORLD, &rank);\
113 THROW( ExcAssertMsg() << EI_Message(std::string(msg)) << EI_MPI_Rank(rank) );\
116 #define WARN_ASSERT(i,...) do { if (!(i)) xprintf(Warn,__VA_ARGS__); } while (0)
122 #define WARN_ASSERT(...)
130 #define ASSERT_EQUAL( a, b) do {\
131 stringstream ss; ss << (a) << " != " << (b); \
132 ASSERT( ((a) == (b)), "Violated assert: %s == %s,\n observed: %s.\n",#a, #b, ss.str().c_str()); \
136 #define ASSERT_EQUAL( a, b)
144 #define ASSERT_LESS( a, b) do {\
145 stringstream ss; ss << (a) << " >= " << (b); \
146 ASSERT( ((a) < (b)) , "Violated assert: %s < %s,\n observed: %s.\n",#a,#b, ss.str().c_str()); \
152 #if defined(ASSERT_LE) && defined(FLOW123D_INCLUDES_GTEST)
157 #define ASSERT_LE( a, b) do {\
158 stringstream ss; ss << (a) << " > " << (b); \
159 ASSERT( ((a) <= (b)) , "Violated assert: %s <= %s,\n observed: %s.\n",#a,#b, ss.str().c_str()); \
164 #define ASSERT_LESS( a, b)
165 #define ASSERT_LE( a, b)
172 #ifdef DEBUG_MESSAGES
174 #define DBGMSG(...) do { xprintf(MsgDbg,__VA_ARGS__); fflush(NULL); } while (0)
181 #define DBGCOUT(...) do { std::cout << " DBG (" \
182 << __FILE__ << ", " \
183 << __func__ << ", " \
185 __VA_ARGS__; } while(0)
192 #define DBGVAR( var ) DBGCOUT( << #var << " = " << var << endl )
215 #endif // GLOBAL_DEFS_H
static const int debug_asserts_view