You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. #include <cln/io.h>
  2. using namespace std;
  3. using namespace cln;
  4. #define ASSERT(expr) \
  5. if (!(expr)) { \
  6. stderr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  7. error = 1; \
  8. }
  9. #define ASSERT1(expr,a) \
  10. if (!(expr)) { \
  11. stderr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  12. stderr << #a" = " << a << endl; \
  13. error = 1; \
  14. }
  15. #define ASSERT2(expr,a,b) \
  16. if (!(expr)) { \
  17. stderr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  18. stderr << #a" = " << a << endl; \
  19. stderr << #b" = " << b << endl; \
  20. error = 1; \
  21. }
  22. #define ASSERT3(expr,a,b,c) \
  23. if (!(expr)) { \
  24. stderr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  25. stderr << #a" = " << a << endl; \
  26. stderr << #b" = " << b << endl; \
  27. stderr << #c" = " << c << endl; \
  28. error = 1; \
  29. }
  30. #define ASSERT4(expr,a,b,c,d) \
  31. if (!(expr)) { \
  32. stderr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  33. stderr << #a" = " << a << endl; \
  34. stderr << #b" = " << b << endl; \
  35. stderr << #c" = " << c << endl; \
  36. stderr << #d" = " << d << endl; \
  37. error = 1; \
  38. }