ceedling 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +9 -13
- data/README.md +21 -3
- data/{rakefile.rb → Rakefile} +0 -0
- data/lib/ceedling/version.rb +4 -4
- data/lib/ceedling/version.rb.erb +1 -1
- data/release/version.info +1 -1
- data/vendor/c_exception/Gemfile +1 -1
- data/vendor/c_exception/Gemfile.lock +12 -0
- data/vendor/c_exception/{docs/license.txt → LICENSE.txt} +9 -9
- data/vendor/c_exception/README.md +146 -0
- data/vendor/c_exception/{rakefile.rb → Rakefile} +6 -5
- data/vendor/c_exception/lib/CException.c +9 -6
- data/vendor/c_exception/release/build.info +1 -1
- data/vendor/c_exception/release/version.info +1 -1
- data/vendor/c_exception/test/CExceptionConfig.h +2 -0
- data/vendor/c_exception/test/TestException.c +4 -1
- data/vendor/cmock/README.md +24 -0
- data/vendor/cmock/{rakefile.rb → Rakefile} +12 -12
- data/vendor/cmock/docs/CMock Summary.odt +0 -0
- data/vendor/cmock/docs/CMock Summary.pdf +0 -0
- data/vendor/cmock/docs/CMock_Summary.md +130 -111
- data/vendor/cmock/docs/license.txt +1 -1
- data/vendor/cmock/lib/cmock.rb +36 -12
- data/vendor/cmock/lib/cmock_config.rb +39 -36
- data/vendor/cmock/lib/cmock_generator.rb +33 -25
- data/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb +68 -0
- data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +18 -42
- data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -2
- data/vendor/cmock/lib/cmock_generator_utils.rb +39 -29
- data/vendor/cmock/lib/cmock_header_parser.rb +46 -39
- data/vendor/cmock/rakefile_helper.rb +38 -38
- data/vendor/cmock/src/cmock.c +20 -4
- data/vendor/cmock/src/cmock.h +6 -1
- data/vendor/cmock/src/cmock_internals.h +26 -3
- data/vendor/cmock/targets/clang_strict.yml +85 -0
- data/vendor/cmock/targets/gcc.yml +4 -2
- data/vendor/cmock/targets/gcc_64.yml +55 -0
- data/vendor/cmock/test/c/TestCMockC.c +3 -3
- data/vendor/cmock/test/c/TestCMockCDynamic.c +11 -11
- data/vendor/cmock/test/c/TestCMockCDynamic_Runner.c +4 -2
- data/vendor/cmock/test/c/TestCMockC_Runner.c +1 -1
- data/vendor/cmock/test/system/systest_generator.rb +38 -26
- data/vendor/cmock/test/system/test_compilation/const.h +8 -3
- data/vendor/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +92 -58
- data/vendor/cmock/test/system/test_interactions/all_plugins_coexist.yml +53 -48
- data/vendor/cmock/test/system/test_interactions/array_and_pointer_handling.yml +58 -56
- data/vendor/cmock/test/system/test_interactions/basic_expect_and_return.yml +19 -18
- data/vendor/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +13 -13
- data/vendor/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +20 -20
- data/vendor/cmock/test/system/test_interactions/expect_any_args.yml +238 -0
- data/vendor/cmock/test/system/test_interactions/fancy_pointer_handling.yml +36 -34
- data/vendor/cmock/test/system/test_interactions/ignore_and_return.yml +24 -15
- data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +11 -11
- data/vendor/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml +235 -0
- data/vendor/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +22 -26
- data/vendor/cmock/test/system/test_interactions/stubs_with_callbacks.yml +31 -31
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +141 -109
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +82 -0
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +17 -81
- data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +10 -10
- data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +47 -41
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +290 -227
- data/vendor/unity/{rakefile.rb → Rakefile} +13 -6
- data/vendor/unity/auto/colour_prompt.rb +33 -12
- data/vendor/unity/auto/generate_test_runner.rb +67 -63
- data/vendor/unity/auto/parseOutput.rb +189 -0
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/makefile +41 -40
- data/vendor/unity/examples/example_1/readme.txt +5 -0
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode.c +24 -24
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode.h +3 -3
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode2.c +9 -9
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode2.h +2 -2
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/test/TestProductionCode.c +62 -62
- data/vendor/unity/examples/{test → example_1/test}/TestProductionCode2.c +31 -31
- data/vendor/unity/examples/{test/no_ruby → example_1/test/test_runners}/TestProductionCode2_Runner.c +46 -46
- data/vendor/unity/examples/{test/no_ruby → example_1/test/test_runners}/TestProductionCode_Runner.c +50 -50
- data/vendor/unity/examples/example_2/makefile +45 -0
- data/vendor/unity/examples/example_2/readme.txt +5 -0
- data/vendor/unity/examples/{src → example_2/src}/ProductionCode.c +24 -24
- data/vendor/unity/examples/{src → example_2/src}/ProductionCode.h +3 -3
- data/vendor/unity/examples/{src → example_2/src}/ProductionCode2.c +9 -9
- data/vendor/unity/examples/{src → example_2/src}/ProductionCode2.h +2 -2
- data/vendor/unity/examples/{test → example_2/test}/TestProductionCode.c +64 -62
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_2}/test/TestProductionCode2.c +33 -31
- data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
- data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
- data/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
- data/vendor/unity/examples/{helper → example_3/helper}/UnityHelper.c +10 -10
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/helper/UnityHelper.h +12 -12
- data/vendor/unity/examples/{makefile → example_3/makefile} +41 -40
- data/vendor/unity/examples/{rakefile.rb → example_3/rakefile.rb} +44 -43
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/rakefile_helper.rb +256 -256
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/readme.txt +18 -17
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode.c +24 -24
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode.h +3 -3
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode2.c +9 -9
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode2.h +2 -2
- data/vendor/{c_exception/vendor/unity/targets/gcc_64.yml → unity/examples/example_3/target_gcc_32.yml} +46 -44
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/TestProductionCode.c +62 -62
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/TestProductionCode2.c +31 -31
- data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/no_ruby/TestProductionCode2_Runner.c +46 -46
- data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/test/no_ruby/TestProductionCode_Runner.c +50 -50
- data/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
- data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -1
- data/vendor/unity/extras/fixture/src/unity_fixture.h +17 -16
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +7 -7
- data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +17 -0
- data/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +1 -0
- data/vendor/unity/makefile +6 -4
- data/vendor/unity/rakefile_helper.rb +36 -27
- data/vendor/unity/src/unity.c +180 -181
- data/vendor/unity/src/unity.h +64 -2
- data/vendor/unity/src/unity_internals.h +188 -102
- data/vendor/unity/targets/clang_strict.yml +83 -0
- data/vendor/unity/targets/gcc_32.yml +5 -0
- data/vendor/unity/targets/gcc_64.yml +5 -0
- data/vendor/{c_exception/vendor/unity/targets/gcc.yml → unity/targets/gcc_auto_limits.yml} +5 -2
- data/vendor/{cmock/vendor/unity/targets/gcc_64.yml → unity/targets/gcc_auto_sizeof.yml} +6 -3
- data/vendor/{cmock/vendor/unity/targets/gcc.yml → unity/targets/gcc_auto_stdint.yml} +4 -2
- data/vendor/unity/test/expectdata/testsample_cmd.c +57 -54
- data/vendor/unity/test/expectdata/testsample_def.c +53 -50
- data/vendor/unity/test/expectdata/testsample_mock_cmd.c +79 -76
- data/vendor/unity/test/expectdata/testsample_mock_def.c +75 -72
- data/vendor/unity/test/expectdata/testsample_mock_new1.c +88 -85
- data/vendor/unity/test/expectdata/testsample_mock_new2.c +88 -85
- data/vendor/unity/test/expectdata/testsample_mock_param.c +76 -73
- data/vendor/unity/test/expectdata/testsample_mock_run1.c +88 -85
- data/vendor/unity/test/expectdata/testsample_mock_run2.c +88 -85
- data/vendor/unity/test/expectdata/testsample_mock_yaml.c +89 -86
- data/vendor/unity/test/expectdata/testsample_new1.c +63 -60
- data/vendor/unity/test/expectdata/testsample_new2.c +66 -63
- data/vendor/unity/test/expectdata/testsample_param.c +54 -51
- data/vendor/unity/test/expectdata/testsample_run1.c +63 -60
- data/vendor/unity/test/expectdata/testsample_run2.c +66 -63
- data/vendor/unity/test/expectdata/testsample_yaml.c +67 -64
- data/vendor/unity/test/test_generate_test_runner.rb +66 -72
- data/vendor/unity/test/testunity.c +591 -111
- metadata +58 -195
- data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +0 -94
- data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +0 -39
- data/vendor/c_exception/vendor/unity/auto/generate_config.yml +0 -36
- data/vendor/c_exception/vendor/unity/auto/generate_module.rb +0 -202
- data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +0 -313
- data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +0 -23
- data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +0 -139
- data/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
- data/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -217
- data/vendor/c_exception/vendor/unity/docs/license.txt +0 -31
- data/vendor/c_exception/vendor/unity/examples/helper/UnityHelper.c +0 -10
- data/vendor/c_exception/vendor/unity/examples/helper/UnityHelper.h +0 -12
- data/vendor/c_exception/vendor/unity/examples/makefile +0 -40
- data/vendor/c_exception/vendor/unity/examples/rakefile.rb +0 -32
- data/vendor/c_exception/vendor/unity/examples/rakefile_helper.rb +0 -256
- data/vendor/c_exception/vendor/unity/examples/test/no_ruby/TestProductionCode_Runner.c +0 -50
- data/vendor/c_exception/vendor/unity/extras/fixture/build/MakefileWorker.mk +0 -331
- data/vendor/c_exception/vendor/unity/extras/fixture/build/filterGcov.sh +0 -61
- data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +0 -37
- data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
- data/vendor/c_exception/vendor/unity/extras/fixture/readme.txt +0 -9
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +0 -381
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +0 -81
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -44
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -16
- data/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +0 -21
- data/vendor/c_exception/vendor/unity/extras/fixture/test/testunity_fixture.c +0 -39
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -321
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -40
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -56
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
- data/vendor/c_exception/vendor/unity/makefile +0 -35
- data/vendor/c_exception/vendor/unity/rakefile.rb +0 -59
- data/vendor/c_exception/vendor/unity/rakefile_helper.rb +0 -240
- data/vendor/c_exception/vendor/unity/release/build.info +0 -2
- data/vendor/c_exception/vendor/unity/release/version.info +0 -2
- data/vendor/c_exception/vendor/unity/src/unity.c +0 -979
- data/vendor/c_exception/vendor/unity/src/unity.h +0 -232
- data/vendor/c_exception/vendor/unity/src/unity_internals.h +0 -424
- data/vendor/c_exception/vendor/unity/targets/hitech_picc18.yml +0 -101
- data/vendor/c_exception/vendor/unity/targets/iar_arm_v4.yml +0 -89
- data/vendor/c_exception/vendor/unity/targets/iar_arm_v5.yml +0 -79
- data/vendor/c_exception/vendor/unity/targets/iar_arm_v5_3.yml +0 -79
- data/vendor/c_exception/vendor/unity/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -93
- data/vendor/c_exception/vendor/unity/targets/iar_cortexm3_v5.yml +0 -83
- data/vendor/c_exception/vendor/unity/targets/iar_msp430.yml +0 -94
- data/vendor/c_exception/vendor/unity/targets/iar_sh2a_v6.yml +0 -85
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +0 -54
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +0 -50
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -76
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +0 -72
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -85
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -85
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +0 -73
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -85
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -85
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -86
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +0 -60
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +0 -63
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +0 -51
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +0 -60
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +0 -63
- data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +0 -64
- data/vendor/c_exception/vendor/unity/test/test_generate_test_runner.rb +0 -94
- data/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +0 -51
- data/vendor/c_exception/vendor/unity/test/testdata/sample.yml +0 -9
- data/vendor/c_exception/vendor/unity/test/testdata/testsample.c +0 -51
- data/vendor/c_exception/vendor/unity/test/testparameterized.c +0 -101
- data/vendor/c_exception/vendor/unity/test/testunity.c +0 -2024
- data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
- data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/docs/license.txt +0 -30
- data/vendor/cmock/vendor/c_exception/docs/readme.txt +0 -236
- data/vendor/cmock/vendor/c_exception/lib/CException.c +0 -39
- data/vendor/cmock/vendor/c_exception/lib/CException.h +0 -70
- data/vendor/cmock/vendor/c_exception/makefile +0 -24
- data/vendor/cmock/vendor/c_exception/rakefile.rb +0 -41
- data/vendor/cmock/vendor/c_exception/release/build.info +0 -2
- data/vendor/cmock/vendor/c_exception/release/version.info +0 -2
- data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +0 -27
- data/vendor/cmock/vendor/c_exception/test/TestException.c +0 -291
- data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +0 -62
- data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +0 -94
- data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +0 -39
- data/vendor/cmock/vendor/unity/auto/generate_config.yml +0 -36
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +0 -202
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +0 -313
- data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +0 -23
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +0 -139
- data/vendor/cmock/vendor/unity/docs/Unity Summary.odt +0 -0
- data/vendor/cmock/vendor/unity/docs/Unity Summary.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/Unity Summary.txt +0 -217
- data/vendor/cmock/vendor/unity/docs/license.txt +0 -31
- data/vendor/cmock/vendor/unity/examples/helper/UnityHelper.c +0 -10
- data/vendor/cmock/vendor/unity/examples/rakefile.rb +0 -32
- data/vendor/cmock/vendor/unity/examples/readme.txt +0 -18
- data/vendor/cmock/vendor/unity/examples/test/no_ruby/TestProductionCode2_Runner.c +0 -46
- data/vendor/cmock/vendor/unity/extras/fixture/build/MakefileWorker.mk +0 -331
- data/vendor/cmock/vendor/unity/extras/fixture/build/filterGcov.sh +0 -61
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +0 -37
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
- data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +0 -9
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +0 -381
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +0 -81
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -44
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -16
- data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +0 -21
- data/vendor/cmock/vendor/unity/extras/fixture/test/testunity_fixture.c +0 -39
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -321
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -40
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -56
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
- data/vendor/cmock/vendor/unity/makefile +0 -35
- data/vendor/cmock/vendor/unity/rakefile.rb +0 -48
- data/vendor/cmock/vendor/unity/rakefile_helper.rb +0 -240
- data/vendor/cmock/vendor/unity/release/build.info +0 -2
- data/vendor/cmock/vendor/unity/release/version.info +0 -2
- data/vendor/cmock/vendor/unity/src/unity.c +0 -979
- data/vendor/cmock/vendor/unity/src/unity.h +0 -232
- data/vendor/cmock/vendor/unity/src/unity_internals.h +0 -424
- data/vendor/cmock/vendor/unity/targets/hitech_picc18.yml +0 -101
- data/vendor/cmock/vendor/unity/targets/iar_arm_v4.yml +0 -89
- data/vendor/cmock/vendor/unity/targets/iar_arm_v5.yml +0 -79
- data/vendor/cmock/vendor/unity/targets/iar_arm_v5_3.yml +0 -79
- data/vendor/cmock/vendor/unity/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -93
- data/vendor/cmock/vendor/unity/targets/iar_cortexm3_v5.yml +0 -83
- data/vendor/cmock/vendor/unity/targets/iar_msp430.yml +0 -94
- data/vendor/cmock/vendor/unity/targets/iar_sh2a_v6.yml +0 -85
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +0 -54
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +0 -50
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -76
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +0 -72
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -85
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -85
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +0 -73
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -85
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -85
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -86
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +0 -60
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +0 -63
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +0 -51
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +0 -60
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +0 -63
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +0 -64
- data/vendor/cmock/vendor/unity/test/test_generate_test_runner.rb +0 -94
- data/vendor/cmock/vendor/unity/test/testdata/mocksample.c +0 -51
- data/vendor/cmock/vendor/unity/test/testdata/sample.yml +0 -9
- data/vendor/cmock/vendor/unity/test/testdata/testsample.c +0 -51
- data/vendor/cmock/vendor/unity/test/testparameterized.c +0 -101
- data/vendor/cmock/vendor/unity/test/testunity.c +0 -2024
- data/vendor/unity/Gemfile +0 -4
- data/vendor/unity/examples/helper/UnityHelper.h +0 -12
- data/vendor/unity/examples/rakefile_helper.rb +0 -256
- data/vendor/unity/examples/readme.txt +0 -18
data/vendor/unity/src/unity.c
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* =========================================================================
|
|
2
2
|
Unity Project - A Test Framework for C
|
|
3
|
-
Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
|
3
|
+
Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams
|
|
4
4
|
[Released under MIT License. Please refer to license.txt for details]
|
|
5
|
-
|
|
5
|
+
============================================================================ */
|
|
6
6
|
|
|
7
7
|
#include "unity.h"
|
|
8
8
|
#include <stdio.h>
|
|
9
9
|
#include <string.h>
|
|
10
10
|
|
|
11
|
-
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1;
|
|
12
|
-
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1;
|
|
11
|
+
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
|
|
12
|
+
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
|
|
13
13
|
/// return prematurely if we are already in failure or ignore state
|
|
14
14
|
#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
|
|
15
15
|
#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); }
|
|
16
16
|
|
|
17
|
-
struct _Unity Unity
|
|
17
|
+
struct _Unity Unity;
|
|
18
18
|
|
|
19
19
|
const char* UnityStrNull = "NULL";
|
|
20
20
|
const char* UnityStrSpacer = ". ";
|
|
@@ -28,9 +28,14 @@ const char* UnityStrDelta = " Values Not Within Delta ";
|
|
|
28
28
|
const char* UnityStrPointless= " You Asked Me To Compare Nothing, Which Was Pointless.";
|
|
29
29
|
const char* UnityStrNullPointerForExpected= " Expected pointer to be NULL";
|
|
30
30
|
const char* UnityStrNullPointerForActual = " Actual pointer was NULL";
|
|
31
|
+
const char* UnityStrNot = "Not ";
|
|
31
32
|
const char* UnityStrInf = "Infinity";
|
|
32
33
|
const char* UnityStrNegInf = "Negative Infinity";
|
|
33
34
|
const char* UnityStrNaN = "NaN";
|
|
35
|
+
const char* UnityStrDet = "Determinate";
|
|
36
|
+
const char* UnityStrErrFloat = "Unity Floating Point Disabled";
|
|
37
|
+
const char* UnityStrErrDouble= "Unity Double Precision Disabled";
|
|
38
|
+
const char* UnityStrErr64 = "Unity 64-bit Support Disabled";
|
|
34
39
|
|
|
35
40
|
#ifndef UNITY_EXCLUDE_FLOAT
|
|
36
41
|
// Dividing by these constants produces +/- infinity.
|
|
@@ -42,7 +47,7 @@ static const _UD d_zero = 0.0;
|
|
|
42
47
|
#endif
|
|
43
48
|
|
|
44
49
|
// compiler-generic print formatting masks
|
|
45
|
-
const _U_UINT UnitySizeMask[] =
|
|
50
|
+
const _U_UINT UnitySizeMask[] =
|
|
46
51
|
{
|
|
47
52
|
255u, // 0xFF
|
|
48
53
|
65535u, // 0xFFFF
|
|
@@ -92,7 +97,7 @@ void UnityPrint(const char* string)
|
|
|
92
97
|
else
|
|
93
98
|
{
|
|
94
99
|
UNITY_OUTPUT_CHAR('\\');
|
|
95
|
-
UnityPrintNumberHex((
|
|
100
|
+
UnityPrintNumberHex((_U_UINT)*pch, 2);
|
|
96
101
|
}
|
|
97
102
|
pch++;
|
|
98
103
|
}
|
|
@@ -112,7 +117,7 @@ void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T s
|
|
|
112
117
|
}
|
|
113
118
|
else
|
|
114
119
|
{
|
|
115
|
-
UnityPrintNumberHex((_U_UINT)number, (style & 0x000F) << 1);
|
|
120
|
+
UnityPrintNumberHex((_U_UINT)number, (char)((style & 0x000F) << 1));
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
123
|
|
|
@@ -249,9 +254,10 @@ void UnityPrintOk(void)
|
|
|
249
254
|
//-----------------------------------------------
|
|
250
255
|
void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
|
251
256
|
{
|
|
257
|
+
UNITY_PRINT_EOL;
|
|
252
258
|
UnityPrint(file);
|
|
253
259
|
UNITY_OUTPUT_CHAR(':');
|
|
254
|
-
UnityPrintNumber(line);
|
|
260
|
+
UnityPrintNumber((_U_SINT)line);
|
|
255
261
|
UNITY_OUTPUT_CHAR(':');
|
|
256
262
|
UnityPrint(Unity.CurrentTestName);
|
|
257
263
|
UNITY_OUTPUT_CHAR(':');
|
|
@@ -275,7 +281,6 @@ void UnityConcludeTest(void)
|
|
|
275
281
|
{
|
|
276
282
|
UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber);
|
|
277
283
|
UnityPrint("PASS");
|
|
278
|
-
UNITY_PRINT_EOL;
|
|
279
284
|
}
|
|
280
285
|
else
|
|
281
286
|
{
|
|
@@ -308,7 +313,7 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
|
|
308
313
|
}
|
|
309
314
|
else
|
|
310
315
|
{
|
|
311
|
-
UnityPrint(UnityStrNull);
|
|
316
|
+
UnityPrint(UnityStrNull);
|
|
312
317
|
}
|
|
313
318
|
UnityPrint(UnityStrWas);
|
|
314
319
|
if (actual != NULL)
|
|
@@ -319,7 +324,7 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
|
|
319
324
|
}
|
|
320
325
|
else
|
|
321
326
|
{
|
|
322
|
-
UnityPrint(UnityStrNull);
|
|
327
|
+
UnityPrint(UnityStrNull);
|
|
323
328
|
}
|
|
324
329
|
}
|
|
325
330
|
|
|
@@ -327,12 +332,12 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
|
|
327
332
|
// Assertion & Control Helpers
|
|
328
333
|
//-----------------------------------------------
|
|
329
334
|
|
|
330
|
-
int UnityCheckArraysForNull(const void* expected, const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
|
335
|
+
int UnityCheckArraysForNull(UNITY_PTR_ATTRIBUTE const void* expected, UNITY_PTR_ATTRIBUTE const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
|
331
336
|
{
|
|
332
337
|
//return true if they are both NULL
|
|
333
338
|
if ((expected == NULL) && (actual == NULL))
|
|
334
339
|
return 1;
|
|
335
|
-
|
|
340
|
+
|
|
336
341
|
//throw error if just expected is NULL
|
|
337
342
|
if (expected == NULL)
|
|
338
343
|
{
|
|
@@ -350,7 +355,7 @@ int UnityCheckArraysForNull(const void* expected, const void* actual, const UNIT
|
|
|
350
355
|
UnityAddMsgIfSpecified(msg);
|
|
351
356
|
UNITY_FAIL_AND_BAIL;
|
|
352
357
|
}
|
|
353
|
-
|
|
358
|
+
|
|
354
359
|
//return false if neither is NULL
|
|
355
360
|
return 0;
|
|
356
361
|
}
|
|
@@ -366,14 +371,14 @@ void UnityAssertBits(const _U_SINT mask,
|
|
|
366
371
|
const UNITY_LINE_TYPE lineNumber)
|
|
367
372
|
{
|
|
368
373
|
UNITY_SKIP_EXECUTION;
|
|
369
|
-
|
|
374
|
+
|
|
370
375
|
if ((mask & expected) != (mask & actual))
|
|
371
376
|
{
|
|
372
377
|
UnityTestResultsFailBegin(lineNumber);
|
|
373
378
|
UnityPrint(UnityStrExpected);
|
|
374
|
-
UnityPrintMask(mask, expected);
|
|
379
|
+
UnityPrintMask((_U_UINT)mask, (_U_UINT)expected);
|
|
375
380
|
UnityPrint(UnityStrWas);
|
|
376
|
-
UnityPrintMask(mask, actual);
|
|
381
|
+
UnityPrintMask((_U_UINT)mask, (_U_UINT)actual);
|
|
377
382
|
UnityAddMsgIfSpecified(msg);
|
|
378
383
|
UNITY_FAIL_AND_BAIL;
|
|
379
384
|
}
|
|
@@ -401,19 +406,19 @@ void UnityAssertEqualNumber(const _U_SINT expected,
|
|
|
401
406
|
}
|
|
402
407
|
|
|
403
408
|
//-----------------------------------------------
|
|
404
|
-
void UnityAssertEqualIntArray(const
|
|
405
|
-
const
|
|
409
|
+
void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
|
|
410
|
+
UNITY_PTR_ATTRIBUTE const void* actual,
|
|
406
411
|
const _UU32 num_elements,
|
|
407
412
|
const char* msg,
|
|
408
413
|
const UNITY_LINE_TYPE lineNumber,
|
|
409
414
|
const UNITY_DISPLAY_STYLE_T style)
|
|
410
415
|
{
|
|
411
416
|
_UU32 elements = num_elements;
|
|
412
|
-
const _US8* ptr_exp = (_US8*)expected;
|
|
413
|
-
const _US8* ptr_act = (_US8*)actual;
|
|
417
|
+
UNITY_PTR_ATTRIBUTE const _US8* ptr_exp = (UNITY_PTR_ATTRIBUTE _US8*)expected;
|
|
418
|
+
UNITY_PTR_ATTRIBUTE const _US8* ptr_act = (UNITY_PTR_ATTRIBUTE _US8*)actual;
|
|
414
419
|
|
|
415
420
|
UNITY_SKIP_EXECUTION;
|
|
416
|
-
|
|
421
|
+
|
|
417
422
|
if (elements == 0)
|
|
418
423
|
{
|
|
419
424
|
UnityTestResultsFailBegin(lineNumber);
|
|
@@ -421,14 +426,14 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|
|
421
426
|
UnityAddMsgIfSpecified(msg);
|
|
422
427
|
UNITY_FAIL_AND_BAIL;
|
|
423
428
|
}
|
|
424
|
-
|
|
425
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
|
429
|
+
|
|
430
|
+
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
|
426
431
|
return;
|
|
427
432
|
|
|
428
433
|
// If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case
|
|
429
434
|
// as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific
|
|
430
435
|
// variants do not. Therefore remove this flag.
|
|
431
|
-
switch(style & ~UNITY_DISPLAY_RANGE_AUTO)
|
|
436
|
+
switch(style & (UNITY_DISPLAY_STYLE_T)(~UNITY_DISPLAY_RANGE_AUTO))
|
|
432
437
|
{
|
|
433
438
|
case UNITY_DISPLAY_STYLE_HEX8:
|
|
434
439
|
case UNITY_DISPLAY_STYLE_INT8:
|
|
@@ -456,15 +461,15 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|
|
456
461
|
case UNITY_DISPLAY_STYLE_UINT16:
|
|
457
462
|
while (elements--)
|
|
458
463
|
{
|
|
459
|
-
if (*(_US16*)ptr_exp != *(_US16*)ptr_act)
|
|
464
|
+
if (*(UNITY_PTR_ATTRIBUTE _US16*)ptr_exp != *(UNITY_PTR_ATTRIBUTE _US16*)ptr_act)
|
|
460
465
|
{
|
|
461
466
|
UnityTestResultsFailBegin(lineNumber);
|
|
462
467
|
UnityPrint(UnityStrElement);
|
|
463
468
|
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
|
464
469
|
UnityPrint(UnityStrExpected);
|
|
465
|
-
UnityPrintNumberByStyle(*(_US16*)ptr_exp, style);
|
|
470
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US16*)ptr_exp, style);
|
|
466
471
|
UnityPrint(UnityStrWas);
|
|
467
|
-
UnityPrintNumberByStyle(*(_US16*)ptr_act, style);
|
|
472
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US16*)ptr_act, style);
|
|
468
473
|
UnityAddMsgIfSpecified(msg);
|
|
469
474
|
UNITY_FAIL_AND_BAIL;
|
|
470
475
|
}
|
|
@@ -478,15 +483,15 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|
|
478
483
|
case UNITY_DISPLAY_STYLE_UINT64:
|
|
479
484
|
while (elements--)
|
|
480
485
|
{
|
|
481
|
-
if (*(_US64*)ptr_exp != *(_US64*)ptr_act)
|
|
486
|
+
if (*(UNITY_PTR_ATTRIBUTE _US64*)ptr_exp != *(UNITY_PTR_ATTRIBUTE _US64*)ptr_act)
|
|
482
487
|
{
|
|
483
488
|
UnityTestResultsFailBegin(lineNumber);
|
|
484
489
|
UnityPrint(UnityStrElement);
|
|
485
490
|
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
|
486
491
|
UnityPrint(UnityStrExpected);
|
|
487
|
-
UnityPrintNumberByStyle(*(_US64*)ptr_exp, style);
|
|
492
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US64*)ptr_exp, style);
|
|
488
493
|
UnityPrint(UnityStrWas);
|
|
489
|
-
UnityPrintNumberByStyle(*(_US64*)ptr_act, style);
|
|
494
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US64*)ptr_act, style);
|
|
490
495
|
UnityAddMsgIfSpecified(msg);
|
|
491
496
|
UNITY_FAIL_AND_BAIL;
|
|
492
497
|
}
|
|
@@ -498,15 +503,15 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|
|
498
503
|
default:
|
|
499
504
|
while (elements--)
|
|
500
505
|
{
|
|
501
|
-
if (*(_US32*)ptr_exp != *(_US32*)ptr_act)
|
|
506
|
+
if (*(UNITY_PTR_ATTRIBUTE _US32*)ptr_exp != *(UNITY_PTR_ATTRIBUTE _US32*)ptr_act)
|
|
502
507
|
{
|
|
503
508
|
UnityTestResultsFailBegin(lineNumber);
|
|
504
509
|
UnityPrint(UnityStrElement);
|
|
505
510
|
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
|
506
511
|
UnityPrint(UnityStrExpected);
|
|
507
|
-
UnityPrintNumberByStyle(*(_US32*)ptr_exp, style);
|
|
512
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US32*)ptr_exp, style);
|
|
508
513
|
UnityPrint(UnityStrWas);
|
|
509
|
-
UnityPrintNumberByStyle(*(_US32*)ptr_act, style);
|
|
514
|
+
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US32*)ptr_act, style);
|
|
510
515
|
UnityAddMsgIfSpecified(msg);
|
|
511
516
|
UNITY_FAIL_AND_BAIL;
|
|
512
517
|
}
|
|
@@ -519,19 +524,19 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|
|
519
524
|
|
|
520
525
|
//-----------------------------------------------
|
|
521
526
|
#ifndef UNITY_EXCLUDE_FLOAT
|
|
522
|
-
void UnityAssertEqualFloatArray(const _UF* expected,
|
|
523
|
-
const _UF* actual,
|
|
527
|
+
void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
|
|
528
|
+
UNITY_PTR_ATTRIBUTE const _UF* actual,
|
|
524
529
|
const _UU32 num_elements,
|
|
525
530
|
const char* msg,
|
|
526
531
|
const UNITY_LINE_TYPE lineNumber)
|
|
527
532
|
{
|
|
528
533
|
_UU32 elements = num_elements;
|
|
529
|
-
const _UF* ptr_expected = expected;
|
|
530
|
-
const _UF* ptr_actual = actual;
|
|
534
|
+
UNITY_PTR_ATTRIBUTE const _UF* ptr_expected = expected;
|
|
535
|
+
UNITY_PTR_ATTRIBUTE const _UF* ptr_actual = actual;
|
|
531
536
|
_UF diff, tol;
|
|
532
537
|
|
|
533
538
|
UNITY_SKIP_EXECUTION;
|
|
534
|
-
|
|
539
|
+
|
|
535
540
|
if (elements == 0)
|
|
536
541
|
{
|
|
537
542
|
UnityTestResultsFailBegin(lineNumber);
|
|
@@ -539,8 +544,8 @@ void UnityAssertEqualFloatArray(const _UF* expected,
|
|
|
539
544
|
UnityAddMsgIfSpecified(msg);
|
|
540
545
|
UNITY_FAIL_AND_BAIL;
|
|
541
546
|
}
|
|
542
|
-
|
|
543
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
|
547
|
+
|
|
548
|
+
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
|
544
549
|
return;
|
|
545
550
|
|
|
546
551
|
while (elements--)
|
|
@@ -551,7 +556,7 @@ void UnityAssertEqualFloatArray(const _UF* expected,
|
|
|
551
556
|
tol = UNITY_FLOAT_PRECISION * *ptr_expected;
|
|
552
557
|
if (tol < 0.0f)
|
|
553
558
|
tol = 0.0f - tol;
|
|
554
|
-
|
|
559
|
+
|
|
555
560
|
//This first part of this condition will catch any NaN or Infinite values
|
|
556
561
|
if ((diff * 0.0f != 0.0f) || (diff > tol))
|
|
557
562
|
{
|
|
@@ -585,7 +590,7 @@ void UnityAssertFloatsWithin(const _UF delta,
|
|
|
585
590
|
_UF pos_delta = delta;
|
|
586
591
|
|
|
587
592
|
UNITY_SKIP_EXECUTION;
|
|
588
|
-
|
|
593
|
+
|
|
589
594
|
if (diff < 0.0f)
|
|
590
595
|
{
|
|
591
596
|
diff = 0.0f - diff;
|
|
@@ -613,74 +618,61 @@ void UnityAssertFloatsWithin(const _UF delta,
|
|
|
613
618
|
}
|
|
614
619
|
|
|
615
620
|
//-----------------------------------------------
|
|
616
|
-
void
|
|
617
|
-
|
|
618
|
-
|
|
621
|
+
void UnityAssertFloatSpecial(const _UF actual,
|
|
622
|
+
const char* msg,
|
|
623
|
+
const UNITY_LINE_TYPE lineNumber,
|
|
624
|
+
const UNITY_FLOAT_TRAIT_T style)
|
|
619
625
|
{
|
|
620
626
|
UNITY_SKIP_EXECUTION;
|
|
621
627
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
+
const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet };
|
|
629
|
+
_U_SINT should_be_trait = ((_U_SINT)style & 1);
|
|
630
|
+
_U_SINT is_trait = !should_be_trait;
|
|
631
|
+
_U_SINT trait_index = style >> 1;
|
|
632
|
+
|
|
633
|
+
switch(style)
|
|
628
634
|
{
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
UNITY_FAIL_AND_BAIL;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
635
|
+
//To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
|
|
636
|
+
//We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise
|
|
637
|
+
case UNITY_FLOAT_IS_INF:
|
|
638
|
+
case UNITY_FLOAT_IS_NOT_INF:
|
|
639
|
+
is_trait = ((1.0f / f_zero) == actual) ? 1 : 0;
|
|
640
|
+
break;
|
|
641
|
+
case UNITY_FLOAT_IS_NEG_INF:
|
|
642
|
+
case UNITY_FLOAT_IS_NOT_NEG_INF:
|
|
643
|
+
is_trait = ((-1.0f / f_zero) == actual) ? 1 : 0;
|
|
644
|
+
break;
|
|
642
645
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
UNITY_SKIP_EXECUTION;
|
|
646
|
+
//NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN.
|
|
647
|
+
case UNITY_FLOAT_IS_NAN:
|
|
648
|
+
case UNITY_FLOAT_IS_NOT_NAN:
|
|
649
|
+
is_trait = (actual == actual) ? 0 : 1;
|
|
650
|
+
break;
|
|
649
651
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
UnityPrintFloat(actual);
|
|
659
|
-
#else
|
|
660
|
-
UnityPrint(UnityStrDelta);
|
|
661
|
-
#endif
|
|
662
|
-
UnityAddMsgIfSpecified(msg);
|
|
663
|
-
UNITY_FAIL_AND_BAIL;
|
|
652
|
+
//A determinate number is non infinite and not NaN. (therefore the opposite of the two above)
|
|
653
|
+
case UNITY_FLOAT_IS_DET:
|
|
654
|
+
case UNITY_FLOAT_IS_NOT_DET:
|
|
655
|
+
if ( (actual != actual) || ((1.0f / f_zero) == actual) || ((-1.0f / f_zero) == actual) )
|
|
656
|
+
is_trait = 0;
|
|
657
|
+
else
|
|
658
|
+
is_trait = 1;
|
|
659
|
+
break;
|
|
664
660
|
}
|
|
665
|
-
}
|
|
666
661
|
|
|
667
|
-
|
|
668
|
-
void UnityAssertFloatIsNaN(const _UF actual,
|
|
669
|
-
const char* msg,
|
|
670
|
-
const UNITY_LINE_TYPE lineNumber)
|
|
671
|
-
{
|
|
672
|
-
UNITY_SKIP_EXECUTION;
|
|
673
|
-
|
|
674
|
-
if (actual == actual)
|
|
662
|
+
if (is_trait != should_be_trait)
|
|
675
663
|
{
|
|
676
664
|
UnityTestResultsFailBegin(lineNumber);
|
|
677
|
-
#ifdef UNITY_FLOAT_VERBOSE
|
|
678
665
|
UnityPrint(UnityStrExpected);
|
|
679
|
-
|
|
666
|
+
if (!should_be_trait)
|
|
667
|
+
UnityPrint(UnityStrNot);
|
|
668
|
+
UnityPrint(trait_names[trait_index]);
|
|
680
669
|
UnityPrint(UnityStrWas);
|
|
670
|
+
#ifdef UNITY_FLOAT_VERBOSE
|
|
681
671
|
UnityPrintFloat(actual);
|
|
682
672
|
#else
|
|
683
|
-
|
|
673
|
+
if (should_be_trait)
|
|
674
|
+
UnityPrint(UnityStrNot);
|
|
675
|
+
UnityPrint(trait_names[trait_index]);
|
|
684
676
|
#endif
|
|
685
677
|
UnityAddMsgIfSpecified(msg);
|
|
686
678
|
UNITY_FAIL_AND_BAIL;
|
|
@@ -691,19 +683,19 @@ void UnityAssertFloatIsNaN(const _UF actual,
|
|
|
691
683
|
|
|
692
684
|
//-----------------------------------------------
|
|
693
685
|
#ifndef UNITY_EXCLUDE_DOUBLE
|
|
694
|
-
void UnityAssertEqualDoubleArray(const _UD* expected,
|
|
695
|
-
const _UD* actual,
|
|
686
|
+
void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
|
|
687
|
+
UNITY_PTR_ATTRIBUTE const _UD* actual,
|
|
696
688
|
const _UU32 num_elements,
|
|
697
689
|
const char* msg,
|
|
698
690
|
const UNITY_LINE_TYPE lineNumber)
|
|
699
691
|
{
|
|
700
692
|
_UU32 elements = num_elements;
|
|
701
|
-
const _UD* ptr_expected = expected;
|
|
702
|
-
const _UD* ptr_actual = actual;
|
|
693
|
+
UNITY_PTR_ATTRIBUTE const _UD* ptr_expected = expected;
|
|
694
|
+
UNITY_PTR_ATTRIBUTE const _UD* ptr_actual = actual;
|
|
703
695
|
_UD diff, tol;
|
|
704
696
|
|
|
705
697
|
UNITY_SKIP_EXECUTION;
|
|
706
|
-
|
|
698
|
+
|
|
707
699
|
if (elements == 0)
|
|
708
700
|
{
|
|
709
701
|
UnityTestResultsFailBegin(lineNumber);
|
|
@@ -711,8 +703,8 @@ void UnityAssertEqualDoubleArray(const _UD* expected,
|
|
|
711
703
|
UnityAddMsgIfSpecified(msg);
|
|
712
704
|
UNITY_FAIL_AND_BAIL;
|
|
713
705
|
}
|
|
714
|
-
|
|
715
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
|
706
|
+
|
|
707
|
+
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
|
716
708
|
return;
|
|
717
709
|
|
|
718
710
|
while (elements--)
|
|
@@ -723,7 +715,7 @@ void UnityAssertEqualDoubleArray(const _UD* expected,
|
|
|
723
715
|
tol = UNITY_DOUBLE_PRECISION * *ptr_expected;
|
|
724
716
|
if (tol < 0.0)
|
|
725
717
|
tol = 0.0 - tol;
|
|
726
|
-
|
|
718
|
+
|
|
727
719
|
//This first part of this condition will catch any NaN or Infinite values
|
|
728
720
|
if ((diff * 0.0 != 0.0) || (diff > tol))
|
|
729
721
|
{
|
|
@@ -757,7 +749,7 @@ void UnityAssertDoublesWithin(const _UD delta,
|
|
|
757
749
|
_UD pos_delta = delta;
|
|
758
750
|
|
|
759
751
|
UNITY_SKIP_EXECUTION;
|
|
760
|
-
|
|
752
|
+
|
|
761
753
|
if (diff < 0.0)
|
|
762
754
|
{
|
|
763
755
|
diff = 0.0 - diff;
|
|
@@ -785,76 +777,69 @@ void UnityAssertDoublesWithin(const _UD delta,
|
|
|
785
777
|
}
|
|
786
778
|
|
|
787
779
|
//-----------------------------------------------
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
780
|
+
|
|
781
|
+
void UnityAssertDoubleSpecial(const _UD actual,
|
|
782
|
+
const char* msg,
|
|
783
|
+
const UNITY_LINE_TYPE lineNumber,
|
|
784
|
+
const UNITY_FLOAT_TRAIT_T style)
|
|
791
785
|
{
|
|
792
786
|
UNITY_SKIP_EXECUTION;
|
|
793
787
|
|
|
794
|
-
|
|
795
|
-
|
|
788
|
+
const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet };
|
|
789
|
+
_U_SINT should_be_trait = ((_U_SINT)style & 1);
|
|
790
|
+
_U_SINT is_trait = !should_be_trait;
|
|
791
|
+
_U_SINT trait_index = style >> 1;
|
|
792
|
+
|
|
793
|
+
switch(style)
|
|
796
794
|
{
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
UNITY_FAIL_AND_BAIL;
|
|
808
|
-
}
|
|
809
|
-
}
|
|
795
|
+
//To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
|
|
796
|
+
//We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise
|
|
797
|
+
case UNITY_FLOAT_IS_INF:
|
|
798
|
+
case UNITY_FLOAT_IS_NOT_INF:
|
|
799
|
+
is_trait = ((1.0 / d_zero) == actual) ? 1 : 0;
|
|
800
|
+
break;
|
|
801
|
+
case UNITY_FLOAT_IS_NEG_INF:
|
|
802
|
+
case UNITY_FLOAT_IS_NOT_NEG_INF:
|
|
803
|
+
is_trait = ((-1.0 / d_zero) == actual) ? 1 : 0;
|
|
804
|
+
break;
|
|
810
805
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
UNITY_SKIP_EXECUTION;
|
|
806
|
+
//NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN.
|
|
807
|
+
case UNITY_FLOAT_IS_NAN:
|
|
808
|
+
case UNITY_FLOAT_IS_NOT_NAN:
|
|
809
|
+
is_trait = (actual == actual) ? 0 : 1;
|
|
810
|
+
break;
|
|
817
811
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
UnityPrintFloat((float)actual);
|
|
827
|
-
#else
|
|
828
|
-
UnityPrint(UnityStrDelta);
|
|
829
|
-
#endif
|
|
830
|
-
UnityAddMsgIfSpecified(msg);
|
|
831
|
-
UNITY_FAIL_AND_BAIL;
|
|
812
|
+
//A determinate number is non infinite and not NaN. (therefore the opposite of the two above)
|
|
813
|
+
case UNITY_FLOAT_IS_DET:
|
|
814
|
+
case UNITY_FLOAT_IS_NOT_DET:
|
|
815
|
+
if ( (actual != actual) || ((1.0 / d_zero) == actual) || ((-1.0 / d_zero) == actual) )
|
|
816
|
+
is_trait = 0;
|
|
817
|
+
else
|
|
818
|
+
is_trait = 1;
|
|
819
|
+
break;
|
|
832
820
|
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
//-----------------------------------------------
|
|
836
|
-
void UnityAssertDoubleIsNaN(const _UD actual,
|
|
837
|
-
const char* msg,
|
|
838
|
-
const UNITY_LINE_TYPE lineNumber)
|
|
839
|
-
{
|
|
840
|
-
UNITY_SKIP_EXECUTION;
|
|
841
821
|
|
|
842
|
-
if (
|
|
822
|
+
if (is_trait != should_be_trait)
|
|
843
823
|
{
|
|
844
824
|
UnityTestResultsFailBegin(lineNumber);
|
|
845
|
-
#ifdef UNITY_DOUBLE_VERBOSE
|
|
846
825
|
UnityPrint(UnityStrExpected);
|
|
847
|
-
|
|
826
|
+
if (!should_be_trait)
|
|
827
|
+
UnityPrint(UnityStrNot);
|
|
828
|
+
UnityPrint(trait_names[trait_index]);
|
|
848
829
|
UnityPrint(UnityStrWas);
|
|
849
|
-
|
|
830
|
+
#ifdef UNITY_DOUBLE_VERBOSE
|
|
831
|
+
UnityPrintFloat(actual);
|
|
850
832
|
#else
|
|
851
|
-
|
|
833
|
+
if (should_be_trait)
|
|
834
|
+
UnityPrint(UnityStrNot);
|
|
835
|
+
UnityPrint(trait_names[trait_index]);
|
|
852
836
|
#endif
|
|
853
837
|
UnityAddMsgIfSpecified(msg);
|
|
854
838
|
UNITY_FAIL_AND_BAIL;
|
|
855
839
|
}
|
|
856
840
|
}
|
|
857
841
|
|
|
842
|
+
|
|
858
843
|
#endif // not UNITY_EXCLUDE_DOUBLE
|
|
859
844
|
|
|
860
845
|
//-----------------------------------------------
|
|
@@ -866,7 +851,7 @@ void UnityAssertNumbersWithin( const _U_SINT delta,
|
|
|
866
851
|
const UNITY_DISPLAY_STYLE_T style)
|
|
867
852
|
{
|
|
868
853
|
UNITY_SKIP_EXECUTION;
|
|
869
|
-
|
|
854
|
+
|
|
870
855
|
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
|
871
856
|
{
|
|
872
857
|
if (actual > expected)
|
|
@@ -905,7 +890,7 @@ void UnityAssertEqualString(const char* expected,
|
|
|
905
890
|
_UU32 i;
|
|
906
891
|
|
|
907
892
|
UNITY_SKIP_EXECUTION;
|
|
908
|
-
|
|
893
|
+
|
|
909
894
|
// if both pointers not null compare the strings
|
|
910
895
|
if (expected && actual)
|
|
911
896
|
{
|
|
@@ -943,9 +928,9 @@ void UnityAssertEqualStringArray( const char** expected,
|
|
|
943
928
|
const UNITY_LINE_TYPE lineNumber)
|
|
944
929
|
{
|
|
945
930
|
_UU32 i, j = 0;
|
|
946
|
-
|
|
931
|
+
|
|
947
932
|
UNITY_SKIP_EXECUTION;
|
|
948
|
-
|
|
933
|
+
|
|
949
934
|
// if no elements, it's an error
|
|
950
935
|
if (num_elements == 0)
|
|
951
936
|
{
|
|
@@ -955,9 +940,9 @@ void UnityAssertEqualStringArray( const char** expected,
|
|
|
955
940
|
UNITY_FAIL_AND_BAIL;
|
|
956
941
|
}
|
|
957
942
|
|
|
958
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
|
943
|
+
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
|
959
944
|
return;
|
|
960
|
-
|
|
945
|
+
|
|
961
946
|
do
|
|
962
947
|
{
|
|
963
948
|
// if both pointers not null compare the strings
|
|
@@ -991,25 +976,25 @@ void UnityAssertEqualStringArray( const char** expected,
|
|
|
991
976
|
UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j]));
|
|
992
977
|
UnityAddMsgIfSpecified(msg);
|
|
993
978
|
UNITY_FAIL_AND_BAIL;
|
|
994
|
-
}
|
|
979
|
+
}
|
|
995
980
|
} while (++j < num_elements);
|
|
996
981
|
}
|
|
997
982
|
|
|
998
983
|
//-----------------------------------------------
|
|
999
|
-
void UnityAssertEqualMemory( const void* expected,
|
|
1000
|
-
const void* actual,
|
|
984
|
+
void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected,
|
|
985
|
+
UNITY_PTR_ATTRIBUTE const void* actual,
|
|
1001
986
|
const _UU32 length,
|
|
1002
987
|
const _UU32 num_elements,
|
|
1003
988
|
const char* msg,
|
|
1004
989
|
const UNITY_LINE_TYPE lineNumber)
|
|
1005
990
|
{
|
|
1006
|
-
unsigned char* ptr_exp = (unsigned char*)expected;
|
|
1007
|
-
unsigned char* ptr_act = (unsigned char*)actual;
|
|
991
|
+
UNITY_PTR_ATTRIBUTE unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE unsigned char*)expected;
|
|
992
|
+
UNITY_PTR_ATTRIBUTE unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE unsigned char*)actual;
|
|
1008
993
|
_UU32 elements = num_elements;
|
|
1009
994
|
_UU32 bytes;
|
|
1010
995
|
|
|
1011
996
|
UNITY_SKIP_EXECUTION;
|
|
1012
|
-
|
|
997
|
+
|
|
1013
998
|
if ((elements == 0) || (length == 0))
|
|
1014
999
|
{
|
|
1015
1000
|
UnityTestResultsFailBegin(lineNumber);
|
|
@@ -1018,9 +1003,9 @@ void UnityAssertEqualMemory( const void* expected,
|
|
|
1018
1003
|
UNITY_FAIL_AND_BAIL;
|
|
1019
1004
|
}
|
|
1020
1005
|
|
|
1021
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
|
1006
|
+
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
|
1022
1007
|
return;
|
|
1023
|
-
|
|
1008
|
+
|
|
1024
1009
|
while (elements--)
|
|
1025
1010
|
{
|
|
1026
1011
|
/////////////////////////////////////
|
|
@@ -1049,7 +1034,7 @@ void UnityAssertEqualMemory( const void* expected,
|
|
|
1049
1034
|
ptr_act += 1;
|
|
1050
1035
|
}
|
|
1051
1036
|
/////////////////////////////////////
|
|
1052
|
-
|
|
1037
|
+
|
|
1053
1038
|
}
|
|
1054
1039
|
}
|
|
1055
1040
|
|
|
@@ -1068,7 +1053,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
|
|
|
1068
1053
|
UNITY_OUTPUT_CHAR(':');
|
|
1069
1054
|
if (msg[0] != ' ')
|
|
1070
1055
|
{
|
|
1071
|
-
UNITY_OUTPUT_CHAR(' ');
|
|
1056
|
+
UNITY_OUTPUT_CHAR(' ');
|
|
1072
1057
|
}
|
|
1073
1058
|
UnityPrint(msg);
|
|
1074
1059
|
}
|
|
@@ -1092,13 +1077,19 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
|
|
1092
1077
|
}
|
|
1093
1078
|
|
|
1094
1079
|
//-----------------------------------------------
|
|
1080
|
+
#ifdef UNITY_SUPPORT_WEAK
|
|
1081
|
+
UNITY_WEAK void setUp(void) { }
|
|
1082
|
+
UNITY_WEAK void tearDown(void) { }
|
|
1083
|
+
#else
|
|
1095
1084
|
void setUp(void);
|
|
1096
1085
|
void tearDown(void);
|
|
1086
|
+
#endif
|
|
1087
|
+
//-----------------------------------------------
|
|
1097
1088
|
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
|
1098
1089
|
{
|
|
1099
1090
|
Unity.CurrentTestName = FuncName;
|
|
1100
|
-
Unity.CurrentTestLineNumber = FuncLineNum;
|
|
1101
|
-
Unity.NumberOfTests++;
|
|
1091
|
+
Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum;
|
|
1092
|
+
Unity.NumberOfTests++;
|
|
1102
1093
|
if (TEST_PROTECT())
|
|
1103
1094
|
{
|
|
1104
1095
|
setUp();
|
|
@@ -1114,6 +1105,9 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
|
|
|
1114
1105
|
//-----------------------------------------------
|
|
1115
1106
|
void UnityBegin(void)
|
|
1116
1107
|
{
|
|
1108
|
+
Unity.TestFile = NULL;
|
|
1109
|
+
Unity.CurrentTestName = NULL;
|
|
1110
|
+
Unity.CurrentTestLineNumber = 0;
|
|
1117
1111
|
Unity.NumberOfTests = 0;
|
|
1118
1112
|
Unity.TestFailures = 0;
|
|
1119
1113
|
Unity.TestIgnores = 0;
|
|
@@ -1124,13 +1118,14 @@ void UnityBegin(void)
|
|
|
1124
1118
|
//-----------------------------------------------
|
|
1125
1119
|
int UnityEnd(void)
|
|
1126
1120
|
{
|
|
1121
|
+
UNITY_PRINT_EOL;
|
|
1127
1122
|
UnityPrint("-----------------------");
|
|
1128
1123
|
UNITY_PRINT_EOL;
|
|
1129
|
-
UnityPrintNumber(Unity.NumberOfTests);
|
|
1124
|
+
UnityPrintNumber((_U_SINT)(Unity.NumberOfTests));
|
|
1130
1125
|
UnityPrint(" Tests ");
|
|
1131
|
-
UnityPrintNumber(Unity.TestFailures);
|
|
1126
|
+
UnityPrintNumber((_U_SINT)(Unity.TestFailures));
|
|
1132
1127
|
UnityPrint(" Failures ");
|
|
1133
|
-
UnityPrintNumber(Unity.TestIgnores);
|
|
1128
|
+
UnityPrintNumber((_U_SINT)(Unity.TestIgnores));
|
|
1134
1129
|
UnityPrint(" Ignored");
|
|
1135
1130
|
UNITY_PRINT_EOL;
|
|
1136
1131
|
if (Unity.TestFailures == 0U)
|
|
@@ -1142,5 +1137,9 @@ int UnityEnd(void)
|
|
|
1142
1137
|
UnityPrintFail();
|
|
1143
1138
|
}
|
|
1144
1139
|
UNITY_PRINT_EOL;
|
|
1145
|
-
return Unity.TestFailures;
|
|
1140
|
+
return (int)(Unity.TestFailures);
|
|
1146
1141
|
}
|
|
1142
|
+
|
|
1143
|
+
//-----------------------------------------------
|
|
1144
|
+
|
|
1145
|
+
|