diff --git a/LICENSE.txt b/LICENSE.txt index 3e3aad5b..bd46b907 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2ebf988e..6be02aa5 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Like INT, there are variants for different sizes also. Compares two integers for equality and display errors as hexadecimal. Like the other integer comparisons, you can specify the size... -here the size will also effect how many nibbles are shown (for example, `HEX16` will show 4 nibbles). +here the size will also affect how many nibbles are shown (for example, `HEX16` will show 4 nibbles). TEST_ASSERT_EQUAL(expected, actual) diff --git a/auto/__init__.py b/auto/__init__.py index 15f87c39..6323a252 100644 --- a/auto/__init__.py +++ b/auto/__init__.py @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/colour_prompt.rb b/auto/colour_prompt.rb index 566efe9e..2de38a4b 100644 --- a/auto/colour_prompt.rb +++ b/auto/colour_prompt.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/colour_reporter.rb b/auto/colour_reporter.rb index cac748f8..10a17d37 100644 --- a/auto/colour_reporter.rb +++ b/auto/colour_reporter.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/extract_version.py b/auto/extract_version.py index 7c2f3d30..1494bd52 100755 --- a/auto/extract_version.py +++ b/auto/extract_version.py @@ -2,7 +2,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/generate_config.yml b/auto/generate_config.yml index d1cd9b20..72b06549 100644 --- a/auto/generate_config.yml +++ b/auto/generate_config.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/generate_module.rb b/auto/generate_module.rb index d335cab2..0b5024bd 100644 --- a/auto/generate_module.rb +++ b/auto/generate_module.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 2c2d5956..2b2cf61b 100755 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -1,8 +1,8 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= @@ -47,7 +47,9 @@ def self.default_options use_param_tests: false, use_system_files: true, include_extensions: '(?:hpp|hh|H|h)', - source_extensions: '(?:cpp|cc|ino|C|c)' + source_extensions: '(?:cpp|cc|ino|C|c)', + shuffle_tests: false, + rng_seed: 0 } end @@ -90,6 +92,7 @@ def run(input_file, output_file, options = nil) def generate(input_file, output_file, tests, used_mocks, testfile_includes) File.open(output_file, 'w') do |output| create_header(output, used_mocks, testfile_includes) + create_run_test_params_struct(output) create_externs(output, tests, used_mocks) create_mock_management(output, used_mocks) create_setup(output) @@ -99,6 +102,7 @@ def generate(input_file, output_file, tests, used_mocks, testfile_includes) create_reset(output) create_run_test(output) unless tests.empty? create_args_wrappers(output, tests) + create_shuffle_tests(output) if @options[:shuffle_tests] create_main(output, input_file, tests, used_mocks) end @@ -231,10 +235,34 @@ def find_setup_and_teardown(source) @options[:has_suite_teardown] ||= (source =~ /int\s+suiteTearDown\s*\(int\s+([a-zA-Z0-9_])+\s*\)/) end + def count_tests(tests) + if @options[:use_param_tests] + idx = 0 + tests.each do |test| + if (test[:args].nil? || test[:args].empty?) + idx += 1 + else + test[:args].each do |args| + idx += 1 + end + end + end + return idx + else + return tests.size + end + end + def create_header(output, mocks, testfile_includes = []) output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') output.puts("\n/*=======Automagically Detected Files To Include=====*/") output.puts('extern "C" {') if @options[:externcincludes] + if @options[:shuffle_tests] + output.puts('#include ') + if @options[:rng_seed] == 0 + output.puts('#include ') + end + end output.puts("#include \"#{@options[:framework]}.h\"") output.puts('#include "cmock.h"') unless mocks.empty? output.puts('}') if @options[:externcincludes] @@ -270,6 +298,16 @@ def create_header(output, mocks, testfile_includes = []) output.puts('char* GlobalOrderError;') end + def create_run_test_params_struct(output) + output.puts("\n/*=======Structure Used By Test Runner=====*/") + output.puts('struct UnityRunTestParameters') + output.puts('{') + output.puts(' UnityTestFunction func;') + output.puts(' const char* name;') + output.puts(' UNITY_LINE_TYPE line_num;') + output.puts('};') + end + def create_externs(output, tests, _mocks) output.puts("\n/*=======External Functions This Runner Calls=====*/") output.puts("extern void #{@options[:setup_name]}(void);") @@ -392,6 +430,22 @@ def create_args_wrappers(output, tests) end end + def create_shuffle_tests(output) + output.puts("\n/*=======Shuffle Test Order=====*/") + output.puts('static void shuffleTests(struct UnityRunTestParameters run_test_params_arr[], int num_of_tests)') + output.puts('{') + + # Use Fisher-Yates shuffle algorithm + output.puts(' for (int i = num_of_tests - 1; i > 0; i--)') + output.puts(' {') + output.puts(' int j = rand() % (i + 1);') + output.puts(' struct UnityRunTestParameters temp = run_test_params_arr[i];') + output.puts(' run_test_params_arr[i] = run_test_params_arr[j];') + output.puts(' run_test_params_arr[j] = temp;') + output.puts(' }') + output.puts('}') + end + def create_main(output, filename, tests, used_mocks) output.puts("\n/*=======MAIN=====*/") main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s @@ -439,18 +493,46 @@ def create_main(output, filename, tests, used_mocks) else output.puts(" UnityBegin(\"#{filename.gsub(/\\/, '\\\\\\')}\");") end + if @options[:shuffle_tests] + output.puts + if @options[:rng_seed] == 0 + output.puts(' srand(time(NULL));') + else + output.puts(" srand(#{@options[:rng_seed]});") + end + end + output.puts + output.puts(" int number_of_tests = #{count_tests(tests)};") + output.puts(' struct UnityRunTestParameters run_test_params_arr[number_of_tests];') + output.puts + idx = 0 tests.each do |test| if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? - output.puts(" run_test(#{test[:test]}, \"#{test[:test]}\", #{test[:line_number]});") + output.puts(" run_test_params_arr[#{idx}].func = #{test[:test]};") + output.puts(" run_test_params_arr[#{idx}].name = \"#{test[:test]}\";") + output.puts(" run_test_params_arr[#{idx}].line_num = #{test[:line_number]};") + idx += 1 else - test[:args].each.with_index(1) do |args, idx| - wrapper = "runner_args#{idx}_#{test[:test]}" + test[:args].each.with_index(1) do |args, arg_idx| + wrapper = "runner_args#{arg_idx}_#{test[:test]}" testname = "#{test[:test]}(#{args})".dump - output.puts(" run_test(#{wrapper}, #{testname}, #{test[:line_number]});") + output.puts(" run_test_params_arr[#{idx}].func = #{wrapper};") + output.puts(" run_test_params_arr[#{idx}].name = #{testname};") + output.puts(" run_test_params_arr[#{idx}].line_num = #{test[:line_number]};") + idx += 1 end end end output.puts + if @options[:shuffle_tests] + output.puts(' shuffleTests(run_test_params_arr, number_of_tests);') + output.puts + end + output.puts(' for (int i = 0; i < number_of_tests; i++)') + output.puts(' {') + output.puts(' run_test(run_test_params_arr[i].func, run_test_params_arr[i].name, run_test_params_arr[i].line_num);') + output.puts(' }') + output.puts output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty? if @options[:has_suite_teardown] if @options[:omit_begin_end] @@ -536,7 +618,9 @@ def create_h_file(output, filename, tests, testfile_includes, used_mocks) ' --suite_teardown="" - code to execute for teardown of entire suite', ' --use_param_tests=1 - enable parameterized tests (disabled by default)', ' --omit_begin_end=1 - omit calls to UnityBegin and UNITY_END (disabled by default)', - ' --header_file="" - path/name of test header file to generate too'].join("\n") + ' --header_file="" - path/name of test header file to generate too', + ' --shuffle_tests=1 - enable shuffling of the test execution order (disabled by default)', + ' --rng_seed=1 - seed value for randomization of test execution order'].join("\n") exit 1 end diff --git a/auto/parse_output.rb b/auto/parse_output.rb index 1711337a..3ecc04c8 100644 --- a/auto/parse_output.rb +++ b/auto/parse_output.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/stylize_as_junit.py b/auto/stylize_as_junit.py index 020ec440..24e68321 100644 --- a/auto/stylize_as_junit.py +++ b/auto/stylize_as_junit.py @@ -1,8 +1,8 @@ -#! python3 +#!/usr/bin/env python3 # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/stylize_as_junit.rb b/auto/stylize_as_junit.rb index 23d89a65..9a1edca5 100755 --- a/auto/stylize_as_junit.rb +++ b/auto/stylize_as_junit.rb @@ -1,8 +1,8 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/test_file_filter.rb b/auto/test_file_filter.rb index f9c8d904..7439192a 100644 --- a/auto/test_file_filter.rb +++ b/auto/test_file_filter.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/type_sanitizer.rb b/auto/type_sanitizer.rb index cfadb0dc..dca96be1 100644 --- a/auto/type_sanitizer.rb +++ b/auto/type_sanitizer.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/unity_test_summary.py b/auto/unity_test_summary.py index 43e5af7c..d3c47c6a 100644 --- a/auto/unity_test_summary.py +++ b/auto/unity_test_summary.py @@ -1,8 +1,8 @@ -#! python3 +#!/usr/bin/env python3 # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/auto/unity_test_summary.rb b/auto/unity_test_summary.rb index 33c8d7a3..cfa267b5 100644 --- a/auto/unity_test_summary.rb +++ b/auto/unity_test_summary.rb @@ -1,11 +1,11 @@ +#!/usr/bin/env ruby # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= -# !/usr/bin/ruby # # unity_test_summary.rb # diff --git a/auto/yaml_helper.rb b/auto/yaml_helper.rb index 6d1bf7ae..e11792aa 100644 --- a/auto/yaml_helper.rb +++ b/auto/yaml_helper.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/docs/ThrowTheSwitchCodingStandard.md b/docs/ThrowTheSwitchCodingStandard.md index 517b8fb6..607c456c 100644 --- a/docs/ThrowTheSwitchCodingStandard.md +++ b/docs/ThrowTheSwitchCodingStandard.md @@ -90,7 +90,7 @@ Take a look through the file names in Ceedling and you'll get a good idea of wha Why use preprocess when you can use preprocessinator? Or what better describes a module in charge of invoking tasks during releases than release_invoker? Don't get carried away. -The names are still descriptive and fulfil the above requirements, but they don't feel stale. +The names are still descriptive and fulfill the above requirements, but they don't feel stale. ## C and C++ Details @@ -184,4 +184,4 @@ Good enough? *Find The Latest of This And More at [ThrowTheSwitch.org][]* -[ThrowTheSwitch.org]: https://throwtheswitch.org \ No newline at end of file +[ThrowTheSwitch.org]: https://throwtheswitch.org diff --git a/docs/UnityAssertionsReference.md b/docs/UnityAssertionsReference.md index 0a0e51b6..90a3e5fd 100644 --- a/docs/UnityAssertionsReference.md +++ b/docs/UnityAssertionsReference.md @@ -1,5 +1,35 @@ # Unity Assertions Reference +## Table of Contents + +1. [Background and Overview](#background-and-overview) + 1. [Super Condensed Version](#super-condensed-version) + 2. [Unity Is Several Things But Mainly It’s Assertions](#unity-is-several-things-but-mainly-its-assertions) + 3. [What’s an Assertion?](#whats-an-assertion) + 4. [Unity’s Assertions: Helpful Messages _and_ Free Source Code Documentation](#unitys-assertions-helpful-messages-and-free-source-code-documentation) +2. [Assertion Conventions and Configurations](#assertion-conventions-and-configurations) + 1. [Naming and Parameter Conventions](#naming-and-parameter-conventions) + 2. [TEST_ASSERT_EACH_EQUAL_X Variants](#test_assert_each_equal_x-variants) + 3. [Configuration](#configuration) +3. [The Assertions in All Their Blessed Glory](#the-assertions-in-all-their-blessed-glory) + 1. [Basic Fail, Pass and Ignore](#basic-fail-pass-and-ignore) + 2. [Boolean](#boolean) + 3. [Signed and Unsigned Integers (of all sizes)](#signed-and-unsigned-integers-of-all-sizes) + 4. [Unsigned Integers (of all sizes) in Hexadecimal](#unsigned-integers-of-all-sizes-in-hexadecimal) + 5. [Characters](#characters) + 6. [Masked and Bit-level Assertions](#masked-and-bit-level-assertions) + 7. [Integer Less Than / Greater Than](#integer-less-than--greater-than) + 8. [Integer Ranges (of all sizes)](#integer-ranges-of-all-sizes) + 9. [Structs and Strings](#structs-and-strings) + 10. [Arrays](#arrays) + 11. [Integer Array Ranges (of all sizes)](#integer-array-ranges-of-all-sizes) + 12. [Each Equal (Arrays to Single Value)](#each-equal-arrays-to-single-value) + 13. [Floating Point (If enabled)](#floating-point-if-enabled) + 14. [Double (If enabled)](#double-if-enabled) +4. [Advanced Asserting: Details On Tricky Assertions](#advanced-asserting-details-on-tricky-assertions) + 1. [How do the EQUAL assertions work for FLOAT and DOUBLE?](#how-do-the-equal-assertions-work-for-float-and-double) + 2. [How do we deal with targets with non-standard int sizes?](#how-do-we-deal-with-targets-with-non-standard-int-sizes) + ## Background and Overview ### Super Condensed Version diff --git a/docs/UnityConfigurationGuide.md b/docs/UnityConfigurationGuide.md index 0b735f7a..c2027fcc 100644 --- a/docs/UnityConfigurationGuide.md +++ b/docs/UnityConfigurationGuide.md @@ -33,7 +33,7 @@ In either case, you've got a couple choices for configuring these options: Unfortunately, it doesn't usually work well to just #define these things in the test itself. These defines need to take effect where ever unity.h is included. -This would be test test, the test runner (if you're generating one), and from unity.c when it's compiled. +This would be the test, the test runner (if you're generating one), and from unity.c when it's compiled. ## The Options diff --git a/docs/UnityHelperScriptsGuide.md b/docs/UnityHelperScriptsGuide.md index 90e21939..30841cf9 100644 --- a/docs/UnityHelperScriptsGuide.md +++ b/docs/UnityHelperScriptsGuide.md @@ -94,12 +94,12 @@ UnityTestRunnerGenerator.new.run(testfile, runner_name, options) ``` If you have multiple files to generate in a build script (such as a Rakefile), you might want to instantiate a generator object with your options and call it to generate each runner afterwards. -Like thus: +Like this: ```Ruby gen = UnityTestRunnerGenerator.new(options) test_files.each do |f| - gen.run(f, File.basename(f,'.c')+"Runner.c" + gen.run(f, File.basename(f,'.c')+"Runner.c") end ``` @@ -205,7 +205,7 @@ Few usage examples can be found in `/test/tests/test_unity_parameterized.c` file You should define `UNITY_SUPPORT_TEST_CASES` macro for tests success compiling, if you enable current option. -You can see list of supported macros list in the +You can see a list of supported macros in the [Parameterized tests provided macros](#parameterized-tests-provided-macros) section that follows. @@ -277,13 +277,29 @@ Unity test state setup and cleanup. This option can also be specified at the command prompt as `--omit_begin_end` +##### `:shuffle_tests` + +If `true`, the test execution order will be shuffled. Is `false` by default. + +This option can also be specified at the command prompt as `--shuffle_tests` + +##### `:rng_seed` + +If set to some positive integer value, said value will be used as the seed value passed +to the `srand` function. Otherwise, if not set to any value, `time(NULL)` will be used +as the seed value. + +Only applicable if `:shuffle_tests` is set to `true`. + +This option can also be specified at the command prompt as `--rng_seed` + #### Parameterized tests provided macros Unity provides support for few param tests generators, that can be combined with each other. You must define test function as usual C function with usual C arguments, and test generator will pass what you tell as a list of arguments. -Let's show how all of them works on the following test function definitions: +Let's show how all of them work on the following test function definitions: ```C /* Place your test generators here, usually one generator per one or few lines */ @@ -385,17 +401,17 @@ TEST_CASE(4, 6, 30) Test matix is an advanced generator. It single call can be converted to zero, one or few `TEST_CASE` equivalent commands. -That generator will create tests for all cobinations of the provided list. Each argument has to be given as a list of one or more elements in the format `[, , ..., , ]`. +That generator will create tests for all combinations of the provided list. Each argument has to be given as a list of one or more elements in the format `[, , ..., , ]`. -All parameters supported by the `TEST_CASE` is supported as arguments: +All parameters supported by the `TEST_CASE` are supported as arguments: - Numbers incl type specifiers e.g. `<1>`, `<1u>`, `<1l>`, `<2.3>`, or `<2.3f>` -- Strings incl string concatianion e.g. `<"string">`, or `<"partial" "string">` +- Strings incl string concatenation e.g. `<"string">`, or `<"partial" "string">` - Chars e.g. `<'c'>` - Enums e.g. `` - Elements of arrays e.g. `` -Let's use our `test_demoParamFunction` test for checking, what ranges -will be generated for our single `TEST_RANGE` row: +Let's use our `test_demoParamFunction` test for checking what ranges +will be generated for our single `TEST_MATRIX` row: ```C TEST_MATRIX([3, 4, 7], [10, 8, 2, 1],[30u, 20.0f]) @@ -434,11 +450,11 @@ As we can see: | Parameter | Format | Count of values | |---|---|---| -| `a` | `[3, 4, 7]` | 2 | +| `a` | `[3, 4, 7]` | 3 | | `b` | `[10, 8, 2, 1]` | 4 | | `c` | `[30u, 20.0f]` | 2 | -We totally have 2 * 4 * 2 = 16 equal test cases, that can be written as following: +We totally have 3 * 4 * 2 = 24 equal test cases, that can be written as following: ```C TEST_CASE(3, 10, 30u) @@ -500,7 +516,7 @@ ruby unity_test_summary.rb build/test/ ~/projects/myproject/ Or, if you're more of a Windows sort of person: ```Shell -ruby unity_test_summary.rb build\teat\ C:\projects\myproject\ +ruby unity_test_summary.rb build\test\ C:\projects\myproject\ ``` When configured correctly, you'll see a final summary, like so: diff --git a/examples/example_1/src/ProductionCode.c b/examples/example_1/src/ProductionCode.c index 8a52aff0..9a100330 100644 --- a/examples/example_1/src/ProductionCode.c +++ b/examples/example_1/src/ProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_1/src/ProductionCode.h b/examples/example_1/src/ProductionCode.h index d8929bfb..57ccf41f 100644 --- a/examples/example_1/src/ProductionCode.h +++ b/examples/example_1/src/ProductionCode.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_1/src/ProductionCode2.c b/examples/example_1/src/ProductionCode2.c index ff8a537f..ae72f91c 100644 --- a/examples/example_1/src/ProductionCode2.c +++ b/examples/example_1/src/ProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_1/src/ProductionCode2.h b/examples/example_1/src/ProductionCode2.h index 5204543f..0a0bd76e 100644 --- a/examples/example_1/src/ProductionCode2.h +++ b/examples/example_1/src/ProductionCode2.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_1/test/TestProductionCode.c b/examples/example_1/test/TestProductionCode.c index ceb6d8b5..63e49771 100644 --- a/examples/example_1/test/TestProductionCode.c +++ b/examples/example_1/test/TestProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_1/test/TestProductionCode2.c b/examples/example_1/test/TestProductionCode2.c index 32bbfdf0..62742c9b 100644 --- a/examples/example_1/test/TestProductionCode2.c +++ b/examples/example_1/test/TestProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/src/ProductionCode.c b/examples/example_2/src/ProductionCode.c index b84c4276..841f91af 100644 --- a/examples/example_2/src/ProductionCode.c +++ b/examples/example_2/src/ProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/src/ProductionCode.h b/examples/example_2/src/ProductionCode.h index d8929bfb..57ccf41f 100644 --- a/examples/example_2/src/ProductionCode.h +++ b/examples/example_2/src/ProductionCode.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/src/ProductionCode2.c b/examples/example_2/src/ProductionCode2.c index 80040187..c5c50112 100644 --- a/examples/example_2/src/ProductionCode2.c +++ b/examples/example_2/src/ProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/src/ProductionCode2.h b/examples/example_2/src/ProductionCode2.h index 5204543f..0a0bd76e 100644 --- a/examples/example_2/src/ProductionCode2.h +++ b/examples/example_2/src/ProductionCode2.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/test/TestProductionCode.c b/examples/example_2/test/TestProductionCode.c index 9635f32a..b424e24a 100644 --- a/examples/example_2/test/TestProductionCode.c +++ b/examples/example_2/test/TestProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/test/TestProductionCode2.c b/examples/example_2/test/TestProductionCode2.c index d0233c0a..a43bec4e 100644 --- a/examples/example_2/test/TestProductionCode2.c +++ b/examples/example_2/test/TestProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/test/test_runners/TestProductionCode2_Runner.c b/examples/example_2/test/test_runners/TestProductionCode2_Runner.c index eaa057fd..f40f8357 100644 --- a/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +++ b/examples/example_2/test/test_runners/TestProductionCode2_Runner.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/test/test_runners/TestProductionCode_Runner.c b/examples/example_2/test/test_runners/TestProductionCode_Runner.c index f0acf24f..c50664f2 100644 --- a/examples/example_2/test/test_runners/TestProductionCode_Runner.c +++ b/examples/example_2/test/test_runners/TestProductionCode_Runner.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_2/test/test_runners/all_tests.c b/examples/example_2/test/test_runners/all_tests.c index 5376dbe2..54c4d250 100644 --- a/examples/example_2/test/test_runners/all_tests.c +++ b/examples/example_2/test/test_runners/all_tests.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/helper/UnityHelper.c b/examples/example_3/helper/UnityHelper.c index 17830959..728ddbc9 100644 --- a/examples/example_3/helper/UnityHelper.c +++ b/examples/example_3/helper/UnityHelper.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/helper/UnityHelper.h b/examples/example_3/helper/UnityHelper.h index 6ebf8604..8d3e4b66 100644 --- a/examples/example_3/helper/UnityHelper.h +++ b/examples/example_3/helper/UnityHelper.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/rakefile.rb b/examples/example_3/rakefile.rb index a1eb35a4..ace9eb8d 100644 --- a/examples/example_3/rakefile.rb +++ b/examples/example_3/rakefile.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/examples/example_3/rakefile_helper.rb b/examples/example_3/rakefile_helper.rb index 55885741..be73b185 100644 --- a/examples/example_3/rakefile_helper.rb +++ b/examples/example_3/rakefile_helper.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/examples/example_3/src/ProductionCode.c b/examples/example_3/src/ProductionCode.c index b84c4276..841f91af 100644 --- a/examples/example_3/src/ProductionCode.c +++ b/examples/example_3/src/ProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/src/ProductionCode.h b/examples/example_3/src/ProductionCode.h index d8929bfb..57ccf41f 100644 --- a/examples/example_3/src/ProductionCode.h +++ b/examples/example_3/src/ProductionCode.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/src/ProductionCode2.c b/examples/example_3/src/ProductionCode2.c index 80040187..c5c50112 100644 --- a/examples/example_3/src/ProductionCode2.c +++ b/examples/example_3/src/ProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/src/ProductionCode2.h b/examples/example_3/src/ProductionCode2.h index 5204543f..0a0bd76e 100644 --- a/examples/example_3/src/ProductionCode2.h +++ b/examples/example_3/src/ProductionCode2.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/target_gcc_32.yml b/examples/example_3/target_gcc_32.yml index a3d123d4..b7324d82 100644 --- a/examples/example_3/target_gcc_32.yml +++ b/examples/example_3/target_gcc_32.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/examples/example_3/test/TestProductionCode.c b/examples/example_3/test/TestProductionCode.c index 7f48ea76..654de52d 100644 --- a/examples/example_3/test/TestProductionCode.c +++ b/examples/example_3/test/TestProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_3/test/TestProductionCode2.c b/examples/example_3/test/TestProductionCode2.c index 7ab3926e..32ba6be4 100644 --- a/examples/example_3/test/TestProductionCode2.c +++ b/examples/example_3/test/TestProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_4/src/ProductionCode.c b/examples/example_4/src/ProductionCode.c index 8a52aff0..9a100330 100644 --- a/examples/example_4/src/ProductionCode.c +++ b/examples/example_4/src/ProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_4/src/ProductionCode.h b/examples/example_4/src/ProductionCode.h index d8929bfb..57ccf41f 100644 --- a/examples/example_4/src/ProductionCode.h +++ b/examples/example_4/src/ProductionCode.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_4/src/ProductionCode2.c b/examples/example_4/src/ProductionCode2.c index ff8a537f..ae72f91c 100644 --- a/examples/example_4/src/ProductionCode2.c +++ b/examples/example_4/src/ProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_4/src/ProductionCode2.h b/examples/example_4/src/ProductionCode2.h index 5204543f..0a0bd76e 100644 --- a/examples/example_4/src/ProductionCode2.h +++ b/examples/example_4/src/ProductionCode2.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_4/test/TestProductionCode.c b/examples/example_4/test/TestProductionCode.c index a7cf1449..63b6618e 100644 --- a/examples/example_4/test/TestProductionCode.c +++ b/examples/example_4/test/TestProductionCode.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_4/test/TestProductionCode2.c b/examples/example_4/test/TestProductionCode2.c index 168564e1..5292d960 100644 --- a/examples/example_4/test/TestProductionCode2.c +++ b/examples/example_4/test/TestProductionCode2.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/examples/example_5/makefile b/examples/example_5/makefile new file mode 100644 index 00000000..82d39ad1 --- /dev/null +++ b/examples/example_5/makefile @@ -0,0 +1,63 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + +#We try to detect the OS we are running on, and adjust commands as needed +ifeq ($(OS),Windows_NT) + ifeq ($(shell uname -s),) # not in a bash-like shell + CLEANUP = del /F /Q + MKDIR = mkdir + else # in a bash-like shell, like msys + CLEANUP = rm -f + MKDIR = mkdir -p + endif + TARGET_EXTENSION=.exe +else + CLEANUP = rm -f + MKDIR = mkdir -p + TARGET_EXTENSION=.out +endif + +C_COMPILER=gcc +ifeq ($(shell uname -s), Darwin) +C_COMPILER=clang +endif + +UNITY_ROOT=../.. + +CFLAGS=-std=c89 +CFLAGS += -Wall +CFLAGS += -Wextra +CFLAGS += -Wpointer-arith +CFLAGS += -Wcast-align +CFLAGS += -Wwrite-strings +CFLAGS += -Wswitch-default +CFLAGS += -Wunreachable-code +CFLAGS += -Winit-self +CFLAGS += -Wmissing-field-initializers +CFLAGS += -Wno-unknown-pragmas +CFLAGS += -Wstrict-prototypes +CFLAGS += -Wundef +CFLAGS += -Wold-style-definition +#CFLAGS += -Wno-misleading-indentation + + +TARGET_BASE1=test1 +TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) +SRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c +INC_DIRS=-Isrc -I$(UNITY_ROOT)/src +SYMBOLS=-include"test/unity_detail_config.h" -DUNIT_TESTING + +all: clean default + +default: $(SRC_FILES1) + $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) + - ./$(TARGET1) +clean: + $(CLEANUP) $(TARGET1) $(TARGET2) + +ci: CFLAGS += -Werror +ci: default diff --git a/examples/example_5/readme.txt b/examples/example_5/readme.txt new file mode 100644 index 00000000..c84468eb --- /dev/null +++ b/examples/example_5/readme.txt @@ -0,0 +1,38 @@ +Example 5 +========= + +Demonstrate Details Stack usage to implement something similar to a stacktrace. +This allows locating the error source much faster in branching/iterating code. + +Build and run with Make +--- +Just run `make`. + +Output +--- +Below the output is annotated with source of the elements. + +``` +test/TestProductionCode.c:36:test_BitExtractor:FAIL: Expected 0 Was 1. During call BitExtractor. During call BitExtractor_down. Bit Position 6. Bit Mask 0x02. Unexpected bit value +``` + +| String | Source | +|-----------------------------|---------------------------------------------------------------------------| +| `test/TestProductionCode.c` | `Unity.TestFile` | +| `36` | `UNITY_TEST_ASSERT_EQUAL_INT` line | +| `test_BitExtractor` | `RUN_TEST` name | +| `FAIL` | `UnityStrFail` | +| `Expected 1 Was 0` | `UnityAssertEqualNumber` | +| `During call` | Detail 0, Label | +| `BitExtractor` | Detail 0, Value | +| `During call` | Detail 0, Label | +| `BitExtractor` | Detail 0, Value | +| `During call` | Detail 1, Label | +| `BitExtractor_down` | Detail 1, Value | +| `Bit Position` | Detail 2, Label (literal starts with #\x18, so value is printed as INT32) | +| `6` | Detail 2 Value | +| `Bit Mask` | Detail 2, Label (literal starts with #\x41, so value is printed as HEX8) | +| `0x02` | Detail 2 Value | +| `Unexpected bit value` | `UNITY_TEST_ASSERT_EQUAL_INT` message | + +While this example is a bit contrived, the source of the error can be clearly located to be within the `test_BitExtractor->BitExtractor->BitExtractor_down` diff --git a/examples/example_5/src/ProductionCode.c b/examples/example_5/src/ProductionCode.c new file mode 100644 index 00000000..7120adc4 --- /dev/null +++ b/examples/example_5/src/ProductionCode.c @@ -0,0 +1,56 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + +#include "ProductionCode.h" + +#include + +#ifdef UNIT_TESTING +#include "unity.h" +#else +/* No-Op when not testing */ +#define UNITY_DETAIL_PUSH +#define UNITY_DETAIL_POP +#endif + +static void BitExtractor_up(uint8_t input, callback_t cb) +{ + int32_t pos; + UNITY_DETAIL_PUSH(UNITY_DETAIL_CALL, __FUNCTION__); + for(pos=0; pos<8; pos++) { + UNITY_DETAIL_PUSH(UNITY_DETAIL_BIT_POS, pos); + UNITY_DETAIL_PUSH(UNITY_DETAIL_BIT_MASK, 1<>pos); + cb(pos, !!(input & (0x80>>pos))); + UNITY_DETAIL_POP(UNITY_DETAIL_BIT_MASK, 0x80>>pos); + UNITY_DETAIL_POP(UNITY_DETAIL_BIT_POS, pos); + } + UNITY_DETAIL_POP(UNITY_DETAIL_CALL, __FUNCTION__); +} +void BitExtractor(bit_direction_t dir, uint8_t input, callback_t cb) +{ + UNITY_DETAIL_PUSH(UNITY_DETAIL_CALL, __FUNCTION__); + if(dir == BIT_DIRECTION_UP) { + BitExtractor_up(input, cb); + } else { + BitExtractor_down(input, cb); + } + UNITY_DETAIL_POP(UNITY_DETAIL_CALL, __FUNCTION__); +} diff --git a/examples/example_5/src/ProductionCode.h b/examples/example_5/src/ProductionCode.h new file mode 100644 index 00000000..7e143587 --- /dev/null +++ b/examples/example_5/src/ProductionCode.h @@ -0,0 +1,16 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + +#include + +typedef void callback_t(int position, int bit_value); +typedef enum { + BIT_DIRECTION_UP, + BIT_DIRECTION_DOWN, +} bit_direction_t; + +void BitExtractor(bit_direction_t dir, uint8_t input, callback_t cb); diff --git a/examples/example_5/subprojects/unity.wrap b/examples/example_5/subprojects/unity.wrap new file mode 100644 index 00000000..6df241bd --- /dev/null +++ b/examples/example_5/subprojects/unity.wrap @@ -0,0 +1,3 @@ +[wrap-git] +url = https://github.com/ThrowTheSwitch/Unity.git +revision = head diff --git a/examples/example_5/test/TestProductionCode.c b/examples/example_5/test/TestProductionCode.c new file mode 100644 index 00000000..ec4cbed3 --- /dev/null +++ b/examples/example_5/test/TestProductionCode.c @@ -0,0 +1,45 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + +#include "ProductionCode.h" +#include "unity.h" + +const int* current_expected_bits = NULL; +UNITY_LINE_TYPE current_vector_line = 0; +typedef struct { + UNITY_LINE_TYPE line; + uint8_t value; + bit_direction_t dir; + int expected_bits[8]; +} test_vector_t; + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +static void be_bit_tester(int position, int value) { + UNITY_TEST_ASSERT_EQUAL_INT(current_expected_bits[position], value, current_vector_line, "Unexpected bit value"); +} + +void test_BitExtractor(void) +{ + const test_vector_t test_vectors[] = { + {__LINE__, 7, BIT_DIRECTION_UP, {1,1,1,0,0,0,0,0}}, + {__LINE__, 7, BIT_DIRECTION_DOWN, {0,0,0,0,0,1,0,1}}, /* intentionally wrong to demonstrate detail output */ + {0} + }; + const test_vector_t* tv; + for (tv = test_vectors; tv->line; tv++) { + current_vector_line = tv->line; + current_expected_bits = tv->expected_bits; + BitExtractor(tv->dir, tv->value, be_bit_tester); + } +} diff --git a/examples/example_5/test/test_runners/TestProductionCode_Runner.c b/examples/example_5/test/test_runners/TestProductionCode_Runner.c new file mode 100644 index 00000000..564eea31 --- /dev/null +++ b/examples/example_5/test/test_runners/TestProductionCode_Runner.c @@ -0,0 +1,48 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +/*=======Test Runner Used To Run Each Test Below=====*/ +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT()) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +/*=======Automagically Detected Files To Include=====*/ +#include "unity.h" +#include +#include +#include "ProductionCode.h" + +/*=======External Functions This Runner Calls=====*/ +extern void setUp(void); +extern void tearDown(void); +extern void test_BitExtractor(void); + + +/*=======Test Reset Option=====*/ +void resetTest(void); +void resetTest(void) +{ + tearDown(); + setUp(); +} + + +/*=======MAIN=====*/ +int main(void) +{ + UnityBegin("test/TestProductionCode.c"); + RUN_TEST(test_BitExtractor, 32); + return UNITY_END(); +} diff --git a/examples/example_5/test/unity_detail_config.h b/examples/example_5/test/unity_detail_config.h new file mode 100644 index 00000000..1680da5c --- /dev/null +++ b/examples/example_5/test/unity_detail_config.h @@ -0,0 +1,25 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + +#define UNITY_DETAIL_STACK_SIZE 5 +#define LABEL_AS_INT32 "#\x18" /*UNITY_DISPLAY_STYLE_INT32 = 0x18 */ +#define LABEL_AS_HEX8 "#\x41" /* UNITY_DISPLAY_STYLE_HEX8 = 0x41 */ +#define UNITY_DETAIL_LABEL_NAMES { 0, \ + UNITY_DETAIL1_NAME, \ + UNITY_DETAIL2_NAME, \ + "During call", \ + LABEL_AS_INT32 "Bit Position", \ + LABEL_AS_HEX8 "Bit Mask", \ +} +typedef enum { + UNITY_DETAIL_NONE = 0, + UNITY_DETAIL_D1 = 1, + UNITY_DETAIL_D2 = 2, + UNITY_DETAIL_CALL, + UNITY_DETAIL_BIT_POS, + UNITY_DETAIL_BIT_MASK, +} UNITY_DETAIL_LABEL_T; diff --git a/examples/unity_config.h b/examples/unity_config.h index efd91232..c79dd5a9 100644 --- a/examples/unity_config.h +++ b/examples/unity_config.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/bdd/src/unity_bdd.h b/extras/bdd/src/unity_bdd.h index feff492c..41ee2adf 100644 --- a/extras/bdd/src/unity_bdd.h +++ b/extras/bdd/src/unity_bdd.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/bdd/test/test_bdd.c b/extras/bdd/test/test_bdd.c index f86e5abd..be51324d 100644 --- a/extras/bdd/test/test_bdd.c +++ b/extras/bdd/test/test_bdd.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/src/unity_fixture.c b/extras/fixture/src/unity_fixture.c index cd0df2ca..a89677ed 100644 --- a/extras/fixture/src/unity_fixture.c +++ b/extras/fixture/src/unity_fixture.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/src/unity_fixture.h b/extras/fixture/src/unity_fixture.h index ed6ff482..fa2fc5be 100644 --- a/extras/fixture/src/unity_fixture.h +++ b/extras/fixture/src/unity_fixture.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/src/unity_fixture_internals.h b/extras/fixture/src/unity_fixture_internals.h index 6a552c1f..b2aff1f6 100644 --- a/extras/fixture/src/unity_fixture_internals.h +++ b/extras/fixture/src/unity_fixture_internals.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/test/main/AllTests.c b/extras/fixture/test/main/AllTests.c index d5eec4be..caa3c7ec 100644 --- a/extras/fixture/test/main/AllTests.c +++ b/extras/fixture/test/main/AllTests.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/test/template_fixture_tests.c b/extras/fixture/test/template_fixture_tests.c index 2397f105..1b1c9ec6 100644 --- a/extras/fixture/test/template_fixture_tests.c +++ b/extras/fixture/test/template_fixture_tests.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/test/unity_fixture_Test.c b/extras/fixture/test/unity_fixture_Test.c index f5103ff1..b894d4c0 100644 --- a/extras/fixture/test/unity_fixture_Test.c +++ b/extras/fixture/test/unity_fixture_Test.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/fixture/test/unity_fixture_TestRunner.c b/extras/fixture/test/unity_fixture_TestRunner.c index 07099d36..cecdcc09 100644 --- a/extras/fixture/test/unity_fixture_TestRunner.c +++ b/extras/fixture/test/unity_fixture_TestRunner.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/memory/src/unity_memory.c b/extras/memory/src/unity_memory.c index e9eaae35..c71f77f8 100644 --- a/extras/memory/src/unity_memory.c +++ b/extras/memory/src/unity_memory.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/memory/src/unity_memory.h b/extras/memory/src/unity_memory.h index 70a7f25f..7351be35 100644 --- a/extras/memory/src/unity_memory.h +++ b/extras/memory/src/unity_memory.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/memory/test/unity_memory_Test.c b/extras/memory/test/unity_memory_Test.c index b66e6deb..1e654101 100644 --- a/extras/memory/test/unity_memory_Test.c +++ b/extras/memory/test/unity_memory_Test.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/memory/test/unity_memory_TestRunner.c b/extras/memory/test/unity_memory_TestRunner.c index 0a8ed3da..9fe2ead1 100644 --- a/extras/memory/test/unity_memory_TestRunner.c +++ b/extras/memory/test/unity_memory_TestRunner.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/memory/test/unity_output_Spy.c b/extras/memory/test/unity_output_Spy.c index 044c5def..e5b6db0f 100644 --- a/extras/memory/test/unity_output_Spy.c +++ b/extras/memory/test/unity_output_Spy.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/extras/memory/test/unity_output_Spy.h b/extras/memory/test/unity_output_Spy.h index 3c2e9b97..8c2dd315 100644 --- a/extras/memory/test/unity_output_Spy.h +++ b/extras/memory/test/unity_output_Spy.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/meson.build b/meson.build index 6585129c..f510d857 100644 --- a/meson.build +++ b/meson.build @@ -26,6 +26,7 @@ project('unity', 'c', build_fixture = get_option('extension_fixture') build_memory = get_option('extension_memory') support_double = get_option('support_double') +fixture_help_message = get_option('fixture_help_message') unity_args = [] unity_src = [] @@ -34,14 +35,16 @@ unity_inc = [] subdir('src') if build_fixture - # Building the fixture extension implies building the memory - # extension. - build_memory = true subdir('extras/fixture/src') + if fixture_help_message != '' + unity_args += '-DUNITY_CUSTOM_HELP_MSG=' + fixture_help_message + endif endif -if build_memory +if build_memory.enabled() or (build_memory.auto() and build_fixture) subdir('extras/memory/src') +else + unity_args += '-DUNITY_FIXTURE_NO_EXTRAS' endif if support_double @@ -64,10 +67,10 @@ unity_dep = declare_dependency( if not meson.is_subproject() pkg = import('pkgconfig') pkg.generate( - name: meson.project_name(), + unity_lib, version: meson.project_version(), - libraries: [ unity_lib ], - description: 'C Unit testing framework.' + subdirs: 'unity', + extra_cflags: unity_args, ) endif diff --git a/meson_options.txt b/meson_options.txt index 8e66784b..264480cf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ -option('extension_fixture', type: 'boolean', value: 'false', description: 'Whether to enable the fixture extension.') -option('extension_memory', type: 'boolean', value: 'false', description: 'Whether to enable the memory extension.') -option('support_double', type: 'boolean', value: 'false', description: 'Whether to enable double precision floating point assertions.') +option('extension_fixture', type: 'boolean', value: false, description: 'Whether to enable the fixture extension.') +option('extension_memory', type: 'feature', value: 'auto', description: 'Whether to enable the memory extension. By default this is automatically enabled when extension_fixture is enabled.') +option('support_double', type: 'boolean', value: false, description: 'Whether to enable double precision floating point assertions.') +option('fixture_help_message', type: 'string', description: 'If the fixture extension is enabled, this allows a custom help message to be defined.') diff --git a/src/unity.c b/src/unity.c index 7fa2dc63..4b1aea6c 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -61,14 +61,24 @@ const char UNITY_PROGMEM UnityStrErrShorthand[] = "Unity Shorth const char UNITY_PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled"; const char UNITY_PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled"; const char UNITY_PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled"; +const char UNITY_PROGMEM UnityStrErrDetailStack[] = "Unity Detail Stack Support Disabled"; static const char UNITY_PROGMEM UnityStrBreaker[] = "-----------------------"; static const char UNITY_PROGMEM UnityStrResultsTests[] = " Tests "; static const char UNITY_PROGMEM UnityStrResultsFailures[] = " Failures "; static const char UNITY_PROGMEM UnityStrResultsIgnored[] = " Ignored "; #ifndef UNITY_EXCLUDE_DETAILS +#ifdef UNITY_DETAIL_STACK_SIZE +static const char* UNITY_PROGMEM UnityStrDetailLabels[] = UNITY_DETAIL_LABEL_NAMES; +static const UNITY_COUNTER_TYPE UNITY_PROGMEM UnityStrDetailLabelsCount = sizeof(UnityStrDetailLabels) / sizeof(const char*); +static const char UNITY_PROGMEM UnityStrErrDetailStackEmpty[] = " Detail Stack Empty"; +static const char UNITY_PROGMEM UnityStrErrDetailStackFull[] = " Detail Stack Full"; +static const char UNITY_PROGMEM UnityStrErrDetailStackLabel[] = " Detail Label Outside Of UNITY_DETAIL_LABEL_NAMES: "; +static const char UNITY_PROGMEM UnityStrErrDetailStackPop[] = " Detail Pop With Unexpected Arguments"; +#else static const char UNITY_PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " "; static const char UNITY_PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " "; #endif +#endif /*----------------------------------------------- * Pretty Printers & Test Result Output Handlers *-----------------------------------------------*/ @@ -185,7 +195,7 @@ void UnityPrintLen(const char* string, const UNITY_UINT32 length) } /*-----------------------------------------------*/ -void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style) +void UnityPrintIntNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style) { if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { @@ -223,9 +233,13 @@ void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T UnityPrintNumber(number); } } - else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) +} + +void UnityPrintUintNumberByStyle(const UNITY_UINT number, const UNITY_DISPLAY_STYLE_T style) +{ + if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) { - UnityPrintNumberUnsigned((UNITY_UINT)number); + UnityPrintNumberUnsigned(number); } else { @@ -574,6 +588,32 @@ static void UnityAddMsgIfSpecified(const char* msg) UNITY_PRINT_TEST_CONTEXT(); #endif #ifndef UNITY_EXCLUDE_DETAILS +#ifdef UNITY_DETAIL_STACK_SIZE + { + UNITY_COUNTER_TYPE c; + for (c = 0; (c < Unity.CurrentDetailStackSize) && (c < UNITY_DETAIL_STACK_SIZE); c++) { + const char* label; + if ((Unity.CurrentDetailStackLabels[c] == UNITY_DETAIL_NONE) || (Unity.CurrentDetailStackLabels[c] > UnityStrDetailLabelsCount)) { + break; + } + label = UnityStrDetailLabels[Unity.CurrentDetailStackLabels[c]]; + UnityPrint(UnityStrSpacer); + if ((label[0] == '#') && (label[1] != 0)) { + UnityPrint(label + 2); + UNITY_OUTPUT_CHAR(' '); + if ((label[1] & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { + UnityPrintIntNumberByStyle((UNITY_INT)Unity.CurrentDetailStackValues[c], label[1]); + } else { + UnityPrintUintNumberByStyle((UNITY_UINT)Unity.CurrentDetailStackValues[c], label[1]); + } + } else if (Unity.CurrentDetailStackValues[c] != 0){ + UnityPrint(label); + UNITY_OUTPUT_CHAR(' '); + UnityPrint((const char*)Unity.CurrentDetailStackValues[c]); + } + } + } +#else if (Unity.CurrentDetail1) { UnityPrint(UnityStrSpacer); @@ -585,6 +625,7 @@ static void UnityAddMsgIfSpecified(const char* msg) UnityPrint(Unity.CurrentDetail2); } } +#endif #endif if (msg) { @@ -709,11 +750,11 @@ void UnityAssertBits(const UNITY_INT mask, } /*-----------------------------------------------*/ -void UnityAssertEqualNumber(const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) +void UnityAssertEqualIntNumber(const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) { RETURN_IF_FAIL_OR_IGNORE; @@ -721,49 +762,90 @@ void UnityAssertEqualNumber(const UNITY_INT expected, { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); + UnityPrintIntNumberByStyle(expected, style); UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); + UnityPrintIntNumberByStyle(actual, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } +void UnityAssertEqualUintNumber(const UNITY_UINT expected, + const UNITY_UINT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) +{ + RETURN_IF_FAIL_OR_IGNORE; + + if (expected != actual) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + UnityPrintUintNumberByStyle(expected, style); + UnityPrint(UnityStrWas); + UnityPrintUintNumberByStyle(actual, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} /*-----------------------------------------------*/ -void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, - const UNITY_INT actual, - const UNITY_COMPARISON_T compare, - const char *msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) +void UnityAssertIntGreaterOrLessOrEqualNumber(const UNITY_INT threshold, + const UNITY_INT actual, + const UNITY_COMPARISON_T compare, + const char *msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) { int failed = 0; RETURN_IF_FAIL_OR_IGNORE; - if ((threshold == actual) && (compare & UNITY_EQUAL_TO)) { return; } - if ((threshold == actual)) { failed = 1; } + if ((threshold == actual) && !(compare & UNITY_EQUAL_TO)) { failed = 1; } - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } - if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } - } - else /* UINT or HEX */ + if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } + if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } + + if (failed) { - if (((UNITY_UINT)actual > (UNITY_UINT)threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } - if (((UNITY_UINT)actual < (UNITY_UINT)threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrExpected); + UnityPrintIntNumberByStyle(actual, style); + if (compare & UNITY_GREATER_THAN) { UnityPrint(UnityStrGt); } + if (compare & UNITY_SMALLER_THAN) { UnityPrint(UnityStrLt); } + if (compare & UNITY_EQUAL_TO) { UnityPrint(UnityStrOrEqual); } + if (compare == UNITY_NOT_EQUAL) { UnityPrint(UnityStrNotEqual); } + UnityPrintIntNumberByStyle(threshold, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; } +} + +void UnityAssertUintGreaterOrLessOrEqualNumber(const UNITY_UINT threshold, + const UNITY_UINT actual, + const UNITY_COMPARISON_T compare, + const char *msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) +{ + int failed = 0; + RETURN_IF_FAIL_OR_IGNORE; + + if ((threshold == actual) && !(compare & UNITY_EQUAL_TO)) { failed = 1; } + + /* UINT or HEX */ + if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } + if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } if (failed) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(actual, style); + UnityPrintUintNumberByStyle(actual, style); if (compare & UNITY_GREATER_THAN) { UnityPrint(UnityStrGt); } if (compare & UNITY_SMALLER_THAN) { UnityPrint(UnityStrLt); } if (compare & UNITY_EQUAL_TO) { UnityPrint(UnityStrOrEqual); } if (compare == UNITY_NOT_EQUAL) { UnityPrint(UnityStrNotEqual); } - UnityPrintNumberByStyle(threshold, style); + UnityPrintUintNumberByStyle(threshold, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } @@ -877,9 +959,9 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expect_val, style); + UnityPrintIntNumberByStyle(expect_val, style); UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual_val, style); + UnityPrintIntNumberByStyle(actual_val, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } @@ -1028,6 +1110,7 @@ void UnityAssertFloatsWithin(const UNITY_FLOAT delta, } } +#ifndef UNITY_EXCLUDE_FLOAT_PRINT /*-----------------------------------------------*/ void UnityAssertFloatsNotWithin(const UNITY_FLOAT delta, const UNITY_FLOAT expected, @@ -1081,6 +1164,7 @@ void UnityAssertGreaterOrLessFloat(const UNITY_FLOAT threshold, UNITY_FAIL_AND_BAIL; } } +#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ /*-----------------------------------------------*/ void UnityAssertFloatSpecial(const UNITY_FLOAT actual, @@ -1255,6 +1339,7 @@ void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, } } +#ifndef UNITY_EXCLUDE_FLOAT_PRINT /*-----------------------------------------------*/ void UnityAssertDoublesNotWithin(const UNITY_DOUBLE delta, const UNITY_DOUBLE expected, @@ -1308,6 +1393,7 @@ void UnityAssertGreaterOrLessDouble(const UNITY_DOUBLE threshold, UNITY_FAIL_AND_BAIL; } } +#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ /*-----------------------------------------------*/ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, @@ -1377,47 +1463,65 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, #endif /* not UNITY_EXCLUDE_DOUBLE */ /*-----------------------------------------------*/ -void UnityAssertNumbersWithin(const UNITY_UINT delta, - const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) +void UnityAssertIntNumbersWithin(const UNITY_UINT delta, + const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) { RETURN_IF_FAIL_OR_IGNORE; - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) + if (actual > expected) { - if (actual > expected) - { - Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); - } - else - { - Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); - } + Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); } else { - if ((UNITY_UINT)actual > (UNITY_UINT)expected) - { - Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); - } - else - { - Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); - } + Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrDelta); - UnityPrintNumberByStyle((UNITY_INT)delta, style); + UnityPrintIntNumberByStyle((UNITY_INT)delta, style); UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); + UnityPrintIntNumberByStyle(expected, style); UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); + UnityPrintIntNumberByStyle(actual, style); + UnityAddMsgIfSpecified(msg); + UNITY_FAIL_AND_BAIL; + } +} + +void UnityAssertUintNumbersWithin(const UNITY_UINT delta, + const UNITY_UINT expected, + const UNITY_UINT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style) +{ + RETURN_IF_FAIL_OR_IGNORE; + + if (actual > expected) + { + Unity.CurrentTestFailed = ((actual - expected) > delta); + } + else + { + Unity.CurrentTestFailed = ((expected - actual) > delta); + } + + if (Unity.CurrentTestFailed) + { + UnityTestResultsFailBegin(lineNumber); + UnityPrint(UnityStrDelta); + UnityPrintUintNumberByStyle(delta, style); + UnityPrint(UnityStrExpected); + UnityPrintUintNumberByStyle(expected, style); + UnityPrint(UnityStrWas); + UnityPrintUintNumberByStyle(actual, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } @@ -1568,13 +1672,13 @@ void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, } UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrDelta); - UnityPrintNumberByStyle((UNITY_INT)delta, style); + UnityPrintIntNumberByStyle((UNITY_INT)delta, style); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expect_val, style); + UnityPrintIntNumberByStyle(expect_val, style); UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual_val, style); + UnityPrintIntNumberByStyle(actual_val, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } @@ -1805,9 +1909,9 @@ void UnityAssertEqualMemory(UNITY_INTERNAL_PTR expected, UnityPrint(UnityStrByte); UnityPrintNumberUnsigned(length - bytes - 1); UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); + UnityPrintIntNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); + UnityPrintIntNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } @@ -1937,7 +2041,7 @@ static enum UnityLengthModifier UnityLengthModifierGet(const char *pch, int *len } case 'h': { - // short and char are converted to int + /* short and char are converted to int */ length_mod = UNITY_LENGTH_MODIFIER_NONE; if (pch[1] == 'h') { @@ -1954,7 +2058,7 @@ static enum UnityLengthModifier UnityLengthModifierGet(const char *pch, int *len case 't': case 'L': { - // Not supported, but should gobble up the length specifier anyway + /* Not supported, but should gobble up the length specifier anyway */ length_mod = UNITY_LENGTH_MODIFIER_NONE; *length = 1; break; @@ -2127,32 +2231,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line) UnityTestResultsBegin(Unity.TestFile, line); UnityPrint(UnityStrFail); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - -#ifdef UNITY_PRINT_TEST_CONTEXT - UNITY_PRINT_TEST_CONTEXT(); -#endif -#ifndef UNITY_EXCLUDE_DETAILS - if (Unity.CurrentDetail1) - { - UnityPrint(UnityStrDetail1Name); - UnityPrint(Unity.CurrentDetail1); - if (Unity.CurrentDetail2) - { - UnityPrint(UnityStrDetail2Name); - UnityPrint(Unity.CurrentDetail2); - } - UnityPrint(UnityStrSpacer); - } -#endif - if (msg[0] != ' ') - { - UNITY_OUTPUT_CHAR(' '); - } - UnityPrint(msg); - } + UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } @@ -2195,7 +2274,13 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int Unity.CurrentTestName = FuncName; Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; Unity.NumberOfTests++; + #ifndef UNITY_EXCLUDE_DETAILS + #ifdef UNITY_DETAIL_STACK_SIZE + Unity.CurrentDetailStackSize = 0; + #else UNITY_CLR_DETAILS(); + #endif + #endif UNITY_EXEC_TIME_START(); if (TEST_PROTECT()) { @@ -2263,6 +2348,46 @@ int UnityEnd(void) return (int)(Unity.TestFailures); } +/*----------------------------------------------- + * Details Stack + *-----------------------------------------------*/ +#ifndef UNITY_EXCLUDE_DETAILS +#ifdef UNITY_DETAIL_STACK_SIZE +void UnityPushDetail(UNITY_DETAIL_LABEL_TYPE label, UNITY_DETAIL_VALUE_TYPE value, const UNITY_LINE_TYPE line) { + if (Unity.CurrentDetailStackSize >= UNITY_DETAIL_STACK_SIZE) { + UnityTestResultsFailBegin(line); + UnityPrint(UnityStrErrDetailStackFull); + UnityAddMsgIfSpecified(NULL); + UNITY_FAIL_AND_BAIL; + } + if (label >= UnityStrDetailLabelsCount) { + UnityTestResultsFailBegin(line); + UnityPrint(UnityStrErrDetailStackLabel); + UnityPrintNumberUnsigned(label); + UnityAddMsgIfSpecified(NULL); + UNITY_FAIL_AND_BAIL; + } + Unity.CurrentDetailStackLabels[Unity.CurrentDetailStackSize] = label; + Unity.CurrentDetailStackValues[Unity.CurrentDetailStackSize++] = value; +} +void UnityPopDetail(UNITY_DETAIL_LABEL_TYPE label, UNITY_DETAIL_VALUE_TYPE value, const UNITY_LINE_TYPE line) { + if (Unity.CurrentDetailStackSize == 0) { + UnityTestResultsFailBegin(line); + UnityPrint(UnityStrErrDetailStackEmpty); + UnityAddMsgIfSpecified(NULL); + UNITY_FAIL_AND_BAIL; + } + if ((Unity.CurrentDetailStackLabels[Unity.CurrentDetailStackSize-1] != label) || (Unity.CurrentDetailStackValues[Unity.CurrentDetailStackSize-1] != value)) { + UnityTestResultsFailBegin(line); + UnityPrint(UnityStrErrDetailStackPop); + UnityAddMsgIfSpecified(NULL); + UNITY_FAIL_AND_BAIL; + } + Unity.CurrentDetailStackSize--; +} +#endif +#endif + /*----------------------------------------------- * Command Line Argument Support *-----------------------------------------------*/ @@ -2394,7 +2519,7 @@ static int IsStringInBiggerString(const char* longstring, const char* shortstrin } } - // If we didn't match and we're on strict matching, we already know we failed + /* If we didn't match and we're on strict matching, we already know we failed */ if (UnityStrictMatch) { return 0; diff --git a/src/unity.h b/src/unity.h index 9e2a97b7..63109130 100644 --- a/src/unity.h +++ b/src/unity.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -11,7 +11,7 @@ #define UNITY_VERSION_MAJOR 2 #define UNITY_VERSION_MINOR 6 -#define UNITY_VERSION_BUILD 1 +#define UNITY_VERSION_BUILD 2 #define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD) #ifdef __cplusplus @@ -45,7 +45,7 @@ int suiteTearDown(int num_failures); * Test Reset and Verify *-------------------------------------------------------*/ -/* These functions are intended to be called before during tests in order +/* These functions are intended to be called before or during tests in order * to support complex test loops, etc. Both are NOT built into Unity. Instead * the test runner generator will create them. resetTest will run teardown and * setup again, verifying any end-of-test needs between. verifyTest will only diff --git a/src/unity_internals.h b/src/unity_internals.h index 562f5b6d..da17059f 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -87,6 +87,13 @@ /* Since C23, the keyword _Noreturn has been replaced by the attribute noreturn, based on: */ /* https://en.cppreference.com/w/c/language/attributes/noreturn */ #define UNITY_NORETURN [[ noreturn ]] + #elif defined(__IAR_SYSTEMS_ICC__) && (__IAR_SYSTEMS_ICC__ >= 8) + /* For IAR compilers supporting at least C99 use the IAR specific '__noreturn' keyword */ + /* Based on tests and: */ + /* https://wwwfiles.iar.com/arm/webic/doc/EWARM_DevelopmentGuide.ENU.pdf */ + /* https://wwwfiles.iar.com/AVR/webic/doc/EWAVR_CompilerGuide.pdf */ + /* https://wwwfiles.iar.com/msp430/webic/doc/EW430_CompilerReference.pdf */ + #define UNITY_NORETURN __noreturn #endif #endif #ifndef UNITY_NORETURN @@ -480,14 +487,12 @@ typedef enum typedef enum { - UNITY_WITHIN = 0x0, UNITY_EQUAL_TO = 0x1, UNITY_GREATER_THAN = 0x2, UNITY_GREATER_OR_EQUAL = 0x2 + UNITY_EQUAL_TO, UNITY_SMALLER_THAN = 0x4, UNITY_SMALLER_OR_EQUAL = 0x4 + UNITY_EQUAL_TO, - UNITY_NOT_EQUAL = 0x0, - UNITY_UNKNOWN + UNITY_NOT_EQUAL = 0x8 } UNITY_COMPARISON_T; #ifndef UNITY_EXCLUDE_FLOAT @@ -512,13 +517,30 @@ typedef enum UNITY_ARRAY_UNKNOWN } UNITY_FLAGS_T; +#ifndef UNITY_EXCLUDE_DETAILS +#ifdef UNITY_DETAIL_STACK_SIZE +#ifndef UNITY_DETAIL_LABEL_TYPE +#define UNITY_DETAIL_LABEL_TYPE uint8_t +#endif +#ifndef UNITY_DETAIL_VALUE_TYPE +#define UNITY_DETAIL_VALUE_TYPE UNITY_PTR_TO_INT +#endif +#endif +#endif + struct UNITY_STORAGE_T { const char* TestFile; const char* CurrentTestName; #ifndef UNITY_EXCLUDE_DETAILS +#ifdef UNITY_DETAIL_STACK_SIZE + UNITY_DETAIL_LABEL_TYPE CurrentDetailStackLabels[UNITY_DETAIL_STACK_SIZE]; + UNITY_DETAIL_VALUE_TYPE CurrentDetailStackValues[UNITY_DETAIL_STACK_SIZE]; + UNITY_COUNTER_TYPE CurrentDetailStackSize; +#else const char* CurrentDetail1; const char* CurrentDetail2; +#endif #endif UNITY_LINE_TYPE CurrentTestLineNumber; UNITY_COUNTER_TYPE NumberOfTests; @@ -561,10 +583,6 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int #define UNITY_SET_DETAIL(d1) #define UNITY_SET_DETAILS(d1,d2) #else -#define UNITY_CLR_DETAILS() do { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; } while (0) -#define UNITY_SET_DETAIL(d1) do { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = 0; } while (0) -#define UNITY_SET_DETAILS(d1,d2) do { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = (d2); } while (0) - #ifndef UNITY_DETAIL1_NAME #define UNITY_DETAIL1_NAME "Function" #endif @@ -572,6 +590,47 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int #ifndef UNITY_DETAIL2_NAME #define UNITY_DETAIL2_NAME "Argument" #endif + +#ifdef UNITY_DETAIL_STACK_SIZE +/* stack based implementation */ +#ifndef UNITY_DETAIL_LABEL_NAMES +/* Note: If the label name string starts with '#', the second byte is interpreted as UNITY_DISPLAY_STYLE_T, + * and the detail value will be printed as number (e.g. "#\x24Line" to output "Line "). + * Otherwise, the detail value must be a pointer to a string that is valid until it is pop'ed. + */ +#define UNITY_DETAIL_LABEL_NAMES {0, UNITY_DETAIL1_NAME, UNITY_DETAIL2_NAME} +typedef enum +{ + UNITY_DETAIL_NONE = 0, + UNITY_DETAIL_D1 = 1, + UNITY_DETAIL_D2 = 2 +} UNITY_DETAIL_LABEL_T; +#endif +void UnityPushDetail(UNITY_DETAIL_LABEL_TYPE label, UNITY_DETAIL_VALUE_TYPE value, const UNITY_LINE_TYPE line); +void UnityPopDetail(UNITY_DETAIL_LABEL_TYPE label, UNITY_DETAIL_VALUE_TYPE value, const UNITY_LINE_TYPE line); + +#define UNITY_CLR_DETAILS() do { \ + if(Unity.CurrentDetailStackSize && \ + Unity.CurrentDetailStackLabels[Unity.CurrentDetailStackSize - 1] == UNITY_DETAIL_D2) { \ + Unity.CurrentDetailStackLabels[--Unity.CurrentDetailStackSize] = UNITY_DETAIL_NONE;} \ + if(Unity.CurrentDetailStackSize && \ + Unity.CurrentDetailStackLabels[Unity.CurrentDetailStackSize - 1] == UNITY_DETAIL_D1) { \ + Unity.CurrentDetailStackLabels[--Unity.CurrentDetailStackSize] = UNITY_DETAIL_NONE;} \ + } while (0) +#define UNITY_SET_DETAIL(d1) do { UNITY_CLR_DETAILS(); \ + UnityPushDetail(UNITY_DETAIL_D1, (UNITY_DETAIL_VALUE_TYPE)(d1), __LINE__); \ + } while (0) +#define UNITY_SET_DETAILS(d1,d2) do { UNITY_CLR_DETAILS(); \ + UnityPushDetail(UNITY_DETAIL_D1, (UNITY_DETAIL_VALUE_TYPE)(d1), __LINE__); \ + UnityPushDetail(UNITY_DETAIL_D2, (UNITY_DETAIL_VALUE_TYPE)(d2), __LINE__); \ + } while (0) + +#else +/* just two hardcoded slots */ +#define UNITY_CLR_DETAILS() do { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; } while (0) +#define UNITY_SET_DETAIL(d1) do { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = 0; } while (0) +#define UNITY_SET_DETAILS(d1,d2) do { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = (d2); } while (0) +#endif #endif #ifdef UNITY_PRINT_TEST_CONTEXT @@ -590,7 +649,8 @@ void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...); void UnityPrintLen(const char* string, const UNITY_UINT32 length); void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number); -void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style); +void UnityPrintIntNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style); +void UnityPrintUintNumberByStyle(const UNITY_UINT number, const UNITY_DISPLAY_STYLE_T style); void UnityPrintNumber(const UNITY_INT number_to_print); void UnityPrintNumberUnsigned(const UNITY_UINT number); void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print); @@ -607,18 +667,31 @@ void UnityPrintFloat(const UNITY_DOUBLE input_number); * convention and will pull in file and line information * for you. */ -void UnityAssertEqualNumber(const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); +void UnityAssertEqualIntNumber(const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); -void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, - const UNITY_INT actual, - const UNITY_COMPARISON_T compare, - const char *msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); +void UnityAssertEqualUintNumber(const UNITY_UINT expected, + const UNITY_UINT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); + +void UnityAssertIntGreaterOrLessOrEqualNumber(const UNITY_INT threshold, + const UNITY_INT actual, + const UNITY_COMPARISON_T compare, + const char *msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); + +void UnityAssertUintGreaterOrLessOrEqualNumber(const UNITY_UINT threshold, + const UNITY_UINT actual, + const UNITY_COMPARISON_T compare, + const char *msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, @@ -660,12 +733,19 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags); -void UnityAssertNumbersWithin(const UNITY_UINT delta, - const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); +void UnityAssertIntNumbersWithin(const UNITY_UINT delta, + const UNITY_INT expected, + const UNITY_INT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); + +void UnityAssertUintNumbersWithin(const UNITY_UINT delta, + const UNITY_UINT expected, + const UNITY_UINT actual, + const char* msg, + const UNITY_LINE_TYPE lineNumber, + const UNITY_DISPLAY_STYLE_T style); void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, UNITY_INTERNAL_PTR expected, @@ -894,97 +974,97 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (line), (message)) #define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (line), (message)) -#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) +#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(expected), (UNITY_UINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(UNITY_UINT8)(expected), (UNITY_UINT)(UNITY_UINT8)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(UNITY_UINT8)(expected), (UNITY_UINT)(UNITY_UINT8)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualUintNumber((UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line)) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) - -#define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) - -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_SMALLER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) - -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16) (threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32) (threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) - -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) - -#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_INT16) (expected), (UNITY_INT)(UNITY_INT16) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_INT32) (expected), (UNITY_INT)(UNITY_INT32) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_CHAR_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_CHAR(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16) (threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32) (threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT) (threshold), (UNITY_UINT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT) (threshold), (UNITY_UINT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT8 )(threshold), (UNITY_UINT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT16)(threshold), (UNITY_UINT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(UNITY_UINT32)(threshold), (UNITY_UINT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) + +#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertIntNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertIntNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertIntNumbersWithin((UNITY_UINT16 )(delta), (UNITY_INT)(UNITY_INT16) (expected), (UNITY_INT)(UNITY_INT16) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertIntNumbersWithin((UNITY_UINT32 )(delta), (UNITY_INT)(UNITY_INT32) (expected), (UNITY_INT)(UNITY_INT32) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin( (delta), (UNITY_UINT) (expected), (UNITY_UINT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((UNITY_UINT8 )(delta), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((UNITY_UINT16)(delta), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((UNITY_UINT32)(delta), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((UNITY_UINT8 )(delta), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((UNITY_UINT16)(delta), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((UNITY_UINT32)(delta), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_UINT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_CHAR_WITHIN(delta, expected, actual, line, message) UnityAssertIntNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY) @@ -997,10 +1077,10 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8)( delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) -#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER) +#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER) #define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, message) UnityAssertEqualStringLen((const char*)(expected), (const char*)(actual), (UNITY_UINT32)(len), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), 1, (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) @@ -1038,33 +1118,33 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_VAL) #ifdef UNITY_SUPPORT_64 -#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualIntNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_VAL) -#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertIntNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((delta), (UNITY_UINT)(expected), (UNITY_UINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertUintNumbersWithin((delta), (UNITY_UINT)(expected), (UNITY_UINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertIntGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertUintGreaterOrLessOrEqualNumber((UNITY_UINT)(threshold), (UNITY_UINT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY) @@ -1179,5 +1259,13 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) #endif +#if !defined(UNITY_EXCLUDE_DETAILS) && defined(UNITY_DETAIL_STACK_SIZE) +#define UNITY_DETAIL_PUSH(label, value) UnityPushDetail((UNITY_DETAIL_LABEL_TYPE)(label), (UNITY_DETAIL_VALUE_TYPE)(value), __LINE__) +#define UNITY_DETAIL_POP(label, value) UnityPopDetail((UNITY_DETAIL_LABEL_TYPE)(label), (UNITY_DETAIL_VALUE_TYPE)(value), __LINE__) +#else +#define UNITY_DETAIL_PUSH(label, value) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDetailStack) +#define UNITY_DETAIL_POP(label, value) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDetailStack) +#endif + /* End of UNITY_INTERNALS_H */ #endif diff --git a/test/Makefile b/test/Makefile index 82b61af9..35c2822b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,13 +10,12 @@ CC = clang endif ifeq ($(findstring clang, $(CC)), clang) E = -Weverything -CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes -CFLAGS += -Wno-unused-macros -Wno-padded -Wno-missing-noreturn +CFLAGS += $E -Wno-unknown-warning-option +CFLAGS += -Wno-unsafe-buffer-usage endif CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror #CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros CFLAGS += -Wno-switch-enum -Wno-double-promotion -CFLAGS += -Wno-poison-system-directories CFLAGS += -Wno-covered-switch-default CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \ -Wstrict-prototypes -Wswitch-default -Wundef diff --git a/test/rakefile b/test/rakefile index 7747f305..f278d42c 100644 --- a/test/rakefile +++ b/test/rakefile @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/rakefile_helper.rb b/test/rakefile_helper.rb index 80a4976d..cabcc995 100644 --- a/test/rakefile_helper.rb +++ b/test/rakefile_helper.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/spec/generate_module_existing_file_spec.rb b/test/spec/generate_module_existing_file_spec.rb index f4dd13e3..732e6d73 100644 --- a/test/spec/generate_module_existing_file_spec.rb +++ b/test/spec/generate_module_existing_file_spec.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/ansi.yml b/test/targets/ansi.yml index fcc24557..c09642fd 100644 --- a/test/targets/ansi.yml +++ b/test/targets/ansi.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/clang_file.yml b/test/targets/clang_file.yml index f962ced3..1c4ed537 100644 --- a/test/targets/clang_file.yml +++ b/test/targets/clang_file.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/clang_strict.yml b/test/targets/clang_strict.yml index 1c82f624..11017350 100644 --- a/test/targets/clang_strict.yml +++ b/test/targets/clang_strict.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/gcc_32.yml b/test/targets/gcc_32.yml index 3375e4ee..5a17b307 100644 --- a/test/targets/gcc_32.yml +++ b/test/targets/gcc_32.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/gcc_64.yml b/test/targets/gcc_64.yml index 55223ceb..104cf7d7 100644 --- a/test/targets/gcc_64.yml +++ b/test/targets/gcc_64.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/gcc_auto_limits.yml b/test/targets/gcc_auto_limits.yml index 9159b385..3da6922b 100644 --- a/test/targets/gcc_auto_limits.yml +++ b/test/targets/gcc_auto_limits.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/gcc_auto_stdint.yml b/test/targets/gcc_auto_stdint.yml index 18221609..9697ff74 100644 --- a/test/targets/gcc_auto_stdint.yml +++ b/test/targets/gcc_auto_stdint.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/gcc_manual_math.yml b/test/targets/gcc_manual_math.yml index 22e69aa6..0524f727 100644 --- a/test/targets/gcc_manual_math.yml +++ b/test/targets/gcc_manual_math.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/hitech_picc18.yml b/test/targets/hitech_picc18.yml index 547cb2b5..8dc91295 100644 --- a/test/targets/hitech_picc18.yml +++ b/test/targets/hitech_picc18.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_arm_v4.yml b/test/targets/iar_arm_v4.yml index 26a0f462..74d137de 100644 --- a/test/targets/iar_arm_v4.yml +++ b/test/targets/iar_arm_v4.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_arm_v5.yml b/test/targets/iar_arm_v5.yml index afd51775..cd0930d0 100644 --- a/test/targets/iar_arm_v5.yml +++ b/test/targets/iar_arm_v5.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_arm_v5_3.yml b/test/targets/iar_arm_v5_3.yml index afd51775..cd0930d0 100644 --- a/test/targets/iar_arm_v5_3.yml +++ b/test/targets/iar_arm_v5_3.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_armcortex_LM3S9B92_v5_4.yml b/test/targets/iar_armcortex_LM3S9B92_v5_4.yml index b4aa5d8e..1fc07c6f 100644 --- a/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +++ b/test/targets/iar_armcortex_LM3S9B92_v5_4.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_cortexm3_v5.yml b/test/targets/iar_cortexm3_v5.yml index e27b0f6b..c5d6ad28 100644 --- a/test/targets/iar_cortexm3_v5.yml +++ b/test/targets/iar_cortexm3_v5.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_msp430.yml b/test/targets/iar_msp430.yml index 041ebdaf..de89245f 100644 --- a/test/targets/iar_msp430.yml +++ b/test/targets/iar_msp430.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/targets/iar_sh2a_v6.yml b/test/targets/iar_sh2a_v6.yml index 21761d4b..8e5ded4b 100644 --- a/test/targets/iar_sh2a_v6.yml +++ b/test/targets/iar_sh2a_v6.yml @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/testdata/CException.h b/test/testdata/CException.h index 0c11eaaa..c4c58edd 100644 --- a/test/testdata/CException.h +++ b/test/testdata/CException.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/testdata/Defs.h b/test/testdata/Defs.h index aa5ed670..ec83d6fd 100644 --- a/test/testdata/Defs.h +++ b/test/testdata/Defs.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/testdata/cmock.h b/test/testdata/cmock.h index 440220d0..37efb0b1 100644 --- a/test/testdata/cmock.h +++ b/test/testdata/cmock.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/testdata/mockMock.h b/test/testdata/mockMock.h index ca65fc93..0aa5a005 100644 --- a/test/testdata/mockMock.h +++ b/test/testdata/mockMock.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/testdata/testRunnerGenerator.c b/test/testdata/testRunnerGenerator.c index c10a96e6..ef8f4684 100644 --- a/test/testdata/testRunnerGenerator.c +++ b/test/testdata/testRunnerGenerator.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/testdata/testRunnerGeneratorSmall.c b/test/testdata/testRunnerGeneratorSmall.c index bc9f7fcf..076efff7 100644 --- a/test/testdata/testRunnerGeneratorSmall.c +++ b/test/testdata/testRunnerGeneratorSmall.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/testdata/testRunnerGeneratorWithMocks.c b/test/testdata/testRunnerGeneratorWithMocks.c index adc2a295..5bacd4b3 100644 --- a/test/testdata/testRunnerGeneratorWithMocks.c +++ b/test/testdata/testRunnerGeneratorWithMocks.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/self_assessment_utils.h b/test/tests/self_assessment_utils.h index 6051bda8..95822bf0 100644 --- a/test/tests/self_assessment_utils.h +++ b/test/tests/self_assessment_utils.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -72,6 +72,11 @@ static char putcharSpyBuffer[SPY_BUFFER_MAX]; static UNITY_COUNTER_TYPE indexSpyBuffer; static UNITY_COUNTER_TYPE putcharSpyEnabled; +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-prototypes" +#endif + void startPutcharSpy(void) { indexSpyBuffer = 0; @@ -133,19 +138,30 @@ void flushSpy(void) if (flushSpyEnabled){ flushSpyCalls++; } } -#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \ +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) do { \ startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \ TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ - } + } while (0) -#define TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS(expected, actual) { \ +#define TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS(expected, actual) do { \ startPutcharSpy(); UnityPrintNumberUnsigned((actual)); endPutcharSpy(); \ TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ - } + } while (0) -#define TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, actual) { \ +#define TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, actual) do { \ startPutcharSpy(); UnityPrintFloat((actual)); endPutcharSpy(); \ TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ - } + } while (0) + +#endif +// The reason this isn't folded into the above diagnostic is to semi-isolate +// the header contents from the user content it is included into. +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-prototypes" #endif diff --git a/test/tests/test_generate_test_runner.rb b/test/tests/test_generate_test_runner.rb index 79a2e48e..5e0133f0 100644 --- a/test/tests/test_generate_test_runner.rb +++ b/test/tests/test_generate_test_runner.rb @@ -1,7 +1,7 @@ # ========================================================================= # Unity - A Test Framework for C # ThrowTheSwitch.org -# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams # SPDX-License-Identifier: MIT # ========================================================================= diff --git a/test/tests/test_unity_arrays.c b/test/tests/test_unity_arrays.c index f852c269..9e811258 100644 --- a/test/tests/test_unity_arrays.c +++ b/test/tests/test_unity_arrays.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_core.c b/test/tests/test_unity_core.c index 866f2ab1..dc3a1bf4 100644 --- a/test/tests/test_unity_core.c +++ b/test/tests/test_unity_core.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -61,7 +61,7 @@ void testUnitySizeInitializationReminder(void) #ifndef UNITY_EXCLUDE_SETJMP_H jmp_buf AbortFrame; #endif - } _Expected_Unity; + } Expected_Unity; #else struct { const char* TestFile; @@ -81,7 +81,7 @@ void testUnitySizeInitializationReminder(void) #ifndef UNITY_EXCLUDE_SETJMP_H jmp_buf AbortFrame; #endif - } _Expected_Unity; + } Expected_Unity; #endif /* Compare our fake structure's size to the actual structure's size. They @@ -89,22 +89,22 @@ void testUnitySizeInitializationReminder(void) * * This accounts for alignment, padding, and packing issues that might come * up between different architectures. */ - TEST_ASSERT_EQUAL_MESSAGE(sizeof(_Expected_Unity), sizeof(Unity), message); + TEST_ASSERT_EQUAL_MESSAGE(sizeof(Expected_Unity), sizeof(Unity), message); } -void testPassShouldEndImmediatelyWithPass(void) +UNITY_FUNCTION_ATTR(noreturn) void testPassShouldEndImmediatelyWithPass(void) { TEST_PASS(); TEST_FAIL_MESSAGE("We should have passed already and finished this test"); } -void testPassShouldEndImmediatelyWithPassAndMessage(void) +UNITY_FUNCTION_ATTR(noreturn) void testPassShouldEndImmediatelyWithPassAndMessage(void) { TEST_PASS_MESSAGE("Woohoo! This Automatically Passes!"); TEST_FAIL_MESSAGE("We should have passed already and finished this test"); } -void testMessageShouldDisplayMessageWithoutEndingAndGoOnToPass(void) +UNITY_FUNCTION_ATTR(noreturn) void testMessageShouldDisplayMessageWithoutEndingAndGoOnToPass(void) { TEST_MESSAGE("This is just a message"); TEST_MESSAGE("This is another message"); @@ -282,7 +282,7 @@ void testProtection(void) TEST_ASSERT_EQUAL(3, mask); } -void testIgnoredAndThenFailInTearDown(void) +UNITY_FUNCTION_ATTR(noreturn) void testIgnoredAndThenFailInTearDown(void) { SetToOneToFailInTearDown = 1; TEST_IGNORE(); diff --git a/test/tests/test_unity_doubles.c b/test/tests/test_unity_doubles.c index b9e70cff..7a41d03b 100644 --- a/test/tests/test_unity_doubles.c +++ b/test/tests/test_unity_doubles.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_floats.c b/test/tests/test_unity_floats.c index 006c76ab..e02c6563 100644 --- a/test/tests/test_unity_floats.c +++ b/test/tests/test_unity_floats.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -1208,6 +1208,9 @@ void testNotEqualFloatEachEqualLengthZero(void) #endif } +#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +UNITY_FUNCTION_ATTR(noreturn) +#endif void testFloatPrinting(void) { #if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) @@ -1257,6 +1260,9 @@ void testFloatPrinting(void) #endif } +#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +UNITY_FUNCTION_ATTR(noreturn) +#endif void testFloatPrintingRoundTiesToEven(void) { #if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) @@ -1368,6 +1374,9 @@ static void printFloatValue(float f) #endif #endif +#if !defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) || !defined(USING_OUTPUT_SPY) +UNITY_FUNCTION_ATTR(noreturn) +#endif void testFloatPrintingRandomSamples(void) { #if !defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) || !defined(USING_OUTPUT_SPY) diff --git a/test/tests/test_unity_integers.c b/test/tests/test_unity_integers.c index 1b8c6e30..495d87da 100644 --- a/test/tests/test_unity_integers.c +++ b/test/tests/test_unity_integers.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_integers_64.c b/test/tests/test_unity_integers_64.c index 6fb0957f..e6a965aa 100644 --- a/test/tests/test_unity_integers_64.c +++ b/test/tests/test_unity_integers_64.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_memory.c b/test/tests/test_unity_memory.c index d4897de4..7ee48d2b 100644 --- a/test/tests/test_unity_memory.c +++ b/test/tests/test_unity_memory.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_parameterized.c b/test/tests/test_unity_parameterized.c index b9550986..80598933 100644 --- a/test/tests/test_unity_parameterized.c +++ b/test/tests/test_unity_parameterized.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_parameterizedDemo.c b/test/tests/test_unity_parameterizedDemo.c index 6de6e686..d0ea9626 100644 --- a/test/tests/test_unity_parameterizedDemo.c +++ b/test/tests/test_unity_parameterizedDemo.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/test_unity_strings.c b/test/tests/test_unity_strings.c index 6a421135..bb38ecbb 100644 --- a/test/tests/test_unity_strings.c +++ b/test/tests/test_unity_strings.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/test/tests/types_for_test.h b/test/tests/types_for_test.h index 66828b95..00f580d3 100644 --- a/test/tests/types_for_test.h +++ b/test/tests/types_for_test.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */