Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. //////////
  2. // test_dummy.hpp
  3. //
  4. #include "testcase.hpp"
  5.  
  6. testcase(Dummy) {
  7.     int a = 0;
  8.  
  9.     on_setup {
  10.         a = 15;
  11.     }
  12.  
  13.     unittest(arithmetic) {
  14.         assert_equal(20, a + 5);
  15.         a = 70;
  16.         ok();
  17.     }
  18.  
  19.     unittest(fail) {
  20.         assert_equal(a, 70);
  21.         ok();
  22.     }
  23.  
  24.     on_teardown {
  25.     }
  26. };
  27.  
  28. int main(int argc, char *argv[]) {
  29.     return test_main(argc, argv);
  30. }
  31.  
  32.  
  33. /*
  34.  
  35. microtest version 0.1
  36. -----------------------------------------
  37. Running the test case "Dummy"
  38. Test case contains 2 tests
  39.  
  40. .F
  41.  
  42. 1 succeeded, 1 failed, 0 flagged, 0 skipped.
  43.  
  44. Test case 'fail' failed:
  45.     Assertion failure: a != 70 (15 != 70)
  46.  
  47. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement