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.

13 lines
781 B

  1. #ifndef test_assert
  2. #define test_assert(expr) do { \
  3. if (!(expr)) \
  4. { \
  5. fprintf(stderr, \
  6. "file %s: line %d (%s): precondition `%s' failed.\n", \
  7. __FILE__, \
  8. __LINE__, \
  9. __PRETTY_FUNCTION__, \
  10. #expr); \
  11. return 1; \
  12. } } while(0)
  13. #endif