Peano 4
Loading...
Searching...
No Matches
Assertions.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#include "config.h"
6
7#ifdef Parallel
8#include <mpi.h>
9#endif
10
11#if PeanoDebug>=1
12#include <stdio.h>
13#include <stdlib.h>
14#endif
15#include <cassert>
16#include <cstdio>
17
19
33 #define ASSERTION_EXIT_CODE -1
34
35 #define setAssertionOutputFormat { \
36 std::cerr.setf( std::ios_base::scientific, std::ios_base::floatfield ); \
37 std::cerr.precision(20); \
38 }
39
40 #if PeanoDebug>=2
41 #include "tarch/logging/Log.h"
42 #define assertionTriggersExit { \
43 std::cout.flush(); \
44 std::cerr.flush(); \
45 tarch::logging::Log::flushBeforeAssertion(); \
46 assert(false); \
47 exit(ASSERTION_EXIT_CODE); \
48 }
49
56 #define assertion(expr) if (!(expr)) { \
57 setAssertionOutputFormat; \
58 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
59 assertionTriggersExit; \
60 }
61
70 #define assertion1(expr,param) if (!(expr)) { \
71 setAssertionOutputFormat; \
72 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
73 std::cerr << "parameter " << #param << ": " << param << std::endl; \
74 assertionTriggersExit; \
75 }
76
77
78 #define assertion1WithExplanation(expr,param,explanation) if (!(expr)) { \
79 setAssertionOutputFormat; \
80 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
81 std::cerr << "parameter " << #param << ": " << param << std::endl; \
82 std::cerr << explanation << std::endl; \
83 assertionTriggersExit; \
84 }
85
86
95 #define assertion2(expr,param0,param1) if (!(expr)) { \
96 setAssertionOutputFormat; \
97 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
98 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
99 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
100 assertionTriggersExit; \
101 }
102
111 #define assertion3(expr,param0,param1,param2) if (!(expr)) { \
112 setAssertionOutputFormat; \
113 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
114 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
115 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
116 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
117 assertionTriggersExit; \
118 }
119
128 #define assertion4(expr,param0,param1,param2,param3) if (!(expr)) { \
129 setAssertionOutputFormat; \
130 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
131 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
132 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
133 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
134 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
135 assertionTriggersExit; \
136 }
137
146 #define assertion5(expr,param0,param1,param2,param3,param4) if (!(expr)) { \
147 setAssertionOutputFormat; \
148 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
149 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
150 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
151 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
152 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
153 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
154 assertionTriggersExit; \
155 }
156
165 #define assertion6(expr,param0,param1,param2,param3,param4,param5) if (!(expr)) { \
166 setAssertionOutputFormat; \
167 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
168 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
169 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
170 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
171 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
172 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
173 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
174 assertionTriggersExit; \
175 }
176
185 #define assertion7(expr,param0,param1,param2,param3,param4,param5,param6) if (!(expr)) { \
186 setAssertionOutputFormat; \
187 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
188 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
189 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
190 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
191 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
192 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
193 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
194 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
195 assertionTriggersExit; \
196 }
197
206 #define assertion8(expr,param0,param1,param2,param3,param4,param5,param6,param7) if (!(expr)) { \
207 setAssertionOutputFormat; \
208 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
209 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
210 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
211 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
212 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
213 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
214 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
215 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
216 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
217 assertionTriggersExit; \
218 }
219
228 #define assertion9(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8) if (!(expr)) { \
229 setAssertionOutputFormat; \
230 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
231 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
232 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
233 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
234 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
235 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
236 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
237 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
238 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
239 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
240 assertionTriggersExit; \
241 }
242
243
244 #define assertion10(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9) if (!(expr)) { \
245 setAssertionOutputFormat; \
246 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
247 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
248 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
249 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
250 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
251 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
252 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
253 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
254 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
255 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
256 std::cerr << "parameter " << #param9 << ": " << param9 << std::endl; \
257 assertionTriggersExit; \
258 }
259
260
261 #define assertion11(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10) if (!(expr)) { \
262 setAssertionOutputFormat; \
263 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
264 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
265 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
266 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
267 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
268 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
269 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
270 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
271 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
272 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
273 std::cerr << "parameter " << #param9 << ": " << param9 << std::endl; \
274 std::cerr << "parameter " << #param10 << ": " << param10 << std::endl; \
275 assertionTriggersExit; \
276 }
277
278
279 #define assertion12(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11) if (!(expr)) { \
280 setAssertionOutputFormat; \
281 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
282 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
283 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
284 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
285 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
286 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
287 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
288 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
289 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
290 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
291 std::cerr << "parameter " << #param9 << ": " << param9 << std::endl; \
292 std::cerr << "parameter " << #param10 << ": " << param10 << std::endl; \
293 std::cerr << "parameter " << #param11 << ": " << param11 << std::endl; \
294 assertionTriggersExit; \
295 }
296
297
298 #define assertion13(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12) if (!(expr)) { \
299 setAssertionOutputFormat; \
300 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
301 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
302 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
303 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
304 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
305 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
306 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
307 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
308 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
309 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
310 std::cerr << "parameter " << #param9 << ": " << param9 << std::endl; \
311 std::cerr << "parameter " << #param10 << ": " << param10 << std::endl; \
312 std::cerr << "parameter " << #param11 << ": " << param11 << std::endl; \
313 std::cerr << "parameter " << #param12 << ": " << param12 << std::endl; \
314 assertionTriggersExit; \
315 }
316
317
318 #define assertion14(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12,param13) if (!(expr)) { \
319 setAssertionOutputFormat; \
320 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
321 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
322 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
323 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
324 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
325 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
326 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
327 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
328 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
329 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
330 std::cerr << "parameter " << #param9 << ": " << param9 << std::endl; \
331 std::cerr << "parameter " << #param10 << ": " << param10 << std::endl; \
332 std::cerr << "parameter " << #param11 << ": " << param11 << std::endl; \
333 std::cerr << "parameter " << #param12 << ": " << param12 << std::endl; \
334 std::cerr << "parameter " << #param13 << ": " << param13 << std::endl; \
335 assertionTriggersExit; \
336 }
337
338
339 #define assertion25(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12,param13,param14,param15,param16,param17,param18,param19,param20,param21,param22,param23,param24) if (!(expr)) { \
340 setAssertionOutputFormat; \
341 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl; \
342 std::cerr << "parameter " << #param0 << ": " << param0 << std::endl; \
343 std::cerr << "parameter " << #param1 << ": " << param1 << std::endl; \
344 std::cerr << "parameter " << #param2 << ": " << param2 << std::endl; \
345 std::cerr << "parameter " << #param3 << ": " << param3 << std::endl; \
346 std::cerr << "parameter " << #param4 << ": " << param4 << std::endl; \
347 std::cerr << "parameter " << #param5 << ": " << param5 << std::endl; \
348 std::cerr << "parameter " << #param6 << ": " << param6 << std::endl; \
349 std::cerr << "parameter " << #param7 << ": " << param7 << std::endl; \
350 std::cerr << "parameter " << #param8 << ": " << param8 << std::endl; \
351 std::cerr << "parameter " << #param9 << ": " << param9 << std::endl; \
352 std::cerr << "parameter " << #param10 << ": " << param10 << std::endl; \
353 std::cerr << "parameter " << #param11 << ": " << param11 << std::endl; \
354 std::cerr << "parameter " << #param12 << ": " << param12 << std::endl; \
355 std::cerr << "parameter " << #param13 << ": " << param13 << std::endl; \
356 std::cerr << "parameter " << #param14 << ": " << param14 << std::endl; \
357 std::cerr << "parameter " << #param15 << ": " << param15 << std::endl; \
358 std::cerr << "parameter " << #param16 << ": " << param16 << std::endl; \
359 std::cerr << "parameter " << #param17 << ": " << param17 << std::endl; \
360 std::cerr << "parameter " << #param18 << ": " << param18 << std::endl; \
361 std::cerr << "parameter " << #param19 << ": " << param19 << std::endl; \
362 std::cerr << "parameter " << #param20 << ": " << param20 << std::endl; \
363 std::cerr << "parameter " << #param21 << ": " << param21 << std::endl; \
364 std::cerr << "parameter " << #param22 << ": " << param22 << std::endl; \
365 std::cerr << "parameter " << #param23 << ": " << param23 << std::endl; \
366 std::cerr << "parameter " << #param24 << ": " << param24 << std::endl; \
367 assertionTriggersExit; \
368 }
369
370
377 #define assertionEquals(lhs,rhs) if ((lhs)!=(rhs)) { \
378 setAssertionOutputFormat; \
379 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
380 assertionTriggersExit; \
381 }
382
389 #define assertionEqualsMsg(lhs,rhs,msg) if ((lhs)!=(rhs)) { \
390 setAssertionOutputFormat; \
391 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
392 std::cerr << msg << std::endl; \
393 assertionTriggersExit; \
394 }
395
405 #define assertionEquals1(lhs,rhs,larg) if ((lhs)!=(rhs)) { \
406 setAssertionOutputFormat; \
407 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
408 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
409 assertionTriggersExit; \
410 }
411
421 #define assertionEquals2(lhs,rhs,larg,rarg) if ((lhs)!=(rhs)) { \
422 setAssertionOutputFormat; \
423 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
424 std::cerr << "left argument " << #larg << ": " << larg << std::endl; \
425 std::cerr << "right argument " << #rarg << ": " << rarg << std::endl; \
426 assertionTriggersExit; \
427 }
428
438 #define assertionEquals3(lhs,rhs,larg,rarg,three) if ((lhs)!=(rhs)) { \
439 setAssertionOutputFormat; \
440 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
441 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
442 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
443 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
444 assertionTriggersExit; \
445 }
446
456 #define assertionEquals4(lhs,rhs,larg,rarg,three,four) if ((lhs)!=(rhs)) { \
457 setAssertionOutputFormat; \
458 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
459 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
460 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
461 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
462 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
463 assertionTriggersExit; \
464 }
465
475 #define assertionEquals5(lhs,rhs,larg,rarg,three,four,five) if ((lhs)!=(rhs)) { \
476 setAssertionOutputFormat; \
477 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
478 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
479 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
480 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
481 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
482 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
483 assertionTriggersExit; \
484 }
485
495 #define assertionEquals6(lhs,rhs,larg,rarg,three,four,five,six) if ((lhs)!=(rhs)) { \
496 setAssertionOutputFormat; \
497 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
498 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
499 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
500 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
501 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
502 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
503 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
504 assertionTriggersExit; \
505 }
506
516 #define assertionEquals7(lhs,rhs,larg,rarg,three,four,five,six,seven) if ((lhs)!=(rhs)) { \
517 setAssertionOutputFormat; \
518 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
519 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
520 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
521 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
522 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
523 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
524 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
525 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
526 assertionTriggersExit; \
527 }
528
538 #define assertionEquals8(lhs,rhs,larg,rarg,three,four,five,six,seven,eight) if ((lhs)!=(rhs)) { \
539 setAssertionOutputFormat; \
540 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
541 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
542 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
543 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
544 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
545 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
546 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
547 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
548 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
549 assertionTriggersExit; \
550 }
551
552 #define assertionEquals9(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine) if ((lhs)!=(rhs)) { \
553 setAssertionOutputFormat; \
554 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
555 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
556 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
557 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
558 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
559 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
560 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
561 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
562 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
563 std::cerr << "9th argument " << #nine << ": " << nine << std::endl; \
564 assertionTriggersExit; \
565 }
566
567
568 #define assertionEquals10(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine,ten) if ((lhs)!=(rhs)) { \
569 setAssertionOutputFormat; \
570 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
571 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
572 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
573 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
574 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
575 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
576 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
577 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
578 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
579 std::cerr << "9th argument " << #nine << ": " << nine << std::endl; \
580 std::cerr << "10th argument " << #ten << ": " << ten << std::endl; \
581 assertionTriggersExit; \
582 }
583
584
585 #define assertionEquals11(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine,ten,p11) if ((lhs)!=(rhs)) { \
586 setAssertionOutputFormat; \
587 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
588 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
589 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
590 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
591 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
592 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
593 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
594 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
595 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
596 std::cerr << "9th argument " << #nine << ": " << nine << std::endl; \
597 std::cerr << "10th argument " << #ten << ": " << ten << std::endl; \
598 std::cerr << "11th argument " << #p11<< ": " << p11 << std::endl; \
599 assertionTriggersExit; \
600 }
601
602
603 #define assertionEquals12(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine,ten,p11,p12) if ((lhs)!=(rhs)) { \
604 setAssertionOutputFormat; \
605 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
606 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
607 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
608 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
609 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
610 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
611 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
612 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
613 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
614 std::cerr << "9th argument " << #nine << ": " << nine << std::endl; \
615 std::cerr << "10th argument " << #ten << ": " << ten << std::endl; \
616 std::cerr << "11th argument " << #p11<< ": " << p11 << std::endl; \
617 std::cerr << "12th argument " << #p12<< ": " << p12 << std::endl; \
618 assertionTriggersExit; \
619 }
620
621
622 #define assertionEquals13(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine,ten,p11,p12,p13) if ((lhs)!=(rhs)) { \
623 setAssertionOutputFormat; \
624 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
625 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
626 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
627 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
628 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
629 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
630 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
631 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
632 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
633 std::cerr << "9th argument " << #nine << ": " << nine << std::endl; \
634 std::cerr << "10th argument " << #ten << ": " << ten << std::endl; \
635 std::cerr << "11th argument " << #p11<< ": " << p11 << std::endl; \
636 std::cerr << "12th argument " << #p12<< ": " << p12 << std::endl; \
637 std::cerr << "13th argument " << #p13<< ": " << p13 << std::endl; \
638 assertionTriggersExit; \
639 }
640
641
642 #define assertionEquals14(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine,ten,p11,p12,p13,p14) if ((lhs)!=(rhs)) { \
643 setAssertionOutputFormat; \
644 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t" << #rhs << "=" << rhs << std::endl; \
645 std::cerr << "1st argument " << #larg << ": " << larg << std::endl; \
646 std::cerr << "2nd argument " << #rarg << ": " << rarg << std::endl; \
647 std::cerr << "3rd argument " << #three << ": " << three << std::endl; \
648 std::cerr << "4th argument " << #four << ": " << four << std::endl; \
649 std::cerr << "5th argument " << #five << ": " << five << std::endl; \
650 std::cerr << "6th argument " << #six << ": " << six << std::endl; \
651 std::cerr << "7th argument " << #seven << ": " << seven << std::endl; \
652 std::cerr << "8th argument " << #eight << ": " << eight << std::endl; \
653 std::cerr << "9th argument " << #nine << ": " << nine << std::endl; \
654 std::cerr << "10th argument " << #ten << ": " << ten << std::endl; \
655 std::cerr << "11th argument " << #p11<< ": " << p11 << std::endl; \
656 std::cerr << "12th argument " << #p12<< ": " << p12 << std::endl; \
657 std::cerr << "13th argument " << #p13<< ": " << p13 << std::endl; \
658 std::cerr << "14th argument " << #p14<< ": " << p14 << std::endl; \
659 assertionTriggersExit; \
660 }
661
669 #define assertionNumericalEquals(lhs,rhs) if (!tarch::la::equals( (lhs),(rhs) )) { setAssertionOutputFormat; std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; assertionTriggersExit; }
670
682 #define assertionNumericalEquals1(lhs,rhs,a) if (!tarch::la::equals( (lhs),(rhs) )) { \
683 setAssertionOutputFormat; \
684 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
685 std::cerr << "argument " << #a << ": " << a << std::endl; \
686 assertionTriggersExit; \
687 }
688
700 #define assertionNumericalEquals2(lhs,rhs,larg,rarg) if (!tarch::la::equals( (lhs),(rhs) )) { \
701 setAssertionOutputFormat; \
702 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
703 std::cerr << "left argument " << #larg << ": " << larg << std::endl; \
704 std::cerr << "right argument " << #rarg << ": " << rarg << std::endl; \
705 assertionTriggersExit; \
706 }
707
719 #define assertionNumericalEquals3(lhs,rhs,a,b,c) if (!tarch::la::equals( (lhs),(rhs) )) { \
720 setAssertionOutputFormat; \
721 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
722 std::cerr << "first argument " << #a << ": " << a << std::endl; \
723 std::cerr << "second argument " << #b << ": " << b << std::endl; \
724 std::cerr << "third argument " << #c << ": " << c << std::endl; \
725 assertionTriggersExit; \
726 }
727
739 #define assertionNumericalEquals4(lhs,rhs,a,b,c,d) if (!tarch::la::equals( (lhs),(rhs) )) { \
740 setAssertionOutputFormat; \
741 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
742 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
743 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
744 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
745 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
746 assertionTriggersExit; \
747 }
748
760 #define assertionNumericalEquals5(lhs,rhs,a,b,c,d,e) if (!tarch::la::equals( (lhs),(rhs) )) { \
761 setAssertionOutputFormat; \
762 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
763 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
764 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
765 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
766 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
767 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
768 assertionTriggersExit; \
769 }
770
782 #define assertionNumericalEquals6(lhs,rhs,a,b,c,d,e,f) if (!tarch::la::equals( (lhs),(rhs) )) { \
783 setAssertionOutputFormat; \
784 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
785 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
786 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
787 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
788 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
789 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
790 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
791 assertionTriggersExit; \
792 }
793
805 #define assertionNumericalEquals7(lhs,rhs,a,b,c,d,e,f,g) if (!tarch::la::equals( (lhs),(rhs) )) { \
806 setAssertionOutputFormat; \
807 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
808 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
809 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
810 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
811 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
812 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
813 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
814 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
815 assertionTriggersExit; \
816 }
817
829 #define assertionNumericalEquals8(lhs,rhs,a,b,c,d,e,f,g,h) if (!tarch::la::equals( (lhs),(rhs) )) { \
830 setAssertionOutputFormat; \
831 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
832 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
833 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
834 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
835 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
836 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
837 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
838 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
839 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
840 assertionTriggersExit; \
841 }
842
854 #define assertionNumericalEquals9(lhs,rhs,a,b,c,d,e,f,g,h,i) if (!tarch::la::equals( (lhs),(rhs) )) { \
855 setAssertionOutputFormat; \
856 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
857 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
858 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
859 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
860 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
861 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
862 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
863 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
864 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
865 std::cerr << "9th argument " << #i << ": " << i << std::endl; \
866 assertionTriggersExit; \
867 }
868
880 #define assertionNumericalEquals10(lhs,rhs,a,b,c,d,e,f,g,h,i,j) if (!tarch::la::equals( (lhs),(rhs) )) { \
881 setAssertionOutputFormat; \
882 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
883 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
884 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
885 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
886 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
887 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
888 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
889 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
890 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
891 std::cerr << "9th argument " << #i << ": " << i << std::endl; \
892 std::cerr << "10th argument " << #j << ": " << j << std::endl; \
893 assertionTriggersExit; \
894 }
895
896 #define assertionNumericalEquals11(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k) if (!tarch::la::equals( (lhs),(rhs) )) { \
897 setAssertionOutputFormat; \
898 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
899 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
900 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
901 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
902 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
903 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
904 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
905 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
906 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
907 std::cerr << "9th argument " << #i << ": " << i << std::endl; \
908 std::cerr << "10th argument " << #j << ": " << j << std::endl; \
909 std::cerr << "11th argument " << #k << ": " << k << std::endl; \
910 assertionTriggersExit; \
911 }
912
913 #define assertionNumericalEquals12(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k,l) if (!tarch::la::equals( (lhs),(rhs) )) { \
914 setAssertionOutputFormat; \
915 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
916 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
917 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
918 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
919 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
920 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
921 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
922 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
923 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
924 std::cerr << "9th argument " << #i << ": " << i << std::endl; \
925 std::cerr << "10th argument " << #j << ": " << j << std::endl; \
926 std::cerr << "11th argument " << #k << ": " << k << std::endl; \
927 std::cerr << "12th argument " << #l << ": " << l << std::endl; \
928 assertionTriggersExit; \
929 }
930
931 #define assertionNumericalEquals13(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k,l,m) if (!tarch::la::equals( (lhs),(rhs) )) { \
932 setAssertionOutputFormat; \
933 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
934 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
935 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
936 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
937 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
938 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
939 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
940 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
941 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
942 std::cerr << "9th argument " << #i << ": " << i << std::endl; \
943 std::cerr << "10th argument " << #j << ": " << j << std::endl; \
944 std::cerr << "11th argument " << #k << ": " << k << std::endl; \
945 std::cerr << "12th argument " << #l << ": " << l << std::endl; \
946 std::cerr << "13th argument " << #m << ": " << m << std::endl; \
947 assertionTriggersExit; \
948 }
949
950 #define assertionNumericalEquals14(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k,l,m,n) if (!tarch::la::equals( (lhs),(rhs) )) { \
951 setAssertionOutputFormat; \
952 std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #lhs << "==" #rhs << std::endl << #lhs << "=" << lhs << "\t == \t" << #rhs << "=" << rhs << std::endl; \
953 std::cerr << "1st argument " << #a << ": " << a << std::endl; \
954 std::cerr << "2nd argument " << #b << ": " << b << std::endl; \
955 std::cerr << "3rd argument " << #c << ": " << c << std::endl; \
956 std::cerr << "4th argument " << #d << ": " << d << std::endl; \
957 std::cerr << "5th argument " << #e << ": " << e << std::endl; \
958 std::cerr << "6th argument " << #f << ": " << f << std::endl; \
959 std::cerr << "7th argument " << #g << ": " << g << std::endl; \
960 std::cerr << "8th argument " << #h << ": " << h << std::endl; \
961 std::cerr << "9th argument " << #i << ": " << i << std::endl; \
962 std::cerr << "10th argument " << #j << ": " << j << std::endl; \
963 std::cerr << "11th argument " << #k << ": " << k << std::endl; \
964 std::cerr << "12th argument " << #l << ": " << l << std::endl; \
965 std::cerr << "13th argument " << #m << ": " << m << std::endl; \
966 std::cerr << "14th argument " << #n << ": " << n << std::endl; \
967 assertionTriggersExit; \
968 }
969
983 #define assertionVectorNumericalEquals(lhs,rhs) assertion2( tarch::la::equals( lhs,rhs ),lhs,rhs);
984 #define assertionVectorNumericalEquals1(lhs,rhs,param0) assertion3( tarch::la::equals( lhs,rhs ),lhs,rhs,param0);
985 #define assertionVectorNumericalEquals2(lhs,rhs,param0,param1) assertion4( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1);
986 #define assertionVectorNumericalEquals3(lhs,rhs,param0,param1,param2) assertion5( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2);
987 #define assertionVectorNumericalEquals4(lhs,rhs,param0,param1,param2,param3) assertion6( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3);
988 #define assertionVectorNumericalEquals5(lhs,rhs,param0,param1,param2,param3,param4) assertion7( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3,param4);
989 #define assertionVectorNumericalEquals6(lhs,rhs,param0,param1,param2,param3,param4,param5) assertion8( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3,param4,param5);
990 #define assertionVectorNumericalEquals7(lhs,rhs,param0,param1,param2,param3,param4,param5,param6) assertion9( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3,param4,param5,param6);
991 #define assertionVectorNumericalEquals8(lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7) assertion10( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7);
992 #define assertionVectorNumericalEquals9(lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7,param8) assertion11( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7,param8);
993 #define assertionVectorNumericalEquals10(lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9) assertion12( tarch::la::equals( lhs,rhs ),lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9);
994
1001 #define assertionMsg(expr,message) if (!(expr)) { \
1002 setAssertionOutputFormat; std::cerr << "assertion in file " << __FILE__ << ", line " << __LINE__ << " failed: " << #expr << std::endl << message << std::endl ; \
1003 assertionTriggersExit; \
1004 }
1005
1011 #define assertionFail(message) { \
1012 setAssertionOutputFormat; std::cerr << "fail-assertion in file " << __FILE__ << ", line " << __LINE__ << std::endl << message << std::endl; \
1013 std::cerr.flush(); \
1014 assertionTriggersExit; \
1015 }
1016 #else
1017 #define assertion(expr)
1018 #define assertion1(expr,param)
1019 #define assertion2(expr,param0,param1)
1020 #define assertion3(expr,param0,param1,param2)
1021 #define assertion4(expr,param0,param1,param2,param3)
1022 #define assertion5(expr,param0,param1,param2,param3,param4)
1023 #define assertion6(expr,param0,param1,param2,param3,param4,param5)
1024 #define assertion7(expr,param0,param1,param2,param3,param4,param5,param6)
1025 #define assertion8(expr,param0,param1,param2,param3,param4,param5,param6,param7)
1026 #define assertion9(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8)
1027 #define assertion10(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9)
1028 #define assertion11(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10)
1029 #define assertion12(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11)
1030 #define assertion13(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12)
1031 #define assertion14(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12,param13)
1032 #define assertion25(expr,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12,param13,param14,param15,param16,param17,param18,param19,param20,param21,param22,param23,param24)
1033 #define assertion1WithExplanation(expr,param,explanation)
1034 #define assertionEquals(lhs,rhs)
1035 #define assertionEqualsMsg(lhs,rhs,msg)
1036 #define assertionEquals1(lhs,rhs,a)
1037 #define assertionEquals2(lhs,rhs,a,b)
1038 #define assertionEquals3(lhs,rhs,a,b,c)
1039 #define assertionEquals4(lhs,rhs,larg,rarg,three,four)
1040 #define assertionEquals5(lhs,rhs,larg,rarg,three,four,five)
1041 #define assertionEquals6(lhs,rhs,larg,rarg,three,four,five,six)
1042 #define assertionEquals7(lhs,rhs,larg,rarg,three,four,five,six,seven)
1043 #define assertionEquals8(lhs,rhs,larg,rarg,three,four,five,six,seven,eight)
1044 #define assertionEquals9(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine)
1045 #define assertionEquals10(lhs,rhs,larg,rarg,three,four,five,six,seven,eight,nine,ten)
1046 #define assertionEquals11(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k)
1047 #define assertionEquals12(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k,l)
1048 #define assertionEquals13(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k,l,m)
1049 #define assertionEquals14(lhs,rhs,a,b,c,d,e,f,g,h,i,j,k,l,m,n)
1050 #define assertionNumericalEquals(lhs,rhs)
1051 #define assertionNumericalEquals1(lhs,rhs,a)
1052 #define assertionNumericalEquals2(lhs,rhs,a,b)
1053 #define assertionNumericalEquals3(lhs,rhs,a,b,c)
1054 #define assertionNumericalEquals4(lhs,rhs,a,b,c,d)
1055 #define assertionNumericalEquals5(lhs,rhs,a,b,c,d,e)
1056 #define assertionNumericalEquals6(lhs,rhs,a,b,c,d,e,f)
1057 #define assertionNumericalEquals7(lhs,rhs,a,b,c,d,e,f,g)
1058 #define assertionNumericalEquals8(lhs,rhs,a,b,c,d,e,f,g,h)
1059 #define assertionNumericalEquals9(lhs,rhs,a,b,c,d,e,f,g,h,i)
1060 #define assertionNumericalEquals10(lhs,rhs,a,b,c,d,e,f,g,h,i,j)
1061 #define assertionNumericalEquals11(lhs,rhs,a,b,c,d,e,f,g,h,i,j)
1062 #define assertionNumericalEquals12(lhs,rhs,a,b,c,d,e,f,g,h,i,j)
1063 #define assertionNumericalEquals13(lhs,rhs,a,b,c,d,e,f,g,h,i,j)
1064 #define assertionNumericalEquals14(lhs,rhs,a,b,c,d,e,f,g,h,i,j)
1065 #define assertionVectorNumericalEquals(lhs,rhs)
1066 #define assertionVectorNumericalEquals1(lhs,rhs,param0)
1067 #define assertionVectorNumericalEquals2(lhs,rhs,param0,param1)
1068 #define assertionVectorNumericalEquals3(lhs,rhs,param0,param1,param2)
1069 #define assertionVectorNumericalEquals4(lhs,rhs,param0,param1,param2,param3)
1070 #define assertionVectorNumericalEquals5(lhs,rhs,param0,param1,param2,param3,param4)
1071 #define assertionVectorNumericalEquals6(lhs,rhs,param0,param1,param2,param3,param4,param5)
1072 #define assertionVectorNumericalEquals7(lhs,rhs,param0,param1,param2,param3,param4,param5,param6)
1073 #define assertionVectorNumericalEquals8(lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7)
1074 #define assertionVectorNumericalEquals9(lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7,param8)
1075 #define assertionVectorNumericalEquals10(lhs,rhs,param0,param1,param2,param3,param4,param5,param6,param7,param8,param9)
1076 #define assertionMsg(expr,message)
1077 #define assertionFail(message)
1078 #endif
1079