| 1 | #cxx . . $ `<file>/tests/api/core_api.c`/include <cgreen/cgreen.h>cxx . . $ `<file>/include/cgreen/cgreen.h`/ |
| 2 | #include <cgreen/mocks.h>cxx . . $ `<file>/include/cgreen/mocks.h`/ |
| 3 | |
| 4 | /* |
| 5 | These tests are only an attempt to exercise the whole public API of |
| 6 | Cgreen to ensure that it compiles. Attempting to run them will |
| 7 | surely result in crashes, plagues and pestilence. For unit tests |
| 8 | see other tests. */ |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | using namespace cgreen; |
| 12 | #endif |
| 13 | |
| 14 | // ASSERT |
| 15 | Ensurecxx . . $ `include/cgreen/unit.h:25:9`!(assert_that_compiles) { |
| 16 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(1 == 1); |
| 17 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(1 == 1, is_truecxx . . $ `include/cgreen/constraint_syntax_helpers.h:33:9`!); |
| 18 | assert_that_doublecxx . . $ `include/cgreen/assertions.h:31:9`!(1, is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1)); |
| 19 | significant_figures_for_assert_double_arecxx . . $ significant_figures_for_assert_double_are(d4f767463ce0a6b3).(3); |
| 20 | } |
| 21 | |
| 22 | // CONSTRAINTS |
| 23 | Ensurecxx . . $ `include/cgreen/unit.h:25:9`!(constraints_compiles) { |
| 24 | char array[5]; |
| 25 | char *string = (char *)"some string"; |
| 26 | |
| 27 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(1, is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1)); |
| 28 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(1, is_not_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:28:9`!(1)); |
| 29 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(1, is_greater_thancxx . . $ `include/cgreen/constraint_syntax_helpers.h:35:9`!(1)); |
| 30 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(1, is_less_thancxx . . $ `include/cgreen/constraint_syntax_helpers.h:36:9`!(1)); |
| 31 | |
| 32 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(array, is_equal_to_contents_ofcxx . . $ `include/cgreen/constraint_syntax_helpers.h:38:9`!(array, 5)); |
| 33 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(array, is_not_equal_to_contents_ofcxx . . $ `include/cgreen/constraint_syntax_helpers.h:39:9`!(array, 3)); |
| 34 | |
| 35 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(string, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!(string)); |
| 36 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(string, is_not_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:42:9`!(string)); |
| 37 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(string, contains_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:43:9`!(string)); |
| 38 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(string, does_not_contain_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:44:9`!(string)); |
| 39 | assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(string, begins_with_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:45:9`!(string)); |
| 40 | } |
| 41 | |
| 42 | static int int_stubcxx . . $ int_stub(7864480464b09eea).(int parameter) { |
| 43 | return mockcxx . . $ `include/cgreen/mocks.h:34:9`!(parameter); |
| 44 | } |
| 45 | |
| 46 | // Mocks |
| 47 | Ensurecxx . . $ `include/cgreen/unit.h:25:9`!(mocks_compiles) { |
| 48 | always_expectcxx . . $ `include/cgreen/mocks.h:23:9`!(int_stub, will_returncxx . . $ `include/cgreen/constraint_syntax_helpers.h:58:9`!(1)); |
| 49 | always_expectcxx . . $ `include/cgreen/mocks.h:23:9`!(int_stub, will_set_contents_of_output_parametercxx . . $ `include/cgreen/constraint_syntax_helpers.h:62:9`!(parameter, 1, sizeof(int))); |
| 50 | never_expectcxx . . $ `include/cgreen/mocks.h:25:9`!(int_stub); |
| 51 | expectcxx . . $ `include/cgreen/mocks.h:21:9`!(int_stub, whencxx . . $ `include/cgreen/mocks.h:38:9`!(parameter, is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1))); |
| 52 | int_stubcxx . . $ int_stub(7864480464b09eea).(1); |
| 53 | } |