ceedling 0.15.1 → 0.15.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,979 +0,0 @@
|
|
1
|
-
/* ==========================================
|
2
|
-
Unity Project - A Test Framework for C
|
3
|
-
Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
4
|
-
[Released under MIT License. Please refer to license.txt for details]
|
5
|
-
========================================== */
|
6
|
-
|
7
|
-
#include "unity.h"
|
8
|
-
#include <stdio.h>
|
9
|
-
#include <string.h>
|
10
|
-
|
11
|
-
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; UNITY_OUTPUT_CHAR('\n'); longjmp(Unity.AbortFrame, 1); }
|
12
|
-
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; UNITY_OUTPUT_CHAR('\n'); longjmp(Unity.AbortFrame, 1); }
|
13
|
-
/// return prematurely if we are already in failure or ignore state
|
14
|
-
#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
|
15
|
-
#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); }
|
16
|
-
|
17
|
-
struct _Unity Unity = { 0 };
|
18
|
-
|
19
|
-
const char* UnityStrNull = "NULL";
|
20
|
-
const char* UnityStrSpacer = ". ";
|
21
|
-
const char* UnityStrExpected = " Expected ";
|
22
|
-
const char* UnityStrWas = " Was ";
|
23
|
-
const char* UnityStrTo = " To ";
|
24
|
-
const char* UnityStrElement = " Element ";
|
25
|
-
const char* UnityStrByte = " Byte ";
|
26
|
-
const char* UnityStrMemory = " Memory Mismatch.";
|
27
|
-
const char* UnityStrDelta = " Values Not Within Delta ";
|
28
|
-
const char* UnityStrPointless= " You Asked Me To Compare Nothing, Which Was Pointless.";
|
29
|
-
const char* UnityStrNullPointerForExpected= " Expected pointer to be NULL";
|
30
|
-
const char* UnityStrNullPointerForActual = " Actual pointer was NULL";
|
31
|
-
|
32
|
-
// compiler-generic print formatting masks
|
33
|
-
const _U_UINT UnitySizeMask[] =
|
34
|
-
{
|
35
|
-
255u, // 0xFF
|
36
|
-
65535u, // 0xFFFF
|
37
|
-
65535u,
|
38
|
-
4294967295u, // 0xFFFFFFFF
|
39
|
-
4294967295u,
|
40
|
-
4294967295u,
|
41
|
-
4294967295u
|
42
|
-
#ifdef UNITY_SUPPORT_64
|
43
|
-
,0xFFFFFFFFFFFFFFFF
|
44
|
-
#endif
|
45
|
-
};
|
46
|
-
|
47
|
-
void UnityPrintFail(void);
|
48
|
-
void UnityPrintOk(void);
|
49
|
-
|
50
|
-
//-----------------------------------------------
|
51
|
-
// Pretty Printers & Test Result Output Handlers
|
52
|
-
//-----------------------------------------------
|
53
|
-
|
54
|
-
void UnityPrint(const char* string)
|
55
|
-
{
|
56
|
-
const char* pch = string;
|
57
|
-
|
58
|
-
if (pch != NULL)
|
59
|
-
{
|
60
|
-
while (*pch)
|
61
|
-
{
|
62
|
-
// printable characters plus CR & LF are printed
|
63
|
-
if ((*pch <= 126) && (*pch >= 32))
|
64
|
-
{
|
65
|
-
UNITY_OUTPUT_CHAR(*pch);
|
66
|
-
}
|
67
|
-
//write escaped carriage returns
|
68
|
-
else if (*pch == 13)
|
69
|
-
{
|
70
|
-
UNITY_OUTPUT_CHAR('\\');
|
71
|
-
UNITY_OUTPUT_CHAR('r');
|
72
|
-
}
|
73
|
-
//write escaped line feeds
|
74
|
-
else if (*pch == 10)
|
75
|
-
{
|
76
|
-
UNITY_OUTPUT_CHAR('\\');
|
77
|
-
UNITY_OUTPUT_CHAR('n');
|
78
|
-
}
|
79
|
-
// unprintable characters are shown as codes
|
80
|
-
else
|
81
|
-
{
|
82
|
-
UNITY_OUTPUT_CHAR('\\');
|
83
|
-
UnityPrintNumberHex((_U_SINT)*pch, 2);
|
84
|
-
}
|
85
|
-
pch++;
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
|
-
//-----------------------------------------------
|
91
|
-
void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style)
|
92
|
-
{
|
93
|
-
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
94
|
-
{
|
95
|
-
UnityPrintNumber(number);
|
96
|
-
}
|
97
|
-
else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT)
|
98
|
-
{
|
99
|
-
UnityPrintNumberUnsigned( (_U_UINT)number & UnitySizeMask[((_U_UINT)style & (_U_UINT)0x0F) - 1] );
|
100
|
-
}
|
101
|
-
else
|
102
|
-
{
|
103
|
-
UnityPrintNumberHex((_U_UINT)number, (style & 0x000F) << 1);
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
//-----------------------------------------------
|
108
|
-
/// basically do an itoa using as little ram as possible
|
109
|
-
void UnityPrintNumber(const _U_SINT number_to_print)
|
110
|
-
{
|
111
|
-
_U_SINT divisor = 1;
|
112
|
-
_U_SINT next_divisor;
|
113
|
-
_U_SINT number = number_to_print;
|
114
|
-
|
115
|
-
if (number < 0)
|
116
|
-
{
|
117
|
-
UNITY_OUTPUT_CHAR('-');
|
118
|
-
number = -number;
|
119
|
-
}
|
120
|
-
|
121
|
-
// figure out initial divisor
|
122
|
-
while (number / divisor > 9)
|
123
|
-
{
|
124
|
-
next_divisor = divisor * 10;
|
125
|
-
if (next_divisor > divisor)
|
126
|
-
divisor = next_divisor;
|
127
|
-
else
|
128
|
-
break;
|
129
|
-
}
|
130
|
-
|
131
|
-
// now mod and print, then divide divisor
|
132
|
-
do
|
133
|
-
{
|
134
|
-
UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
|
135
|
-
divisor /= 10;
|
136
|
-
}
|
137
|
-
while (divisor > 0);
|
138
|
-
}
|
139
|
-
|
140
|
-
//-----------------------------------------------
|
141
|
-
/// basically do an itoa using as little ram as possible
|
142
|
-
void UnityPrintNumberUnsigned(const _U_UINT number)
|
143
|
-
{
|
144
|
-
_U_UINT divisor = 1;
|
145
|
-
_U_UINT next_divisor;
|
146
|
-
|
147
|
-
// figure out initial divisor
|
148
|
-
while (number / divisor > 9)
|
149
|
-
{
|
150
|
-
next_divisor = divisor * 10;
|
151
|
-
if (next_divisor > divisor)
|
152
|
-
divisor = next_divisor;
|
153
|
-
else
|
154
|
-
break;
|
155
|
-
}
|
156
|
-
|
157
|
-
// now mod and print, then divide divisor
|
158
|
-
do
|
159
|
-
{
|
160
|
-
UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
|
161
|
-
divisor /= 10;
|
162
|
-
}
|
163
|
-
while (divisor > 0);
|
164
|
-
}
|
165
|
-
|
166
|
-
//-----------------------------------------------
|
167
|
-
void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print)
|
168
|
-
{
|
169
|
-
_U_UINT nibble;
|
170
|
-
char nibbles = nibbles_to_print;
|
171
|
-
UNITY_OUTPUT_CHAR('0');
|
172
|
-
UNITY_OUTPUT_CHAR('x');
|
173
|
-
|
174
|
-
while (nibbles > 0)
|
175
|
-
{
|
176
|
-
nibble = (number >> (--nibbles << 2)) & 0x0000000F;
|
177
|
-
if (nibble <= 9)
|
178
|
-
{
|
179
|
-
UNITY_OUTPUT_CHAR((char)('0' + nibble));
|
180
|
-
}
|
181
|
-
else
|
182
|
-
{
|
183
|
-
UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble));
|
184
|
-
}
|
185
|
-
}
|
186
|
-
}
|
187
|
-
|
188
|
-
//-----------------------------------------------
|
189
|
-
void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
|
190
|
-
{
|
191
|
-
_U_UINT current_bit = (_U_UINT)1 << (UNITY_INT_WIDTH - 1);
|
192
|
-
_US32 i;
|
193
|
-
|
194
|
-
for (i = 0; i < UNITY_INT_WIDTH; i++)
|
195
|
-
{
|
196
|
-
if (current_bit & mask)
|
197
|
-
{
|
198
|
-
if (current_bit & number)
|
199
|
-
{
|
200
|
-
UNITY_OUTPUT_CHAR('1');
|
201
|
-
}
|
202
|
-
else
|
203
|
-
{
|
204
|
-
UNITY_OUTPUT_CHAR('0');
|
205
|
-
}
|
206
|
-
}
|
207
|
-
else
|
208
|
-
{
|
209
|
-
UNITY_OUTPUT_CHAR('X');
|
210
|
-
}
|
211
|
-
current_bit = current_bit >> 1;
|
212
|
-
}
|
213
|
-
}
|
214
|
-
|
215
|
-
//-----------------------------------------------
|
216
|
-
#ifdef UNITY_FLOAT_VERBOSE
|
217
|
-
void UnityPrintFloat(_UF number)
|
218
|
-
{
|
219
|
-
char TempBuffer[32];
|
220
|
-
sprintf(TempBuffer, "%.6f", number);
|
221
|
-
UnityPrint(TempBuffer);
|
222
|
-
}
|
223
|
-
#endif
|
224
|
-
|
225
|
-
//-----------------------------------------------
|
226
|
-
|
227
|
-
void UnityPrintFail(void)
|
228
|
-
{
|
229
|
-
UnityPrint("FAIL");
|
230
|
-
}
|
231
|
-
|
232
|
-
void UnityPrintOk(void)
|
233
|
-
{
|
234
|
-
UnityPrint("OK");
|
235
|
-
}
|
236
|
-
|
237
|
-
//-----------------------------------------------
|
238
|
-
void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
239
|
-
{
|
240
|
-
UnityPrint(file);
|
241
|
-
UNITY_OUTPUT_CHAR(':');
|
242
|
-
UnityPrintNumber(line);
|
243
|
-
UNITY_OUTPUT_CHAR(':');
|
244
|
-
UnityPrint(Unity.CurrentTestName);
|
245
|
-
UNITY_OUTPUT_CHAR(':');
|
246
|
-
}
|
247
|
-
|
248
|
-
//-----------------------------------------------
|
249
|
-
void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
|
250
|
-
{
|
251
|
-
UnityTestResultsBegin(Unity.TestFile, line);
|
252
|
-
UnityPrint("FAIL:");
|
253
|
-
}
|
254
|
-
|
255
|
-
//-----------------------------------------------
|
256
|
-
void UnityConcludeTest(void)
|
257
|
-
{
|
258
|
-
if (Unity.CurrentTestIgnored)
|
259
|
-
{
|
260
|
-
Unity.TestIgnores++;
|
261
|
-
}
|
262
|
-
else if (!Unity.CurrentTestFailed)
|
263
|
-
{
|
264
|
-
UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber);
|
265
|
-
UnityPrint("PASS");
|
266
|
-
UNITY_PRINT_EOL;
|
267
|
-
}
|
268
|
-
else
|
269
|
-
{
|
270
|
-
Unity.TestFailures++;
|
271
|
-
}
|
272
|
-
|
273
|
-
Unity.CurrentTestFailed = 0;
|
274
|
-
Unity.CurrentTestIgnored = 0;
|
275
|
-
}
|
276
|
-
|
277
|
-
//-----------------------------------------------
|
278
|
-
void UnityAddMsgIfSpecified(const char* msg)
|
279
|
-
{
|
280
|
-
if (msg)
|
281
|
-
{
|
282
|
-
UnityPrint(UnityStrSpacer);
|
283
|
-
UnityPrint(msg);
|
284
|
-
}
|
285
|
-
}
|
286
|
-
|
287
|
-
//-----------------------------------------------
|
288
|
-
void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
|
289
|
-
{
|
290
|
-
UnityPrint(UnityStrExpected);
|
291
|
-
if (expected != NULL)
|
292
|
-
{
|
293
|
-
UNITY_OUTPUT_CHAR('\'');
|
294
|
-
UnityPrint(expected);
|
295
|
-
UNITY_OUTPUT_CHAR('\'');
|
296
|
-
}
|
297
|
-
else
|
298
|
-
{
|
299
|
-
UnityPrint(UnityStrNull);
|
300
|
-
}
|
301
|
-
UnityPrint(UnityStrWas);
|
302
|
-
if (actual != NULL)
|
303
|
-
{
|
304
|
-
UNITY_OUTPUT_CHAR('\'');
|
305
|
-
UnityPrint(actual);
|
306
|
-
UNITY_OUTPUT_CHAR('\'');
|
307
|
-
}
|
308
|
-
else
|
309
|
-
{
|
310
|
-
UnityPrint(UnityStrNull);
|
311
|
-
}
|
312
|
-
}
|
313
|
-
|
314
|
-
//-----------------------------------------------
|
315
|
-
// Assertion & Control Helpers
|
316
|
-
//-----------------------------------------------
|
317
|
-
|
318
|
-
int UnityCheckArraysForNull(const void* expected, const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
319
|
-
{
|
320
|
-
//return true if they are both NULL
|
321
|
-
if ((expected == NULL) && (actual == NULL))
|
322
|
-
return 1;
|
323
|
-
|
324
|
-
//throw error if just expected is NULL
|
325
|
-
if (expected == NULL)
|
326
|
-
{
|
327
|
-
UnityTestResultsFailBegin(lineNumber);
|
328
|
-
UnityPrint(UnityStrNullPointerForExpected);
|
329
|
-
UnityAddMsgIfSpecified(msg);
|
330
|
-
UNITY_FAIL_AND_BAIL;
|
331
|
-
}
|
332
|
-
|
333
|
-
//throw error if just actual is NULL
|
334
|
-
if (actual == NULL)
|
335
|
-
{
|
336
|
-
UnityTestResultsFailBegin(lineNumber);
|
337
|
-
UnityPrint(UnityStrNullPointerForActual);
|
338
|
-
UnityAddMsgIfSpecified(msg);
|
339
|
-
UNITY_FAIL_AND_BAIL;
|
340
|
-
}
|
341
|
-
|
342
|
-
//return false if neither is NULL
|
343
|
-
return 0;
|
344
|
-
}
|
345
|
-
|
346
|
-
//-----------------------------------------------
|
347
|
-
// Assertion Functions
|
348
|
-
//-----------------------------------------------
|
349
|
-
|
350
|
-
void UnityAssertBits(const _U_SINT mask,
|
351
|
-
const _U_SINT expected,
|
352
|
-
const _U_SINT actual,
|
353
|
-
const char* msg,
|
354
|
-
const UNITY_LINE_TYPE lineNumber)
|
355
|
-
{
|
356
|
-
UNITY_SKIP_EXECUTION;
|
357
|
-
|
358
|
-
if ((mask & expected) != (mask & actual))
|
359
|
-
{
|
360
|
-
UnityTestResultsFailBegin(lineNumber);
|
361
|
-
UnityPrint(UnityStrExpected);
|
362
|
-
UnityPrintMask(mask, expected);
|
363
|
-
UnityPrint(UnityStrWas);
|
364
|
-
UnityPrintMask(mask, actual);
|
365
|
-
UnityAddMsgIfSpecified(msg);
|
366
|
-
UNITY_FAIL_AND_BAIL;
|
367
|
-
}
|
368
|
-
}
|
369
|
-
|
370
|
-
//-----------------------------------------------
|
371
|
-
void UnityAssertEqualNumber(const _U_SINT expected,
|
372
|
-
const _U_SINT actual,
|
373
|
-
const char* msg,
|
374
|
-
const UNITY_LINE_TYPE lineNumber,
|
375
|
-
const UNITY_DISPLAY_STYLE_T style)
|
376
|
-
{
|
377
|
-
UNITY_SKIP_EXECUTION;
|
378
|
-
|
379
|
-
if (expected != actual)
|
380
|
-
{
|
381
|
-
UnityTestResultsFailBegin(lineNumber);
|
382
|
-
UnityPrint(UnityStrExpected);
|
383
|
-
UnityPrintNumberByStyle(expected, style);
|
384
|
-
UnityPrint(UnityStrWas);
|
385
|
-
UnityPrintNumberByStyle(actual, style);
|
386
|
-
UnityAddMsgIfSpecified(msg);
|
387
|
-
UNITY_FAIL_AND_BAIL;
|
388
|
-
}
|
389
|
-
}
|
390
|
-
|
391
|
-
//-----------------------------------------------
|
392
|
-
void UnityAssertEqualIntArray(const _U_SINT* expected,
|
393
|
-
const _U_SINT* actual,
|
394
|
-
const _UU32 num_elements,
|
395
|
-
const char* msg,
|
396
|
-
const UNITY_LINE_TYPE lineNumber,
|
397
|
-
const UNITY_DISPLAY_STYLE_T style)
|
398
|
-
{
|
399
|
-
_UU32 elements = num_elements;
|
400
|
-
const _US8* ptr_exp = (_US8*)expected;
|
401
|
-
const _US8* ptr_act = (_US8*)actual;
|
402
|
-
|
403
|
-
UNITY_SKIP_EXECUTION;
|
404
|
-
|
405
|
-
if (elements == 0)
|
406
|
-
{
|
407
|
-
UnityTestResultsFailBegin(lineNumber);
|
408
|
-
UnityPrint(UnityStrPointless);
|
409
|
-
UnityAddMsgIfSpecified(msg);
|
410
|
-
UNITY_FAIL_AND_BAIL;
|
411
|
-
}
|
412
|
-
|
413
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
414
|
-
return;
|
415
|
-
|
416
|
-
switch(style)
|
417
|
-
{
|
418
|
-
case UNITY_DISPLAY_STYLE_HEX8:
|
419
|
-
case UNITY_DISPLAY_STYLE_INT8:
|
420
|
-
case UNITY_DISPLAY_STYLE_UINT8:
|
421
|
-
while (elements--)
|
422
|
-
{
|
423
|
-
if (*ptr_exp != *ptr_act)
|
424
|
-
{
|
425
|
-
UnityTestResultsFailBegin(lineNumber);
|
426
|
-
UnityPrint(UnityStrElement);
|
427
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
428
|
-
UnityPrint(UnityStrExpected);
|
429
|
-
UnityPrintNumberByStyle(*ptr_exp, style);
|
430
|
-
UnityPrint(UnityStrWas);
|
431
|
-
UnityPrintNumberByStyle(*ptr_act, style);
|
432
|
-
UnityAddMsgIfSpecified(msg);
|
433
|
-
UNITY_FAIL_AND_BAIL;
|
434
|
-
}
|
435
|
-
ptr_exp += 1;
|
436
|
-
ptr_act += 1;
|
437
|
-
}
|
438
|
-
break;
|
439
|
-
case UNITY_DISPLAY_STYLE_HEX16:
|
440
|
-
case UNITY_DISPLAY_STYLE_INT16:
|
441
|
-
case UNITY_DISPLAY_STYLE_UINT16:
|
442
|
-
while (elements--)
|
443
|
-
{
|
444
|
-
if (*(_US16*)ptr_exp != *(_US16*)ptr_act)
|
445
|
-
{
|
446
|
-
UnityTestResultsFailBegin(lineNumber);
|
447
|
-
UnityPrint(UnityStrElement);
|
448
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
449
|
-
UnityPrint(UnityStrExpected);
|
450
|
-
UnityPrintNumberByStyle(*(_US16*)ptr_exp, style);
|
451
|
-
UnityPrint(UnityStrWas);
|
452
|
-
UnityPrintNumberByStyle(*(_US16*)ptr_act, style);
|
453
|
-
UnityAddMsgIfSpecified(msg);
|
454
|
-
UNITY_FAIL_AND_BAIL;
|
455
|
-
}
|
456
|
-
ptr_exp += 2;
|
457
|
-
ptr_act += 2;
|
458
|
-
}
|
459
|
-
break;
|
460
|
-
#ifdef UNITY_SUPPORT_64
|
461
|
-
case UNITY_DISPLAY_STYLE_HEX64:
|
462
|
-
case UNITY_DISPLAY_STYLE_INT64:
|
463
|
-
case UNITY_DISPLAY_STYLE_UINT64:
|
464
|
-
while (elements--)
|
465
|
-
{
|
466
|
-
if (*(_US64*)ptr_exp != *(_US64*)ptr_act)
|
467
|
-
{
|
468
|
-
UnityTestResultsFailBegin(lineNumber);
|
469
|
-
UnityPrint(UnityStrElement);
|
470
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
471
|
-
UnityPrint(UnityStrExpected);
|
472
|
-
UnityPrintNumberByStyle(*(_US64*)ptr_exp, style);
|
473
|
-
UnityPrint(UnityStrWas);
|
474
|
-
UnityPrintNumberByStyle(*(_US64*)ptr_act, style);
|
475
|
-
UnityAddMsgIfSpecified(msg);
|
476
|
-
UNITY_FAIL_AND_BAIL;
|
477
|
-
}
|
478
|
-
ptr_exp += 8;
|
479
|
-
ptr_act += 8;
|
480
|
-
}
|
481
|
-
break;
|
482
|
-
#endif
|
483
|
-
default:
|
484
|
-
while (elements--)
|
485
|
-
{
|
486
|
-
if (*(_US32*)ptr_exp != *(_US32*)ptr_act)
|
487
|
-
{
|
488
|
-
UnityTestResultsFailBegin(lineNumber);
|
489
|
-
UnityPrint(UnityStrElement);
|
490
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
491
|
-
UnityPrint(UnityStrExpected);
|
492
|
-
UnityPrintNumberByStyle(*(_US32*)ptr_exp, style);
|
493
|
-
UnityPrint(UnityStrWas);
|
494
|
-
UnityPrintNumberByStyle(*(_US32*)ptr_act, style);
|
495
|
-
UnityAddMsgIfSpecified(msg);
|
496
|
-
UNITY_FAIL_AND_BAIL;
|
497
|
-
}
|
498
|
-
ptr_exp += 4;
|
499
|
-
ptr_act += 4;
|
500
|
-
}
|
501
|
-
break;
|
502
|
-
}
|
503
|
-
}
|
504
|
-
|
505
|
-
//-----------------------------------------------
|
506
|
-
#ifndef UNITY_EXCLUDE_FLOAT
|
507
|
-
void UnityAssertEqualFloatArray(const _UF* expected,
|
508
|
-
const _UF* actual,
|
509
|
-
const _UU32 num_elements,
|
510
|
-
const char* msg,
|
511
|
-
const UNITY_LINE_TYPE lineNumber)
|
512
|
-
{
|
513
|
-
_UU32 elements = num_elements;
|
514
|
-
const _UF* ptr_expected = expected;
|
515
|
-
const _UF* ptr_actual = actual;
|
516
|
-
_UF diff, tol;
|
517
|
-
|
518
|
-
UNITY_SKIP_EXECUTION;
|
519
|
-
|
520
|
-
if (elements == 0)
|
521
|
-
{
|
522
|
-
UnityTestResultsFailBegin(lineNumber);
|
523
|
-
UnityPrint(UnityStrPointless);
|
524
|
-
UnityAddMsgIfSpecified(msg);
|
525
|
-
UNITY_FAIL_AND_BAIL;
|
526
|
-
}
|
527
|
-
|
528
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
529
|
-
return;
|
530
|
-
|
531
|
-
while (elements--)
|
532
|
-
{
|
533
|
-
diff = *ptr_expected - *ptr_actual;
|
534
|
-
if (diff < 0.0)
|
535
|
-
diff = 0.0 - diff;
|
536
|
-
tol = UNITY_FLOAT_PRECISION * *ptr_expected;
|
537
|
-
if (tol < 0.0)
|
538
|
-
tol = 0.0 - tol;
|
539
|
-
if (diff > tol)
|
540
|
-
{
|
541
|
-
UnityTestResultsFailBegin(lineNumber);
|
542
|
-
UnityPrint(UnityStrElement);
|
543
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
544
|
-
#ifdef UNITY_FLOAT_VERBOSE
|
545
|
-
UnityPrint(UnityStrExpected);
|
546
|
-
UnityPrintFloat(*ptr_expected);
|
547
|
-
UnityPrint(UnityStrWas);
|
548
|
-
UnityPrintFloat(*ptr_actual);
|
549
|
-
#else
|
550
|
-
UnityPrint(UnityStrDelta);
|
551
|
-
#endif
|
552
|
-
UnityAddMsgIfSpecified(msg);
|
553
|
-
UNITY_FAIL_AND_BAIL;
|
554
|
-
}
|
555
|
-
ptr_expected++;
|
556
|
-
ptr_actual++;
|
557
|
-
}
|
558
|
-
}
|
559
|
-
|
560
|
-
//-----------------------------------------------
|
561
|
-
void UnityAssertFloatsWithin(const _UF delta,
|
562
|
-
const _UF expected,
|
563
|
-
const _UF actual,
|
564
|
-
const char* msg,
|
565
|
-
const UNITY_LINE_TYPE lineNumber)
|
566
|
-
{
|
567
|
-
_UF diff = actual - expected;
|
568
|
-
_UF pos_delta = delta;
|
569
|
-
|
570
|
-
UNITY_SKIP_EXECUTION;
|
571
|
-
|
572
|
-
if (diff < 0)
|
573
|
-
{
|
574
|
-
diff = 0.0f - diff;
|
575
|
-
}
|
576
|
-
if (pos_delta < 0)
|
577
|
-
{
|
578
|
-
pos_delta = 0.0f - pos_delta;
|
579
|
-
}
|
580
|
-
|
581
|
-
if (pos_delta < diff)
|
582
|
-
{
|
583
|
-
UnityTestResultsFailBegin(lineNumber);
|
584
|
-
#ifdef UNITY_FLOAT_VERBOSE
|
585
|
-
UnityPrint(UnityStrExpected);
|
586
|
-
UnityPrintFloat(expected);
|
587
|
-
UnityPrint(UnityStrWas);
|
588
|
-
UnityPrintFloat(actual);
|
589
|
-
#else
|
590
|
-
UnityPrint(UnityStrDelta);
|
591
|
-
#endif
|
592
|
-
UnityAddMsgIfSpecified(msg);
|
593
|
-
UNITY_FAIL_AND_BAIL;
|
594
|
-
}
|
595
|
-
}
|
596
|
-
|
597
|
-
#endif //not UNITY_EXCLUDE_FLOAT
|
598
|
-
|
599
|
-
//-----------------------------------------------
|
600
|
-
#ifndef UNITY_EXCLUDE_DOUBLE
|
601
|
-
void UnityAssertEqualDoubleArray(const _UD* expected,
|
602
|
-
const _UD* actual,
|
603
|
-
const _UU32 num_elements,
|
604
|
-
const char* msg,
|
605
|
-
const UNITY_LINE_TYPE lineNumber)
|
606
|
-
{
|
607
|
-
_UU32 elements = num_elements;
|
608
|
-
const _UD* ptr_expected = expected;
|
609
|
-
const _UD* ptr_actual = actual;
|
610
|
-
_UD diff, tol;
|
611
|
-
|
612
|
-
UNITY_SKIP_EXECUTION;
|
613
|
-
|
614
|
-
if (elements == 0)
|
615
|
-
{
|
616
|
-
UnityTestResultsFailBegin(lineNumber);
|
617
|
-
UnityPrint(UnityStrPointless);
|
618
|
-
UnityAddMsgIfSpecified(msg);
|
619
|
-
UNITY_FAIL_AND_BAIL;
|
620
|
-
}
|
621
|
-
|
622
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
623
|
-
return;
|
624
|
-
|
625
|
-
while (elements--)
|
626
|
-
{
|
627
|
-
diff = *ptr_expected - *ptr_actual;
|
628
|
-
if (diff < 0.0)
|
629
|
-
diff = 0.0 - diff;
|
630
|
-
tol = UNITY_DOUBLE_PRECISION * *ptr_expected;
|
631
|
-
if (tol < 0.0)
|
632
|
-
tol = 0.0 - tol;
|
633
|
-
if (diff > tol)
|
634
|
-
{
|
635
|
-
UnityTestResultsFailBegin(lineNumber);
|
636
|
-
UnityPrint(UnityStrElement);
|
637
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
638
|
-
#ifdef UNITY_DOUBLE_VERBOSE
|
639
|
-
UnityPrint(UnityStrExpected);
|
640
|
-
UnityPrintFloat((float)(*ptr_expected));
|
641
|
-
UnityPrint(UnityStrWas);
|
642
|
-
UnityPrintFloat((float)(*ptr_actual));
|
643
|
-
#else
|
644
|
-
UnityPrint(UnityStrDelta);
|
645
|
-
#endif
|
646
|
-
UnityAddMsgIfSpecified(msg);
|
647
|
-
UNITY_FAIL_AND_BAIL;
|
648
|
-
}
|
649
|
-
ptr_expected++;
|
650
|
-
ptr_actual++;
|
651
|
-
}
|
652
|
-
}
|
653
|
-
|
654
|
-
//-----------------------------------------------
|
655
|
-
void UnityAssertDoublesWithin(const _UD delta,
|
656
|
-
const _UD expected,
|
657
|
-
const _UD actual,
|
658
|
-
const char* msg,
|
659
|
-
const UNITY_LINE_TYPE lineNumber)
|
660
|
-
{
|
661
|
-
_UD diff = actual - expected;
|
662
|
-
_UD pos_delta = delta;
|
663
|
-
|
664
|
-
UNITY_SKIP_EXECUTION;
|
665
|
-
|
666
|
-
if (diff < 0)
|
667
|
-
{
|
668
|
-
diff = 0.0f - diff;
|
669
|
-
}
|
670
|
-
if (pos_delta < 0)
|
671
|
-
{
|
672
|
-
pos_delta = 0.0f - pos_delta;
|
673
|
-
}
|
674
|
-
|
675
|
-
if (pos_delta < diff)
|
676
|
-
{
|
677
|
-
UnityTestResultsFailBegin(lineNumber);
|
678
|
-
#ifdef UNITY_DOUBLE_VERBOSE
|
679
|
-
UnityPrint(UnityStrExpected);
|
680
|
-
UnityPrintFloat((float)expected);
|
681
|
-
UnityPrint(UnityStrWas);
|
682
|
-
UnityPrintFloat((float)actual);
|
683
|
-
#else
|
684
|
-
UnityPrint(UnityStrDelta);
|
685
|
-
#endif
|
686
|
-
UnityAddMsgIfSpecified(msg);
|
687
|
-
UNITY_FAIL_AND_BAIL;
|
688
|
-
}
|
689
|
-
}
|
690
|
-
|
691
|
-
#endif // not UNITY_EXCLUDE_DOUBLE
|
692
|
-
|
693
|
-
//-----------------------------------------------
|
694
|
-
void UnityAssertNumbersWithin( const _U_SINT delta,
|
695
|
-
const _U_SINT expected,
|
696
|
-
const _U_SINT actual,
|
697
|
-
const char* msg,
|
698
|
-
const UNITY_LINE_TYPE lineNumber,
|
699
|
-
const UNITY_DISPLAY_STYLE_T style)
|
700
|
-
{
|
701
|
-
UNITY_SKIP_EXECUTION;
|
702
|
-
|
703
|
-
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
704
|
-
{
|
705
|
-
if (actual > expected)
|
706
|
-
Unity.CurrentTestFailed = ((actual - expected) > delta);
|
707
|
-
else
|
708
|
-
Unity.CurrentTestFailed = ((expected - actual) > delta);
|
709
|
-
}
|
710
|
-
else
|
711
|
-
{
|
712
|
-
if ((_U_UINT)actual > (_U_UINT)expected)
|
713
|
-
Unity.CurrentTestFailed = ((_U_UINT)(actual - expected) > (_U_UINT)delta);
|
714
|
-
else
|
715
|
-
Unity.CurrentTestFailed = ((_U_UINT)(expected - actual) > (_U_UINT)delta);
|
716
|
-
}
|
717
|
-
|
718
|
-
if (Unity.CurrentTestFailed)
|
719
|
-
{
|
720
|
-
UnityTestResultsFailBegin(lineNumber);
|
721
|
-
UnityPrint(UnityStrDelta);
|
722
|
-
UnityPrintNumberByStyle(delta, style);
|
723
|
-
UnityPrint(UnityStrExpected);
|
724
|
-
UnityPrintNumberByStyle(expected, style);
|
725
|
-
UnityPrint(UnityStrWas);
|
726
|
-
UnityPrintNumberByStyle(actual, style);
|
727
|
-
UnityAddMsgIfSpecified(msg);
|
728
|
-
UNITY_FAIL_AND_BAIL;
|
729
|
-
}
|
730
|
-
}
|
731
|
-
|
732
|
-
//-----------------------------------------------
|
733
|
-
void UnityAssertEqualString(const char* expected,
|
734
|
-
const char* actual,
|
735
|
-
const char* msg,
|
736
|
-
const UNITY_LINE_TYPE lineNumber)
|
737
|
-
{
|
738
|
-
_UU32 i;
|
739
|
-
|
740
|
-
UNITY_SKIP_EXECUTION;
|
741
|
-
|
742
|
-
// if both pointers not null compare the strings
|
743
|
-
if (expected && actual)
|
744
|
-
{
|
745
|
-
for (i = 0; expected[i] || actual[i]; i++)
|
746
|
-
{
|
747
|
-
if (expected[i] != actual[i])
|
748
|
-
{
|
749
|
-
Unity.CurrentTestFailed = 1;
|
750
|
-
break;
|
751
|
-
}
|
752
|
-
}
|
753
|
-
}
|
754
|
-
else
|
755
|
-
{ // handle case of one pointers being null (if both null, test should pass)
|
756
|
-
if (expected != actual)
|
757
|
-
{
|
758
|
-
Unity.CurrentTestFailed = 1;
|
759
|
-
}
|
760
|
-
}
|
761
|
-
|
762
|
-
if (Unity.CurrentTestFailed)
|
763
|
-
{
|
764
|
-
UnityTestResultsFailBegin(lineNumber);
|
765
|
-
UnityPrintExpectedAndActualStrings(expected, actual);
|
766
|
-
UnityAddMsgIfSpecified(msg);
|
767
|
-
UNITY_FAIL_AND_BAIL;
|
768
|
-
}
|
769
|
-
}
|
770
|
-
|
771
|
-
//-----------------------------------------------
|
772
|
-
void UnityAssertEqualStringArray( const char** expected,
|
773
|
-
const char** actual,
|
774
|
-
const _UU32 num_elements,
|
775
|
-
const char* msg,
|
776
|
-
const UNITY_LINE_TYPE lineNumber)
|
777
|
-
{
|
778
|
-
_UU32 i, j = 0;
|
779
|
-
|
780
|
-
UNITY_SKIP_EXECUTION;
|
781
|
-
|
782
|
-
// if no elements, it's an error
|
783
|
-
if (num_elements == 0)
|
784
|
-
{
|
785
|
-
UnityTestResultsFailBegin(lineNumber);
|
786
|
-
UnityPrint(UnityStrPointless);
|
787
|
-
UnityAddMsgIfSpecified(msg);
|
788
|
-
UNITY_FAIL_AND_BAIL;
|
789
|
-
}
|
790
|
-
|
791
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
792
|
-
return;
|
793
|
-
|
794
|
-
do
|
795
|
-
{
|
796
|
-
// if both pointers not null compare the strings
|
797
|
-
if (expected[j] && actual[j])
|
798
|
-
{
|
799
|
-
for (i = 0; expected[j][i] || actual[j][i]; i++)
|
800
|
-
{
|
801
|
-
if (expected[j][i] != actual[j][i])
|
802
|
-
{
|
803
|
-
Unity.CurrentTestFailed = 1;
|
804
|
-
break;
|
805
|
-
}
|
806
|
-
}
|
807
|
-
}
|
808
|
-
else
|
809
|
-
{ // handle case of one pointers being null (if both null, test should pass)
|
810
|
-
if (expected[j] != actual[j])
|
811
|
-
{
|
812
|
-
Unity.CurrentTestFailed = 1;
|
813
|
-
}
|
814
|
-
}
|
815
|
-
|
816
|
-
if (Unity.CurrentTestFailed)
|
817
|
-
{
|
818
|
-
UnityTestResultsFailBegin(lineNumber);
|
819
|
-
if (num_elements > 1)
|
820
|
-
{
|
821
|
-
UnityPrint(UnityStrElement);
|
822
|
-
UnityPrintNumberByStyle((num_elements - j - 1), UNITY_DISPLAY_STYLE_UINT);
|
823
|
-
}
|
824
|
-
UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j]));
|
825
|
-
UnityAddMsgIfSpecified(msg);
|
826
|
-
UNITY_FAIL_AND_BAIL;
|
827
|
-
}
|
828
|
-
} while (++j < num_elements);
|
829
|
-
}
|
830
|
-
|
831
|
-
//-----------------------------------------------
|
832
|
-
void UnityAssertEqualMemory( const void* expected,
|
833
|
-
const void* actual,
|
834
|
-
const _UU32 length,
|
835
|
-
const _UU32 num_elements,
|
836
|
-
const char* msg,
|
837
|
-
const UNITY_LINE_TYPE lineNumber)
|
838
|
-
{
|
839
|
-
unsigned char* ptr_exp = (unsigned char*)expected;
|
840
|
-
unsigned char* ptr_act = (unsigned char*)actual;
|
841
|
-
_UU32 elements = num_elements;
|
842
|
-
_UU32 bytes;
|
843
|
-
|
844
|
-
UNITY_SKIP_EXECUTION;
|
845
|
-
|
846
|
-
if ((elements == 0) || (length == 0))
|
847
|
-
{
|
848
|
-
UnityTestResultsFailBegin(lineNumber);
|
849
|
-
UnityPrint(UnityStrPointless);
|
850
|
-
UnityAddMsgIfSpecified(msg);
|
851
|
-
UNITY_FAIL_AND_BAIL;
|
852
|
-
}
|
853
|
-
|
854
|
-
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
855
|
-
return;
|
856
|
-
|
857
|
-
while (elements--)
|
858
|
-
{
|
859
|
-
/////////////////////////////////////
|
860
|
-
bytes = length;
|
861
|
-
while (bytes--)
|
862
|
-
{
|
863
|
-
if (*ptr_exp != *ptr_act)
|
864
|
-
{
|
865
|
-
UnityTestResultsFailBegin(lineNumber);
|
866
|
-
UnityPrint(UnityStrMemory);
|
867
|
-
if (num_elements > 1)
|
868
|
-
{
|
869
|
-
UnityPrint(UnityStrElement);
|
870
|
-
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
871
|
-
}
|
872
|
-
UnityPrint(UnityStrByte);
|
873
|
-
UnityPrintNumberByStyle((length - bytes - 1), UNITY_DISPLAY_STYLE_UINT);
|
874
|
-
UnityPrint(UnityStrExpected);
|
875
|
-
UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8);
|
876
|
-
UnityPrint(UnityStrWas);
|
877
|
-
UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8);
|
878
|
-
UnityAddMsgIfSpecified(msg);
|
879
|
-
UNITY_FAIL_AND_BAIL;
|
880
|
-
}
|
881
|
-
ptr_exp += 1;
|
882
|
-
ptr_act += 1;
|
883
|
-
}
|
884
|
-
/////////////////////////////////////
|
885
|
-
|
886
|
-
}
|
887
|
-
}
|
888
|
-
|
889
|
-
//-----------------------------------------------
|
890
|
-
// Control Functions
|
891
|
-
//-----------------------------------------------
|
892
|
-
|
893
|
-
void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
|
894
|
-
{
|
895
|
-
UNITY_SKIP_EXECUTION;
|
896
|
-
|
897
|
-
UnityTestResultsBegin(Unity.TestFile, line);
|
898
|
-
UnityPrintFail();
|
899
|
-
if (msg != NULL)
|
900
|
-
{
|
901
|
-
UNITY_OUTPUT_CHAR(':');
|
902
|
-
if (msg[0] != ' ')
|
903
|
-
{
|
904
|
-
UNITY_OUTPUT_CHAR(' ');
|
905
|
-
}
|
906
|
-
UnityPrint(msg);
|
907
|
-
}
|
908
|
-
UNITY_FAIL_AND_BAIL;
|
909
|
-
}
|
910
|
-
|
911
|
-
//-----------------------------------------------
|
912
|
-
void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
913
|
-
{
|
914
|
-
UNITY_SKIP_EXECUTION;
|
915
|
-
|
916
|
-
UnityTestResultsBegin(Unity.TestFile, line);
|
917
|
-
UnityPrint("IGNORE");
|
918
|
-
if (msg != NULL)
|
919
|
-
{
|
920
|
-
UNITY_OUTPUT_CHAR(':');
|
921
|
-
UNITY_OUTPUT_CHAR(' ');
|
922
|
-
UnityPrint(msg);
|
923
|
-
}
|
924
|
-
UNITY_IGNORE_AND_BAIL;
|
925
|
-
}
|
926
|
-
|
927
|
-
//-----------------------------------------------
|
928
|
-
void setUp(void);
|
929
|
-
void tearDown(void);
|
930
|
-
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
931
|
-
{
|
932
|
-
Unity.CurrentTestName = FuncName;
|
933
|
-
Unity.CurrentTestLineNumber = FuncLineNum;
|
934
|
-
Unity.NumberOfTests++;
|
935
|
-
if (TEST_PROTECT())
|
936
|
-
{
|
937
|
-
setUp();
|
938
|
-
Func();
|
939
|
-
}
|
940
|
-
if (TEST_PROTECT() && !(Unity.CurrentTestIgnored))
|
941
|
-
{
|
942
|
-
tearDown();
|
943
|
-
}
|
944
|
-
UnityConcludeTest();
|
945
|
-
}
|
946
|
-
|
947
|
-
//-----------------------------------------------
|
948
|
-
void UnityBegin(void)
|
949
|
-
{
|
950
|
-
Unity.NumberOfTests = 0;
|
951
|
-
Unity.TestFailures = 0;
|
952
|
-
Unity.TestIgnores = 0;
|
953
|
-
Unity.CurrentTestFailed = 0;
|
954
|
-
Unity.CurrentTestIgnored = 0;
|
955
|
-
}
|
956
|
-
|
957
|
-
//-----------------------------------------------
|
958
|
-
int UnityEnd(void)
|
959
|
-
{
|
960
|
-
UnityPrint("-----------------------");
|
961
|
-
UNITY_PRINT_EOL;
|
962
|
-
UnityPrintNumber(Unity.NumberOfTests);
|
963
|
-
UnityPrint(" Tests ");
|
964
|
-
UnityPrintNumber(Unity.TestFailures);
|
965
|
-
UnityPrint(" Failures ");
|
966
|
-
UnityPrintNumber(Unity.TestIgnores);
|
967
|
-
UnityPrint(" Ignored");
|
968
|
-
UNITY_PRINT_EOL;
|
969
|
-
if (Unity.TestFailures == 0U)
|
970
|
-
{
|
971
|
-
UnityPrintOk();
|
972
|
-
}
|
973
|
-
else
|
974
|
-
{
|
975
|
-
UnityPrintFail();
|
976
|
-
}
|
977
|
-
UNITY_PRINT_EOL;
|
978
|
-
return Unity.TestFailures;
|
979
|
-
}
|