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.

27 lines
742B

  1. #pragma once
  2. #include <stdint.h>
  3. extern uint8_t spec;
  4. extern uint16_t test_passed;
  5. extern uint16_t test_failed;
  6. void _test_fail (const char *, const char *, uint16_t);
  7. void _test_pass (const char *);
  8. void _test_start (const char *);
  9. /* Successfull end of the test case */
  10. #define done() return 0
  11. /* Check single condition */
  12. #define check(cond, message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } } while (0)
  13. /* Test runner */
  14. #define test(func, name) do { _test_start(name); func(); } while(0)
  15. uint8_t test_trigger_update ( );
  16. uint8_t test_trigger_reset ( );
  17. uint8_t test_clock_exception ( );
  18. uint8_t test_clock_update ( );
  19. uint8_t test_clock_reset ( );