test_tb_test.cpp 811 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // ================================================================================
  2. // == This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås ==
  3. // == See tb_core.h for more information. ==
  4. // ================================================================================
  5. #include "tb_test.h"
  6. #ifdef TB_UNIT_TESTING
  7. using namespace tb;
  8. TB_TEST_GROUP(tb_test)
  9. {
  10. TB_TEST(single_test)
  11. {
  12. TB_PASS();
  13. }
  14. }
  15. TB_TEST_GROUP(tb_test_multiple_calls)
  16. {
  17. int setup_calls;
  18. int test_calls;
  19. TB_TEST(Setup)
  20. {
  21. setup_calls++;
  22. }
  23. TB_TEST(test_1)
  24. {
  25. TB_VERIFY(setup_calls == 1);
  26. test_calls++;
  27. }
  28. TB_TEST(test_2)
  29. {
  30. TB_VERIFY(setup_calls == 2);
  31. test_calls++;
  32. }
  33. TB_TEST(Cleanup)
  34. {
  35. TB_VERIFY(test_calls > 0);
  36. }
  37. }
  38. #endif // TB_UNIT_TESTING