Go to the documentation of this file.
61 #define INPUT_CHECK(i,...) do { if (!(i)) xprintf(UsrErr,__VA_ARGS__); } while (0)
76 #ifdef Flow123d_NODEBUG
81 #undef DEBUG_FUNCTION_STACK
88 #define DEBUG_MESSAGES
90 #define DEBUG_PROFILER
91 #define DEBUG_FUNCTION_STACK
105 #ifdef DEBUG_ASSERTS_WITHOUT_MPI
106 #define MPI_Comm_rank(A, B)
107 #endif // DEBUG_ASSERTS_WITHOUT_MPI
109 #define ASSERT(i,...) do {\
112 sprintf( msg, __VA_ARGS__);\
114 MPI_Comm_rank(MPI_COMM_WORLD, &rank);\
115 THROW( ExcAssertMsg() << EI_Message(std::string(msg)) << EI_MPI_Rank(rank) );\
118 #define WARN_ASSERT(i,...) do { if (!(i)) xprintf(Warn,__VA_ARGS__); } while (0)
124 #define WARN_ASSERT(...)
132 #define ASSERT_EQUAL( a, b) do {\
133 stringstream ss; ss << (a) << " != " << (b); \
134 ASSERT( ((a) == (b)), "Violated assert: %s == %s,\n observed: %s.\n",#a, #b, ss.str().c_str()); \
138 #define ASSERT_EQUAL( a, b)
146 #define ASSERT_LESS( a, b) do {\
147 stringstream ss; ss << (a) << " >= " << (b); \
148 ASSERT( ((a) < (b)) , "Violated assert: %s < %s,\n observed: %s.\n",#a,#b, ss.str().c_str()); \
154 #if defined(ASSERT_LE) && defined(FLOW123D_INCLUDES_GTEST)
159 #define ASSERT_LE( a, b) do {\
160 stringstream ss; ss << (a) << " > " << (b); \
161 ASSERT( ((a) <= (b)) , "Violated assert: %s <= %s,\n observed: %s.\n",#a,#b, ss.str().c_str()); \
166 #define ASSERT_LESS( a, b)
167 #define ASSERT_LE( a, b)
174 #ifdef DEBUG_MESSAGES
176 #define DBGMSG(...) do { xprintf(MsgDbg,__VA_ARGS__); fflush(NULL); } while (0)
183 #define DBGCOUT(...) do { std::cout << " DBG (" \
184 << __FILE__ << ", " \
185 << __func__ << ", " \
187 __VA_ARGS__; } while(0)
194 #define DBGVAR( var ) DBGCOUT( << #var << " = " << var << endl )
206 #endif // GLOBAL_DEFS_H