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. std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  7. error = 1; \
  8. }
  9. #define ASSERT1(expr,a) \
  10. if (!(expr)) { \
  11. std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  12. std::cerr << #a" = " << a << endl; \
  13. error = 1; \
  14. }
  15. #define ASSERT2(expr,a,b) \
  16. if (!(expr)) { \
  17. std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  18. std::cerr << #a" = " << a << endl; \
  19. std::cerr << #b" = " << b << endl; \
  20. error = 1; \
  21. }
  22. #define ASSERT3(expr,a,b,c) \
  23. if (!(expr)) { \
  24. std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  25. std::cerr << #a" = " << a << endl; \
  26. std::cerr << #b" = " << b << endl; \
  27. std::cerr << #c" = " << c << endl; \
  28. error = 1; \
  29. }
  30. #define ASSERT4(expr,a,b,c,d) \
  31. if (!(expr)) { \
  32. std::cerr << "Assertion failed! File " << __FILE__ << ", line " << __LINE__ << endl; \
  33. std::cerr << #a" = " << a << endl; \
  34. std::cerr << #b" = " << b << endl; \
  35. std::cerr << #c" = " << c << endl; \
  36. std::cerr << #d" = " << d << endl; \
  37. error = 1; \
  38. }