-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.h
43 lines (38 loc) · 1.25 KB
/
test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <cln/io.h>
using namespace std;
using namespace cln;
#define ASSERT(expr) \
if (!(expr)) { \
std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
error = 1; \
}
#define ASSERT1(expr,a) \
if (!(expr)) { \
std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
std::cerr << #a" = " << a << endl; \
error = 1; \
}
#define ASSERT2(expr,a,b) \
if (!(expr)) { \
std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
std::cerr << #a" = " << a << endl; \
std::cerr << #b" = " << b << endl; \
error = 1; \
}
#define ASSERT3(expr,a,b,c) \
if (!(expr)) { \
std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
std::cerr << #a" = " << a << endl; \
std::cerr << #b" = " << b << endl; \
std::cerr << #c" = " << c << endl; \
error = 1; \
}
#define ASSERT4(expr,a,b,c,d) \
if (!(expr)) { \
std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
std::cerr << #a" = " << a << endl; \
std::cerr << #b" = " << b << endl; \
std::cerr << #c" = " << c << endl; \
std::cerr << #d" = " << d << endl; \
error = 1; \
}