testutils.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef TESTUTILS_H
  2. #define TESTUTILS_H
  3. #define SUCCESS (0)
  4. #define TEST_EQUAL(a, b, s) \
  5. test_equal(a, b, s, __FILE__, __FUNCTION__, __LINE__)
  6. #define TEST_EQUAL_ONE_OF(a, b, c, s) \
  7. test_equal_one_of(a, b, c, s, __FILE__, __FUNCTION__, __LINE__)
  8. #define TEST_NOT_EQUAL(a, b, s) \
  9. test_not_equal(a, b, s, __FILE__, __FUNCTION__, __LINE__)
  10. #define TEST_NEGATIVE(a, s) \
  11. test_negative(a, s, __FILE__, __FUNCTION__, __LINE__)
  12. #define TEST_POSITIVE(a, s) \
  13. test_positive(a, s, __FILE__, __FUNCTION__, __LINE__)
  14. #define TEST_STATS() \
  15. test_print_stats( __FILE__, __FUNCTION__, __LINE__)
  16. #define TEST_VERBOSE_ON() \
  17. test_verbose_on()
  18. #define TEST_VERBOSE_OFF() \
  19. test_verbose_off()
  20. void test_equal(int ret_val, int expected_val, const char *str,
  21. const char *file, const char* func, int line);
  22. void test_equal_one_of(int val, int expected_val1, int expected_val2, const char *str,
  23. const char *file, const char *func, int line);
  24. void test_positive(int ret_val, const char *str,
  25. const char *file, const char* func, int line);
  26. void test_negative(int ret_val, const char *str,
  27. const char *file, const char* func, int line);
  28. void test_not_equal(int ret_val, int expected_val, const char *str,
  29. const char *file, const char* func, int line);
  30. void test_print_stats(const char *file, const char* func, int line);
  31. void test_reset_stats(void);
  32. void test_verbose_on(void);
  33. void test_verbose_off(void);
  34. #endif /* TESTUTILS_H */