Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. constexpr int SUCCESS = 0;
  5. constexpr int FAILURE = 1;
  6.  
  7. #define ASSERT(condition)                                             \
  8.     if (!(condition))                                                 \
  9.     {                                                                 \
  10.         std::cerr << __func__ << " / line " << __LINE__ << std::endl; \
  11.         exit(FAILURE);                                                \
  12.     }
  13.  
  14. void test_1();
  15. void test_2();
  16.  
  17. int main()
  18. {
  19.     test_1();
  20.     test_2();
  21.     return SUCCESS;
  22. }
  23.  
  24. void test_1()
  25. {
  26.     ASSERT(true);
  27. }
  28.  
  29. void test_2()
  30. {
  31.     ASSERT(false);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement