| 1 | #cxx . . $ `<file>/tests/unit_tests.c`/include <cgreen/cgreen.h>cxx . . $ `<file>/include/cgreen/cgreen.h`/ |
| 2 | #include <cgreen/unit.h>cxx . . $ `<file>/include/cgreen/unit.h`/ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include <unistd.h> |
| 6 | |
| 7 | #ifdef __cpluspluscxx . . $ `<built-in>:440:9`! |
| 8 | using namespace cgreen; |
| 9 | #endif |
| 10 | |
| 11 | static TestSuitecxx . . $ TestSuite#* suitecxx . . $ suite.; |
| 12 | |
| 13 | static void unit_tests_setupcxx . . $ unit_tests_setup(49f6e7a06ebc5aa8).(void) { |
| 14 | suitecxx . . $ suite. = create_test_suitecxx . . $ `include/cgreen/suite.h:20:9`!(); |
| 15 | } |
| 16 | |
| 17 | static void unit_tests_teardowncxx . . $ unit_tests_teardown(49f6e7a06ebc5aa8).(void) { |
| 18 | destroy_test_suitecxx . . $ destroy_test_suite(8fc5cbd6a65ffd2d).(suitecxx . . $ suite.); |
| 19 | } |
| 20 | |
| 21 | Describecxx . . $ Dummy_Unittests_t#(Unittests); |
| 22 | BeforeEachcxx . . $ BeforeEach_For_Unittests_Function(49f6e7a06ebc5aa8).(Unittests) { |
| 23 | unit_tests_setupcxx . . $ unit_tests_setup(49f6e7a06ebc5aa8).(); |
| 24 | } |
| 25 | AfterEachcxx . . $ AfterEach_For_Unittests.(Unittests) { |
| 26 | unit_tests_teardowncxx . . $ unit_tests_teardown(49f6e7a06ebc5aa8).(); |
| 27 | } |
| 28 | |
| 29 | Ensurecxx . . $ contextForUnittests.(Unittests, can_see_correct_version_marking) { |
| 30 | char version_string[20]; |
| 31 | |
| 32 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(version_string, sizeof(version_string), "%d.%d.%d", CGREEN_VERSION_MAJORcxx . . $ `include/cgreen/cgreen.h:13:9`!, CGREEN_VERSION_MINORcxx . . $ `include/cgreen/cgreen.h:14:9`!, CGREEN_VERSION_PATCHcxx . . $ `include/cgreen/cgreen.h:15:9`!); |
| 33 | |
| 34 | assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(cgreen_library_version, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!(CGREEN_VERSIONcxx . . $ `include/cgreen/cgreen.h:12:9`!)); |
| 35 | assert_thatcxx . . $ cgreen/(CGREEN_VERSIONcxx . . $ `include/cgreen/cgreen.h:12:9`!, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!(version_string)); |
| 36 | } |
| 37 | |
| 38 | Ensurecxx . . $ `include/cgreen/unit.h:25:9`!(Unittests, count_tests_return_zero_for_empty_suite) { |
| 39 | assert_thatcxx . . $ suite.(count_tests(suite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(0)); |
| 40 | } |
| 41 | |
| 42 | Ensurecxx . . $ Unittests__count_tests_return_one_for_suite_with_one_testcase(49f6e7a06ebc5aa8).(Unittests, count_tests_return_one_for_suite_with_one_testcase) { |
| 43 | add_test_with_contextcxx . . $ suite.(suite, Unittests, count_tests_return_one_for_suite_with_one_testcase); |
| 44 | assert_thatcxx . . $ cgreen/(count_tests(suite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1)); |
| 45 | } |
| 46 | |
| 47 | Ensurecxx . . $ CgreenTest#(Unittests, count_tests_return_four_for_four_nested_suite_with_one_testcase_each) { |
| 48 | TestSuitecxx . . $ TestSuite# *suite2 = create_test_suitecxx . . $ `include/cgreen/suite.h:20:9`!(); |
| 49 | TestSuitecxx . . $ TestSuite# *suite3 = create_test_suitecxx . . $ `include/cgreen/suite.h:20:9`!(); |
| 50 | TestSuitecxx . . $ TestSuite# *suite4 = create_test_suitecxx . . $ `include/cgreen/suite.h:20:9`!(); |
| 51 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, Unittests, count_tests_return_one_for_suite_with_one_testcase); |
| 52 | add_suitecxx . . $ `include/cgreen/suite.h:25:9`!(suite, suite2); |
| 53 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite2, Unittests, count_tests_return_one_for_suite_with_one_testcase); |
| 54 | add_suitecxx . . $ `include/cgreen/suite.h:25:9`!(suite2, suite3); |
| 55 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite3, Unittests, count_tests_return_one_for_suite_with_one_testcase); |
| 56 | add_suitecxx . . $ `include/cgreen/suite.h:25:9`!(suite3, suite4); |
| 57 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite4, Unittests, count_tests_return_one_for_suite_with_one_testcase); |
| 58 | assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(count_tests(suite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(4)); |
| 59 | } |
| 60 | |
| 61 | TestSuitecxx . . $ TestSuite# *unit_testscxx . . $ unit_tests(564401a81ded3a53).(void) { |
| 62 | TestSuitecxx . . $ TestSuite# *suite = create_test_suitecxx . . $ `include/cgreen/suite.h:20:9`!(); |
| 63 | set_setupcxx . . $ set_setup(375347ed146b1459).(suite, unit_tests_setupcxx . . $ unit_tests_setup(49f6e7a06ebc5aa8).); |
| 64 | |
| 65 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, Unittests, count_tests_return_zero_for_empty_suite); |
| 66 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, Unittests, count_tests_return_one_for_suite_with_one_testcase); |
| 67 | add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, Unittests, count_tests_return_four_for_four_nested_suite_with_one_testcase_each); |
| 68 | |
| 69 | set_teardowncxx . . $ set_teardown(375347ed146b1459).(suite, unit_tests_teardowncxx . . $ unit_tests_teardown(49f6e7a06ebc5aa8).); |
| 70 | return suite; |
| 71 | } |