diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..5aa51266c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +github: ThrowTheSwitch +#patreon: # Replace with a single Patreon username +#open_collective: # Replace with a single Open Collective username +#ko_fi: # Replace with a single Ko-fi username +#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +#liberapay: # Replace with a single Liberapay username +#issuehunt: # Replace with a single IssueHunt username +#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +#polar: # Replace with a single Polar username +#buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +#thanks_dev: # Replace with a single thanks.dev username +#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce948bd32..f0b6d9304 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,11 +23,11 @@ jobs: - name: Setup Ruby Testing Tools run: | sudo gem install rspec - sudo gem install rubocop -v 0.57.2 + sudo gem install rubocop -v 1.57.2 # Checks out repository under $GITHUB_WORKSPACE - name: Checkout Latest Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 # Run Tests - name: Run All Unit Tests diff --git a/LICENSE.txt b/LICENSE.txt index a541b8432..bd46b9076 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2007-23 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 71488b3e9..6be02aa58 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Unity Test ![CI][] -__Copyright (c) 2007 - 2023 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__ +__Copyright (c) 2007 - 2024 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__ Welcome to the Unity Test Project, one of the main projects of ThrowTheSwitch.org. Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains. @@ -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 e69de29bb..6323a252c 100644 --- a/auto/__init__.py +++ b/auto/__init__.py @@ -0,0 +1,7 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# 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 85cbfd80c..2de38a4b3 100644 --- a/auto/colour_prompt.rb +++ b/auto/colour_prompt.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= if RUBY_PLATFORM =~ /(win|w)32$/ begin diff --git a/auto/colour_reporter.rb b/auto/colour_reporter.rb index b86b76c5d..10a17d371 100644 --- a/auto/colour_reporter.rb +++ b/auto/colour_reporter.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require_relative 'colour_prompt' diff --git a/auto/extract_version.py b/auto/extract_version.py index 1d137e5bd..1494bd529 100755 --- a/auto/extract_version.py +++ b/auto/extract_version.py @@ -1,4 +1,11 @@ #!/usr/bin/env python3 +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + import re import sys diff --git a/auto/generate_config.yml b/auto/generate_config.yml index 4a5e47424..72b06549c 100644 --- a/auto/generate_config.yml +++ b/auto/generate_config.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + #this is a sample configuration file for generate_module #you would use it by calling generate_module with the -ygenerate_config.yml option #files like this are useful for customizing generate_module to your environment diff --git a/auto/generate_module.rb b/auto/generate_module.rb index 7b33c727f..0b5024bd2 100644 --- a/auto/generate_module.rb +++ b/auto/generate_module.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= # This script creates all the files with start code necessary for a new module. # A simple module only requires a source file, header file, and test file. @@ -159,7 +160,7 @@ def files_to_operate_on(module_name, pattern = nil) boilerplate: cfg[:boilerplate], includes: case (cfg[:inc]) when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) }) - when :inc then (@options[:includes][:inc] || []) + when :inc then @options[:includes][:inc] || [] when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) }) end } diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 057c02fbc..2b2cf61ba 100755 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -1,10 +1,10 @@ -#!/usr/bin/ruby - -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +#!/usr/bin/env ruby +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= class UnityTestRunnerGenerator def initialize(options = nil) @@ -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 @@ -170,7 +174,7 @@ def find_tests(source) arg_elements_regex = /\s*(#{single_arg_regex_string})\s*,\s*/m args += type_and_args[i + 1].scan(args_regex).flatten.map do |arg_values_str| - ("#{arg_values_str},").scan(arg_elements_regex) + "#{arg_values_str},".scan(arg_elements_regex) end.reduce do |result, arg_range_expanded| result.product(arg_range_expanded) end.map do |arg_combinations| @@ -231,15 +235,43 @@ 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] if @options[:defines] && !@options[:defines].empty? - @options[:defines].each { |d| output.puts("#ifndef #{d}\n#define #{d}\n#endif /* #{d} */") } + output.puts('/* injected defines for unity settings, etc */') + @options[:defines].each do |d| + def_only = d.match(/(\w+).*/)[1] + output.puts("#ifndef #{def_only}\n#define #{d}\n#endif /* #{def_only} */") + end end if @options[:header_file] && !@options[:header_file].empty? output.puts("#include \"#{File.basename(@options[:header_file])}\"") @@ -266,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);") @@ -388,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 @@ -397,6 +455,7 @@ def create_main(output, filename, tests, used_mocks) end output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)") output.puts('{') + output.puts('#ifdef UNITY_USE_COMMAND_LINE_ARGS') output.puts(' int parse_status = UnityParseOptions(argc, argv);') output.puts(' if (parse_status != 0)') output.puts(' {') @@ -419,6 +478,7 @@ def create_main(output, filename, tests, used_mocks) output.puts(' }') output.puts(' return parse_status;') output.puts(' }') + output.puts('#endif') else main_return = @options[:omit_begin_end] ? 'void' : 'int' if main_name != 'main' @@ -433,27 +493,55 @@ 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] output.puts(' (void) suite_teardown(0);') else - output.puts(' return suiteTearDown(UnityEnd());') + output.puts(' return suiteTearDown(UNITY_END());') end else - output.puts(' return UnityEnd();') unless @options[:omit_begin_end] + output.puts(' return UNITY_END();') unless @options[:omit_begin_end] end output.puts('}') end @@ -529,8 +617,10 @@ def create_h_file(output, filename, tests, testfile_includes, used_mocks) ' --suite_setup="" - code to execute for setup of entire suite', ' --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 UnityEnd (disabled by default)', - ' --header_file="" - path/name of test header file to generate too'].join("\n") + ' --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', + ' --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 aa306e2c0..3ecc04c8e 100644 --- a/auto/parse_output.rb +++ b/auto/parse_output.rb @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + #============================================================ # Author: John Theofanopoulos # A simple parser. Takes the output files generated during the diff --git a/auto/run_test.erb b/auto/run_test.erb index 68b33730a..e334d6570 100644 --- a/auto/run_test.erb +++ b/auto/run_test.erb @@ -2,7 +2,7 @@ static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) { Unity.CurrentTestName = name; - Unity.CurrentTestLineNumber = line_num; + Unity.CurrentTestLineNumber = (UNITY_UINT) line_num; #ifdef UNITY_USE_COMMAND_LINE_ARGS if (!UnityTestMatches()) return; diff --git a/auto/stylize_as_junit.py b/auto/stylize_as_junit.py index 06c865964..24e68321d 100644 --- a/auto/stylize_as_junit.py +++ b/auto/stylize_as_junit.py @@ -1,11 +1,11 @@ -#! python3 -# ========================================== -# Fork from Unity Project - A Test Framework for C -# Pull request on Gerrit in progress, the objective of this file is to be deleted when official Unity deliveries -# include that modification -# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +#!/usr/bin/env python3 +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + import sys import os from glob import glob diff --git a/auto/stylize_as_junit.rb b/auto/stylize_as_junit.rb index e4b911ebe..9a1edca5b 100755 --- a/auto/stylize_as_junit.rb +++ b/auto/stylize_as_junit.rb @@ -1,14 +1,16 @@ -#!/usr/bin/ruby -# -# unity_to_junit.rb -# +#!/usr/bin/env ruby +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + require 'fileutils' require 'optparse' require 'ostruct' require 'set' -require 'pp' - VERSION = 1.0 class ArgvParser diff --git a/auto/test_file_filter.rb b/auto/test_file_filter.rb index f4834a12b..7439192a6 100644 --- a/auto/test_file_filter.rb +++ b/auto/test_file_filter.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require_relative 'yaml_helper' diff --git a/auto/type_sanitizer.rb b/auto/type_sanitizer.rb index 3d1db09fb..dca96be17 100644 --- a/auto/type_sanitizer.rb +++ b/auto/type_sanitizer.rb @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + module TypeSanitizer def self.sanitize_c_identifier(unsanitized) # convert filename to valid C identifier by replacing invalid chars with '_' diff --git a/auto/unity_test_summary.py b/auto/unity_test_summary.py index 00c0da8cc..d3c47c6a8 100644 --- a/auto/unity_test_summary.py +++ b/auto/unity_test_summary.py @@ -1,10 +1,11 @@ -#! python3 -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de -# [Released under MIT License. Please refer to license.txt for details] -# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams -# ========================================== +#!/usr/bin/env python3 +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + import sys import os import re diff --git a/auto/unity_test_summary.rb b/auto/unity_test_summary.rb index 03d67a680..cfa267b52 100644 --- a/auto/unity_test_summary.rb +++ b/auto/unity_test_summary.rb @@ -1,10 +1,11 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +#!/usr/bin/env ruby +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# 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 3296ba0ee..e11792aa0 100644 --- a/auto/yaml_helper.rb +++ b/auto/yaml_helper.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require 'yaml' diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..84e34806a --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,138 @@ + +# ThrowTheSwitch.org Code of Conduct + +Thank you for participating in a ThrowTheSwitch.org community project! We want +this to continue to be a warm and inviting place for everyone to share ideas +and get help. To accomplish this goal, we've developed this Code of Conduct. + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +hello@thingamabyte.com. + +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000..e64a285a1 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,238 @@ +# Contributing to a ThrowTheSwitch.org Project + +๐Ÿ‘๐ŸŽ‰ _First off, thanks for taking the time to contribute!_ ๐ŸŽ‰๐Ÿ‘ + +The following is a set of guidelines for contributing to any of ThrowTheSwitch.org's projects or the website itself, hosted at throwtheswitch.org or ThrowTheSwitch's organization on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +### Table Of Contents + +- [Code of Conduct](#book-code-of-conduct) +- [Asking Questions](#bulb-asking-questions) +- [Opening an Issue](#inbox_tray-opening-an-issue) +- [Feature Requests](#love_letter-feature-requests) +- [Triaging Issues](#mag-triaging-issues) +- [Submitting Pull Requests](#repeat-submitting-pull-requests) +- [Writing Commit Messages](#memo-writing-commit-messages) +- [Code Review](#white_check_mark-code-review) +- [Coding Style](#nail_care-coding-style) +- [Certificate of Origin](#medal_sports-certificate-of-origin) +- [Credits](#pray-credits) + +## :book: Code of Conduct + +Please review our [Code of Conduct](CODE_OF_CONDUCT.md). It is in effect at all times. We expect it to be honored by everyone who contributes to this project. Be a Good Human! + +## :bulb: Asking Questions + +> **Note:** Please don't file an issue to ask a question. We have an official forum where the community chimes in with helpful advice if you have questions. + +* [ThrowTheSwitch Forums](https://throwtheswitch.org/forums) + +### What should I know before I get started? + +ThrowTheSwitch hosts a number of open source projects — Ceedling is the entrypoint for many users. Ceedling is actually built upon the foundation of Unity Test (a flexible C testing framework) and CMock (a mocking tool for C) and it coordinates many other open source and proprietary tools. Please do your best to focus your ideas and questions at the correct tool. We'll do our best to help you find your way, but there will be times where we'll have to direct your attention to another subtool. + +Here are some of the main projects hosted by ThrowTheSwitch.org: + + - [Ceedling](https://www.github.com/throwtheswitch/ceedling) -- Build coordinator for testing C applications, especially embedded C (and optionally your release build too!) + - [CMock](https://www.github.com/throwtheswitch/cmock) -- Mocking tool for automatically creating stubs, mocks, and skeletons in C + - [Unity](https://www.github.com/throwtheswitch/unity) -- Unit Testing framework for C, specially embedded C. + - [MadScienceLabDocker](https://www.github.com/throwtheswitch/madsciencelabdocker) -- Docker image giving you a shortcut to getting running with Ceedling + - [CException](https://www.github.com/throwtheswitch/cexception) -- An exception framework for using simple exceptions in C. + +There are many more, but this list should be a good starting point. + +## :inbox_tray: Opening an Issue + +Before [creating an issue](https://help.github.com/en/github/managing-your-work-on-github/creating-an-issue), check if you are using the latest version of the project. If you are not up-to-date, see if updating fixes your issue first. + +### :beetle: Bug Reports and Other Issues + +A great way to contribute to the project is to send a detailed issue when you encounter a problem. We always appreciate a well-written, thorough bug report. :v: + +In short, since you are most likely a developer, **provide a ticket that you would like to receive**. + +- **Review the documentation** before opening a new issue. + +- **Do not open a duplicate issue!** Search through existing issues to see if your issue has previously been reported. If your issue exists, comment with any additional information you have. You may simply note "I have this problem too", which helps prioritize the most common problems and requests. + +- **Prefer using [reactions](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)**, not comments, if you simply want to "+1" an existing issue. + +- **Fully complete the provided issue template.** The bug report template requests all the information we need to quickly and efficiently address your issue. Be clear, concise, and descriptive. Provide as much information as you can, including steps to reproduce, stack traces, compiler errors, library versions, OS versions, and screenshots (if applicable). + +- **Use [GitHub-flavored Markdown](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).** Especially put code blocks and console outputs in backticks (```). This improves readability. + +## :seedling: Feature Requests + +Feature requests are welcome! We don't have all the answers and we truly love the collaborative experience of building software together! That being said, we cannot guarantee your request will be accepted. We want to avoid [feature creep](https://en.wikipedia.org/wiki/Feature_creep). Your idea may be great, but also out-of-scope for the project. If accepted, we'll do our best to tackle it in a timely manner, but cannot make any commitments regarding the timeline for implementation and release. However, you are welcome to submit a pull request to help! + +- **Please don't open a duplicate feature request.** Search for existing feature requests first. If you find your feature (or one very similar) previously requested, comment on that issue. + +- **Fully complete the provided issue template.** The feature request template asks for all necessary information for us to begin a productive conversation. + +- Be precise about the proposed outcome of the feature and how it relates to existing features. Include implementation details if possible. + +## :mag: Triaging Issues + +You can triage issues which may include reproducing bug reports or asking for additional information, such as version numbers or reproduction instructions. Any help you can provide to quickly resolve an issue is very much appreciated! + +## :repeat: Submitting Pull Requests + +We **love** pull requests! Before [forking the repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests) for non-trivial changes, it is usually best to first open an issue to discuss the changes, or discuss your intended approach for solving the problem in the comments for an existing issue. + +For most contributions, after your first pull request is accepted and merged, you will be [invited to the project](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository) and given **push access**. :tada: + +*Note: All contributions will be licensed under the project's license.* + +- **Smaller is better.** Submit **one** pull request per bug fix or feature. A pull request should contain isolated changes pertaining to a single bug fix or feature implementation. **Do not** refactor or reformat code that is unrelated to your change. It is better to **submit many small pull requests** rather than a single large one. Enormous pull requests will take enormous amounts of time to review, or may be rejected altogether. + +- **Coordinate bigger changes.** For large and non-trivial changes, open an issue to discuss a strategy with the maintainers. Otherwise, you risk doing a lot of work for nothing! + +- **Prioritize understanding over cleverness.** Write code clearly and concisely. Remember that source code usually gets written once and read often. Ensure the code is clear to the reader. The purpose and logic should be obvious to a reasonably skilled developer, otherwise you should add a comment that explains it. + +- **Follow existing coding style and conventions.** Keep your code consistent with the style, formatting, and conventions in the rest of the code base. When possible, these will be enforced with a linter. Consistency makes it easier to review and modify in the future. + +- **Include test coverage.** Add unit tests when possible. Follow existing patterns for implementing tests. + +- **Update the example project** if one exists to exercise any new functionality you have added. + +- **Add documentation.** Document your changes with code doc comments or in existing guides. + +- **Update the CHANGELOG** for all enhancements and bug fixes. Include the corresponding issue number if one exists, and your GitHub username. (example: "- Fixed crash in profile view. #123 @jessesquires") + +- **Use the repo's default branch.** Branch from and [submit your pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to the repo's default branch. Usually this is `main`, but it could be `dev`, `develop`, or `master`. + +- **[Resolve any merge conflicts](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github)** that occur. + +- **Promptly address any CI failures**. If your pull request fails to build or pass tests, please push another commit to fix it. + +- When writing comments, use properly constructed sentences, including punctuation. + +- Use spaces, not tabs. + +## :memo: Writing Commit Messages + +Please [write a great commit message](https://chris.beams.io/posts/git-commit/). + +1. Separate subject from body with a blank line +1. Limit the subject line to 50 characters +1. Capitalize the subject line +1. Do not end the subject line with a period +1. Wrap the body at _about_ 72 characters +1. Use the body to explain **why**, *not what and how* (the code shows that!) +1. If applicable, prefix the title with the relevant component name or emoji (see below. examples: "[Docs] Fix typo", "[Profile] Fix missing avatar") + +``` +:palm_tree: Summary of Amazing Feature Here + +Add a more detailed explanation here, if necessary. Possibly give +some background about the issue being fixed, etc. The body of the +commit message can be several paragraphs. Further paragraphs come +after blank lines and please do proper word-wrap. + +Wrap it to about 72 characters or so. In some contexts, +the first line is treated as the subject of the commit and the +rest of the text as the body. The blank line separating the summary +from the body is critical (unless you omit the body entirely); +various tools like `log`, `shortlog` and `rebase` can get confused +if you run the two together. + +Explain the problem that this commit is solving. Focus on why you +are making this change as opposed to how or what. The code explains +how or what. Reviewers and your future self can read the patch, +but might not understand why a particular solution was implemented. +Are there side effects or other unintuitive consequences of this +change? Here's the place to explain them. + + - Bullet points are awesome, too + + - A hyphen should be used for the bullet, preceded + by a single space, with blank lines in between + +Note the fixed or relevant GitHub issues at the end: + +Resolves: #123 +See also: #456, #789 +``` + +## :heart: Who Loves Emoji? + +Commit comments, Issues, Feature Requests... they can all use a little sprucing up, right? Consider using the following emoji for a mix of function and :sparkles: dazzle! + + - actions + - :seedling: `:seedling:` (or other plants) when growing new features. Choose your fav! :cactus: :herb: :evergreen_tree: :palm_tree: :deciduous_tree: :blossom: + - :art: `:art:` when improving the format/structure of the code + - :racehorse: `:racehorse:` when improving performance + - :non-potable_water: `:non-potable_water:` when plugging memory leaks + - :memo: `:memo:` when writing docs + - :bug: `:bug:` (or other insects) when fixing a bug. Maybe :beetle: :ant: or :honeybee: ? + - :fire: `:fire:` when removing code or files + - :green_heart: `:green_heart:` when fixing the CI build + - :white_check_mark: `:white_check_mark:` when adding tests + - :lock: `:lock:` when dealing with security + - :arrow_up: `:arrow_up:` when upgrading dependencies + - :arrow_down: `:arrow_down:` when downgrading dependencies + - :shirt: `:shirt:` when removing linter warnings + + - platforms + - :penguin: `:penguin:` when fixing something on Linux + - :apple: `:apple:` when fixing something on macOS + - :checkered_flag: `:checkered_flag:` when fixing something on Windows + +## :white_check_mark: Code Review + +- **Review the code, not the author.** Look for and suggest improvements without disparaging or insulting the author. Provide actionable feedback and explain your reasoning. + +- **You are not your code.** When your code is critiqued, questioned, or constructively criticized, remember that you are not your code. Do not take code review personally. + +- **Always do your best.** No one writes bugs on purpose. Do your best, and learn from your mistakes. + +- Kindly note any violations to the guidelines specified in this document. + +## :violin: Coding Style + +Consistency is the most important. Following the existing style, formatting, and naming conventions of the file you are modifying and of the overall project. Failure to do so will result in a prolonged review process that has to focus on updating the superficial aspects of your code, rather than improving its functionality and performance. + +For example, if all private properties are prefixed with an underscore `_`, then new ones you add should be prefixed in the same way. Or, if methods are named using camelcase, like `thisIsMyNewMethod`, then do not diverge from that by writing `this_is_my_new_method`. You get the idea. If in doubt, please ask or search the codebase for something similar. + +When possible, style and format will be enforced with a linter. + +### C Styleguide + +C code is linted with [AStyle](https://astyle.sourceforge.net/). + +### Ruby Styleguide + +Ruby code is linted with [Rubocop](https://github.com/rubocop/rubocop) + +## :medal_sports: Certificate of Origin + +*Developer's Certificate of Origin 1.1* + +By making a contribution to this project, I certify that: + +> 1. The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or +> 1. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or +> 1. The contribution was provided directly to me by some other person who certified (1), (2) or (3) and I have not modified it. +> 1. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. + +## [No Brown M&M's](https://en.wikipedia.org/wiki/Van_Halen#Contract_riders) + +If you are reading this, bravo dear user and (hopefully) contributor for making it this far! You are awesome. :100: + +To confirm that you have read this guide and are following it as best as possible, **include this emoji at the top** of your issue or pull request: :pineapple: `:pineapple:` + +## :pray: Credits + +Written by [@jessesquires](https://github.com/jessesquires). Lovingly adapted to ThrowTheSwitch.org by [@mvandervoord](https://github.com/mvandervoord). + +**Please feel free to adopt this guide in your own projects. Fork it wholesale or remix it for your needs.** + +*Many of the ideas and prose for the statements in this document were based on or inspired by work from the following communities:* + +- [Alamofire](https://github.com/Alamofire/Alamofire/blob/master/CONTRIBUTING.md) +- [CocoaPods](https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md) +- [Docker](https://github.com/moby/moby/blob/master/CONTRIBUTING.md) +- [Linux](https://elinux.org/Developer_Certificate_Of_Origin) + +*We commend them for their efforts to facilitate collaboration in their projects.* diff --git a/docs/ThrowTheSwitchCodingStandard.md b/docs/ThrowTheSwitchCodingStandard.md index 517b8fb6b..607c456c5 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 0a0e51b65..90a3e5fd7 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/UnityChangeLog.md b/docs/UnityChangeLog.md index 9c3bb7bf0..a9fec00f9 100644 --- a/docs/UnityChangeLog.md +++ b/docs/UnityChangeLog.md @@ -13,7 +13,23 @@ Prior to 2008, the project was an internal project and not released to the publi ## Log -### Unity 2.6.0 () +### Unity 2.6.1 (Jan 2025) + +New Features: + + - Add `-n` comand line option as strict matcher again + +Significant Bugfixes: + + - Protect against problems when mis-matched command line options selected + +Other: + + - Protect against Conversion warnings in gcc + - Remove Redundant line-casts + - Make more internal functions static + +### Unity 2.6.0 (Mar 2024) New Features: @@ -24,6 +40,7 @@ New Features: - Add Unity BDD plugin - Add `UNITY_INCLUDE_EXEC_TIME` option to report test times - Allow user to override test abort underlying mechanism + - Add `NOT_EQUAL*` and `NOT_WITHIN*` checks for floats and doubles Significant Bugfixes: diff --git a/docs/UnityConfigurationGuide.md b/docs/UnityConfigurationGuide.md index 953851fd7..c2027fcc1 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 @@ -482,6 +482,34 @@ _Example:_ #define UNITY_OUTPUT_COLOR ``` +#### `UNITY_INCLUDE_EXEC_TIME` + +Define this to measure and report execution time for each test in the suite. When enabled, Unity will do +it's best to automatically find a way to determine the time in milliseconds. On most Windows, macos, or +Linux environments, this is automatic. If not, you can give Unity more information. + +#### `UNITY_CLOCK_MS` + +If you're working on a system (embedded or otherwise) which has an accessible millisecond timer. You can +define `UNITY_CLOCK_MS` to be the name of the function which returns the millisecond timer. It will then +attempt to use that function for timing purposes. + +#### `UNITY_EXEC_TIME_START` + +Define this hook to start a millisecond timer if necessary. + +#### `UNITY_EXEC_TIME_STOP` + +Define this hook to stop a millisecond timer if necessary. + +#### `UNITY_PRINT_EXEC_TIME` + +Define this hook to print the current execution time. Used to report the milliseconds elapsed. + +#### `UNITY_TIME_TYPE` + +Finally, this can be set to the type which holds the millisecond timer. + #### `UNITY_SHORTHAND_AS_INT` #### `UNITY_SHORTHAND_AS_MEM` diff --git a/docs/UnityHelperScriptsGuide.md b/docs/UnityHelperScriptsGuide.md index 3c321336d..30841cf94 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 ``` @@ -114,6 +114,11 @@ In the `examples` directory, Example 3's Rakefile demonstrates using a Ruby hash This option specifies an array of file names to be `#include`'d at the top of your runner C file. You might use it to reference custom types or anything else universally needed in your generated runners. +##### `:defines` + +This option specifies an array of definitions to be `#define`'d at the top of your runner C file. +Each definition will be wrapped in an `#ifndef`. + ##### `:suite_setup` Define this option with C code to be executed _before any_ test cases are run. @@ -121,6 +126,8 @@ Define this option with C code to be executed _before any_ test cases are run. Alternatively, if your C compiler supports weak symbols, you can leave this option unset and instead provide a `void suiteSetUp(void)` function in your test suite. The linker will look for this symbol and fall back to a Unity-provided stub if it is not found. +This option can also be specified at the command prompt as `--suite_setup=""` + ##### `:suite_teardown` Define this option with C code to be executed _after all_ test cases have finished. @@ -131,6 +138,8 @@ You can normally just return `num_failures`. Alternatively, if your C compiler supports weak symbols, you can leave this option unset and instead provide a `int suiteTearDown(int num_failures)` function in your test suite. The linker will look for this symbol and fall back to a Unity-provided stub if it is not found. +This option can also be specified at the command prompt as `--suite_teardown=""` + ##### `:enforce_strict_ordering` This option should be defined if you have the strict order feature enabled in CMock (see CMock documentation). @@ -141,6 +150,8 @@ If you provide the same YAML to the generator as used in CMock's configuration, This option should be defined if you are mixing C and CPP and want your test runners to automatically include extern "C" support when they are generated. +This option can also be specified at the command prompt as `--externc` + ##### `:mock_prefix` and `:mock_suffix` Unity automatically generates calls to Init, Verify and Destroy for every file included in the main test file that starts with the given mock prefix and ends with the given mock suffix, file extension not included. @@ -165,8 +176,11 @@ Or as a yaml file: If you are using CMock, it is very likely that you are already passing an array of plugins to CMock. You can just use the same array here. + This script will just ignore the plugins that don't require additional support. +This option can also be specified at the command prompt as `--cexception` + ##### `:include_extensions` This option specifies the pattern for matching acceptable header file extensions. @@ -191,7 +205,93 @@ 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 next section. +You can see a list of supported macros in the +[Parameterized tests provided macros](#parameterized-tests-provided-macros) +section that follows. + +This option can also be specified at the command prompt as `--use_param_tests=1` + +##### `:cmdline_args` + +When set to `true`, the generated test runner can accept a number of +options to modify how the test(s) are run. + +Ensure Unity is compiled with `UNITY_USE_COMMAND_LINE_ARGS` defined or else +the required functions will not exist. + +These are the available options: + +| Option | Description | +| --------- | ------------------------------------------------- | +| `-l` | List all tests and exit | +| `-f NAME` | Filter to run only tests whose name includes NAME | +| `-n NAME` | Run only the test named NAME | +| `-h` | show the Help menu that lists these options | +| `-q` | Quiet/decrease verbosity | +| `-v` | increase Verbosity | +| `-x NAME` | eXclude tests whose name includes NAME | + +##### `:setup_name` + +Override the default test `setUp` function name. + +This option can also be specified at the command prompt as `--setup_name=""` + +##### `:teardown_name` + +Override the default test `tearDown` function name. + +This option can also be specified at the command prompt as `--teardown_name=""` + +##### `:test_reset_name` + +Override the default test `resetTest` function name. + +This option can also be specified at the command prompt as `--test_reset_name=""` + +##### `:test_verify_name` + +Override the default test `verifyTest` function name. + +This option can also be specified at the command prompt as `--test_verify_name=""` + +##### `:main_name` + +Override the test's `main()` function name (from `main` to whatever is specified). +The sentinel value `:auto` will use the test's filename with the `.c` extension removed prefixed +with `main_` as the "main" function. + +To clarify, if `:main_name == :auto` and the test filename is "test_my_project.c", then the +generated function name will be `main_test_my_project(int argc, char** argv)`. + +This option can also be specified at the command prompt as `--main_name=""` + +##### `main_export_decl` + +Provide any `cdecl` for the `main()` test function. Is empty by default. + +##### `:omit_begin_end` + +If `true`, the `UnityBegin` and `UnityEnd` function will not be called for +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 @@ -199,7 +299,7 @@ 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 */ @@ -301,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]) @@ -350,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) @@ -416,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/makefile b/examples/example_1/makefile index 28409c104..9c97687ec 100644 --- a/examples/example_1/makefile +++ b/examples/example_1/makefile @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# 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) diff --git a/examples/example_1/src/ProductionCode.c b/examples/example_1/src/ProductionCode.c index db128e5bd..9a100330c 100644 --- a/examples/example_1/src/ProductionCode.c +++ b/examples/example_1/src/ProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_1/src/ProductionCode.h b/examples/example_1/src/ProductionCode.h index 250ca0dc6..57ccf41fc 100644 --- a/examples/example_1/src/ProductionCode.h +++ b/examples/example_1/src/ProductionCode.h @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ int FindFunction_WhichIsBroken(int NumberToFind); int FunctionWhichReturnsLocalVariable(void); diff --git a/examples/example_1/src/ProductionCode2.c b/examples/example_1/src/ProductionCode2.c index 98ee7eebc..ae72f91ca 100644 --- a/examples/example_1/src/ProductionCode2.c +++ b/examples/example_1/src/ProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" diff --git a/examples/example_1/src/ProductionCode2.h b/examples/example_1/src/ProductionCode2.h index 34ae980d1..0a0bd76e3 100644 --- a/examples/example_1/src/ProductionCode2.h +++ b/examples/example_1/src/ProductionCode2.h @@ -1,2 +1,8 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/examples/example_1/test/TestProductionCode.c b/examples/example_1/test/TestProductionCode.c index 404c37184..63e497717 100644 --- a/examples/example_1/test/TestProductionCode.c +++ b/examples/example_1/test/TestProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_1/test/TestProductionCode2.c b/examples/example_1/test/TestProductionCode2.c index 7d940c171..62742c9b1 100644 --- a/examples/example_1/test/TestProductionCode2.c +++ b/examples/example_1/test/TestProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" #include "unity.h" diff --git a/examples/example_2/makefile b/examples/example_2/makefile index e2832173b..c0b418527 100644 --- a/examples/example_2/makefile +++ b/examples/example_2/makefile @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# 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) diff --git a/examples/example_2/src/ProductionCode.c b/examples/example_2/src/ProductionCode.c index 3bafe2056..841f91aff 100644 --- a/examples/example_2/src/ProductionCode.c +++ b/examples/example_2/src/ProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_2/src/ProductionCode.h b/examples/example_2/src/ProductionCode.h index 250ca0dc6..57ccf41fc 100644 --- a/examples/example_2/src/ProductionCode.h +++ b/examples/example_2/src/ProductionCode.h @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ int FindFunction_WhichIsBroken(int NumberToFind); int FunctionWhichReturnsLocalVariable(void); diff --git a/examples/example_2/src/ProductionCode2.c b/examples/example_2/src/ProductionCode2.c index 77c969f17..c5c50112d 100644 --- a/examples/example_2/src/ProductionCode2.c +++ b/examples/example_2/src/ProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" diff --git a/examples/example_2/src/ProductionCode2.h b/examples/example_2/src/ProductionCode2.h index 34ae980d1..0a0bd76e3 100644 --- a/examples/example_2/src/ProductionCode2.h +++ b/examples/example_2/src/ProductionCode2.h @@ -1,2 +1,8 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/examples/example_2/test/TestProductionCode.c b/examples/example_2/test/TestProductionCode.c index b8fb95c08..b424e24ab 100644 --- a/examples/example_2/test/TestProductionCode.c +++ b/examples/example_2/test/TestProductionCode.c @@ -1,3 +1,10 @@ +/* ========================================================================= + 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" #include "unity_fixture.h" diff --git a/examples/example_2/test/TestProductionCode2.c b/examples/example_2/test/TestProductionCode2.c index d9f4efe31..a43bec4e1 100644 --- a/examples/example_2/test/TestProductionCode2.c +++ b/examples/example_2/test/TestProductionCode2.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #include "ProductionCode2.h" #include "unity.h" #include "unity_fixture.h" diff --git a/examples/example_2/test/test_runners/TestProductionCode2_Runner.c b/examples/example_2/test/test_runners/TestProductionCode2_Runner.c index 6fcc3b120..f40f8357e 100644 --- a/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +++ b/examples/example_2/test/test_runners/TestProductionCode2_Runner.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #include "unity.h" #include "unity_fixture.h" diff --git a/examples/example_2/test/test_runners/TestProductionCode_Runner.c b/examples/example_2/test/test_runners/TestProductionCode_Runner.c index 41a416a6e..c50664f24 100644 --- a/examples/example_2/test/test_runners/TestProductionCode_Runner.c +++ b/examples/example_2/test/test_runners/TestProductionCode_Runner.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #include "unity.h" #include "unity_fixture.h" diff --git a/examples/example_2/test/test_runners/all_tests.c b/examples/example_2/test/test_runners/all_tests.c index e706ece7d..54c4d250c 100644 --- a/examples/example_2/test/test_runners/all_tests.c +++ b/examples/example_2/test/test_runners/all_tests.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #include "unity_fixture.h" static void RunAllTests(void) diff --git a/examples/example_3/helper/UnityHelper.c b/examples/example_3/helper/UnityHelper.c index 9cf42c678..728ddbc99 100644 --- a/examples/example_3/helper/UnityHelper.c +++ b/examples/example_3/helper/UnityHelper.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #include "unity.h" #include "UnityHelper.h" #include diff --git a/examples/example_3/helper/UnityHelper.h b/examples/example_3/helper/UnityHelper.h index 151611158..8d3e4b669 100644 --- a/examples/example_3/helper/UnityHelper.h +++ b/examples/example_3/helper/UnityHelper.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #ifndef _TESTHELPER_H #define _TESTHELPER_H diff --git a/examples/example_3/rakefile.rb b/examples/example_3/rakefile.rb index c095af38e..ace9eb8d9 100644 --- a/examples/example_3/rakefile.rb +++ b/examples/example_3/rakefile.rb @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + require 'rake' require 'rake/clean' require_relative 'rakefile_helper' diff --git a/examples/example_3/rakefile_helper.rb b/examples/example_3/rakefile_helper.rb index cbc4549f1..be73b1854 100644 --- a/examples/example_3/rakefile_helper.rb +++ b/examples/example_3/rakefile_helper.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require 'fileutils' require_relative '../../auto/unity_test_summary' diff --git a/examples/example_3/src/ProductionCode.c b/examples/example_3/src/ProductionCode.c index 3bafe2056..841f91aff 100644 --- a/examples/example_3/src/ProductionCode.c +++ b/examples/example_3/src/ProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_3/src/ProductionCode.h b/examples/example_3/src/ProductionCode.h index 250ca0dc6..57ccf41fc 100644 --- a/examples/example_3/src/ProductionCode.h +++ b/examples/example_3/src/ProductionCode.h @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ int FindFunction_WhichIsBroken(int NumberToFind); int FunctionWhichReturnsLocalVariable(void); diff --git a/examples/example_3/src/ProductionCode2.c b/examples/example_3/src/ProductionCode2.c index 77c969f17..c5c50112d 100644 --- a/examples/example_3/src/ProductionCode2.c +++ b/examples/example_3/src/ProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" diff --git a/examples/example_3/src/ProductionCode2.h b/examples/example_3/src/ProductionCode2.h index 34ae980d1..0a0bd76e3 100644 --- a/examples/example_3/src/ProductionCode2.h +++ b/examples/example_3/src/ProductionCode2.h @@ -1,2 +1,8 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/examples/example_3/target_gcc_32.yml b/examples/example_3/target_gcc_32.yml index d7568ab81..b7324d82f 100644 --- a/examples/example_3/target_gcc_32.yml +++ b/examples/example_3/target_gcc_32.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + # Copied from ~Unity/targets/gcc_32.yml unity_root: &unity_root '../..' unity_source: &unity_source '../../src/' diff --git a/examples/example_3/test/TestProductionCode.c b/examples/example_3/test/TestProductionCode.c index 28a55812c..654de52d6 100644 --- a/examples/example_3/test/TestProductionCode.c +++ b/examples/example_3/test/TestProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_3/test/TestProductionCode2.c b/examples/example_3/test/TestProductionCode2.c index e2119cc38..32ba6be44 100644 --- a/examples/example_3/test/TestProductionCode2.c +++ b/examples/example_3/test/TestProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" #include "unity.h" diff --git a/examples/example_4/src/ProductionCode.c b/examples/example_4/src/ProductionCode.c index db128e5bd..9a100330c 100644 --- a/examples/example_4/src/ProductionCode.c +++ b/examples/example_4/src/ProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_4/src/ProductionCode.h b/examples/example_4/src/ProductionCode.h index 250ca0dc6..57ccf41fc 100644 --- a/examples/example_4/src/ProductionCode.h +++ b/examples/example_4/src/ProductionCode.h @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ int FindFunction_WhichIsBroken(int NumberToFind); int FunctionWhichReturnsLocalVariable(void); diff --git a/examples/example_4/src/ProductionCode2.c b/examples/example_4/src/ProductionCode2.c index 98ee7eebc..ae72f91ca 100644 --- a/examples/example_4/src/ProductionCode2.c +++ b/examples/example_4/src/ProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" diff --git a/examples/example_4/src/ProductionCode2.h b/examples/example_4/src/ProductionCode2.h index 34ae980d1..0a0bd76e3 100644 --- a/examples/example_4/src/ProductionCode2.h +++ b/examples/example_4/src/ProductionCode2.h @@ -1,2 +1,8 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/examples/example_4/test/TestProductionCode.c b/examples/example_4/test/TestProductionCode.c index 526a84eb9..63b6618e9 100644 --- a/examples/example_4/test/TestProductionCode.c +++ b/examples/example_4/test/TestProductionCode.c @@ -1,3 +1,9 @@ +/* ========================================================================= + 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" diff --git a/examples/example_4/test/TestProductionCode2.c b/examples/example_4/test/TestProductionCode2.c index 2578ca94e..5292d960b 100644 --- a/examples/example_4/test/TestProductionCode2.c +++ b/examples/example_4/test/TestProductionCode2.c @@ -1,3 +1,9 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "ProductionCode2.h" #include "unity.h" diff --git a/examples/example_5/makefile b/examples/example_5/makefile new file mode 100644 index 000000000..82d39ad1c --- /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 000000000..c84468eb4 --- /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 000000000..7120adc4c --- /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 000000000..7e1435870 --- /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 000000000..6df241bdd --- /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 000000000..ec4cbed32 --- /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 000000000..564eea314 --- /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 000000000..1680da5c4 --- /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 fc6cdb05a..c79dd5a90 100644 --- a/examples/unity_config.h +++ b/examples/unity_config.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + /* Unity Configuration * As of May 11th, 2016 at ThrowTheSwitch/Unity commit 837c529 * Update: December 29th, 2016 @@ -102,7 +109,7 @@ * There can be a significant size and speed impact to enabling 64-bit support * on small targets, so don't define it if you don't need it. */ -/* #define UNITY_INCLUDE_64 */ +/* #define UNITY_SUPPORT_64 */ /* *************************** FLOATING POINT TYPES **************************** diff --git a/extras/bdd/src/unity_bdd.h b/extras/bdd/src/unity_bdd.h index d91b3f137..41ee2adf1 100644 --- a/extras/bdd/src/unity_bdd.h +++ b/extras/bdd/src/unity_bdd.h @@ -1,9 +1,9 @@ -/* Copyright (c) 2023 Michael Gene Brockus (Dreamer) and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_BDD_TEST_H_ #define UNITY_BDD_TEST_H_ diff --git a/extras/bdd/test/test_bdd.c b/extras/bdd/test/test_bdd.c index 4f415858e..be51324df 100644 --- a/extras/bdd/test/test_bdd.c +++ b/extras/bdd/test/test_bdd.c @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #include "unity_bdd.h" diff --git a/extras/fixture/src/unity_fixture.c b/extras/fixture/src/unity_fixture.c index c3dda7963..a89677ed7 100644 --- a/extras/fixture/src/unity_fixture.c +++ b/extras/fixture/src/unity_fixture.c @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity_fixture.h" #include "unity_internals.h" @@ -46,21 +46,25 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)) return (int)Unity.TestFailures; } -static int selected(const char* filter, const char* name) +static int selected(const char* filter, const char* select, const char* name) { - if (filter == 0) + if (filter == 0 && select == 0) return 1; - return strstr(name, filter) ? 1 : 0; + if (filter && strstr(name, filter)) + return 1; + if (select && strcmp(name, select) == 0) + return 1; + return 0; } static int testSelected(const char* test) { - return selected(UnityFixture.NameFilter, test); + return selected(UnityFixture.NameFilter, UnityFixture.Name, test); } static int groupSelected(const char* group) { - return selected(UnityFixture.GroupFilter, group); + return selected(UnityFixture.GroupFilter, UnityFixture.Group, group); } void UnityTestRunner(unityfunction* setup, @@ -96,17 +100,20 @@ void UnityTestRunner(unityfunction* setup, Unity.NumberOfTests++; UnityPointer_Init(); - UNITY_EXEC_TIME_START(); + if (!UnityFixture.DryRun) { + UNITY_EXEC_TIME_START(); - if (TEST_PROTECT()) - { - setup(); - testBody(); - } - if (TEST_PROTECT()) - { - teardown(); + if (TEST_PROTECT()) + { + setup(); + testBody(); + } + if (TEST_PROTECT()) + { + teardown(); + } } + if (TEST_PROTECT()) { UnityPointer_UndoAllSets(); @@ -183,8 +190,11 @@ int UnityGetCommandLineOptions(int argc, const char* argv[]) int i; UnityFixture.Verbose = 0; UnityFixture.Silent = 0; + UnityFixture.DryRun = 0; UnityFixture.GroupFilter = 0; + UnityFixture.Group = 0; UnityFixture.NameFilter = 0; + UnityFixture.Name = 0; UnityFixture.RepeatCount = 1; if (argc == 1) @@ -207,10 +217,16 @@ int UnityGetCommandLineOptions(int argc, const char* argv[]) UNITY_PRINT_EOL(); UnityPrint(" -s Silent mode: minimal output showing only test failures"); UNITY_PRINT_EOL(); + UnityPrint(" -d Dry run all tests"); + UNITY_PRINT_EOL(); UnityPrint(" -g NAME Only run tests in groups that contain the string NAME"); UNITY_PRINT_EOL(); + UnityPrint(" -G NAME Only run tests in groups named NAME"); + UNITY_PRINT_EOL(); UnityPrint(" -n NAME Only run tests whose name contains the string NAME"); UNITY_PRINT_EOL(); + UnityPrint(" -N NAME Only run tests named NAME"); + UNITY_PRINT_EOL(); UnityPrint(" -r NUMBER Repeatedly run all tests NUMBER times"); UNITY_PRINT_EOL(); UnityPrint(" -h, --help Display this help message"); @@ -237,6 +253,11 @@ int UnityGetCommandLineOptions(int argc, const char* argv[]) UnityFixture.Silent = 1; i++; } + else if (strcmp(argv[i], "-d") == 0) + { + UnityFixture.DryRun = 1; + i++; + } else if (strcmp(argv[i], "-g") == 0) { i++; @@ -245,6 +266,14 @@ int UnityGetCommandLineOptions(int argc, const char* argv[]) UnityFixture.GroupFilter = argv[i]; i++; } + else if (strcmp(argv[i], "-G") == 0) + { + i++; + if (i >= argc) + return 1; + UnityFixture.Group= argv[i]; + i++; + } else if (strcmp(argv[i], "-n") == 0) { i++; @@ -253,6 +282,14 @@ int UnityGetCommandLineOptions(int argc, const char* argv[]) UnityFixture.NameFilter = argv[i]; i++; } + else if (strcmp(argv[i], "-N") == 0) + { + i++; + if (i >= argc) + return 1; + UnityFixture.Name = argv[i]; + i++; + } else if (strcmp(argv[i], "-r") == 0) { UnityFixture.RepeatCount = 2; diff --git a/extras/fixture/src/unity_fixture.h b/extras/fixture/src/unity_fixture.h index 657506628..fa2fc5be8 100644 --- a/extras/fixture/src/unity_fixture.h +++ b/extras/fixture/src/unity_fixture.h @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_FIXTURE_H_ #define UNITY_FIXTURE_H_ diff --git a/extras/fixture/src/unity_fixture_internals.h b/extras/fixture/src/unity_fixture_internals.h index 1c51aa986..b2aff1f63 100644 --- a/extras/fixture/src/unity_fixture_internals.h +++ b/extras/fixture/src/unity_fixture_internals.h @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_FIXTURE_INTERNALS_H_ #define UNITY_FIXTURE_INTERNALS_H_ @@ -17,9 +17,12 @@ struct UNITY_FIXTURE_T { int Verbose; int Silent; + int DryRun; unsigned int RepeatCount; const char* NameFilter; + const char* Name; const char* GroupFilter; + const char* Group; }; extern struct UNITY_FIXTURE_T UnityFixture; diff --git a/extras/fixture/test/main/AllTests.c b/extras/fixture/test/main/AllTests.c index 30242cb30..caa3c7ecf 100644 --- a/extras/fixture/test/main/AllTests.c +++ b/extras/fixture/test/main/AllTests.c @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity_fixture.h" diff --git a/extras/fixture/test/template_fixture_tests.c b/extras/fixture/test/template_fixture_tests.c index 18bbb89e8..1b1c9ec64 100644 --- a/extras/fixture/test/template_fixture_tests.c +++ b/extras/fixture/test/template_fixture_tests.c @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity_fixture.h" diff --git a/extras/fixture/test/unity_fixture_Test.c b/extras/fixture/test/unity_fixture_Test.c index 1422b4896..b894d4c08 100644 --- a/extras/fixture/test/unity_fixture_Test.c +++ b/extras/fixture/test/unity_fixture_Test.c @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity_fixture.h" #include @@ -90,23 +90,32 @@ TEST_GROUP(UnityCommandOptions); static int savedVerbose; static unsigned int savedRepeat; +static int savedDryRun; static const char* savedName; static const char* savedGroup; +static const char* savedNameExact; +static const char* savedGroupExact; TEST_SETUP(UnityCommandOptions) { savedVerbose = UnityFixture.Verbose; savedRepeat = UnityFixture.RepeatCount; + savedDryRun = UnityFixture.DryRun; savedName = UnityFixture.NameFilter; savedGroup = UnityFixture.GroupFilter; + savedNameExact = UnityFixture.Name; + savedGroupExact = UnityFixture.Group; } TEST_TEAR_DOWN(UnityCommandOptions) { UnityFixture.Verbose = savedVerbose; UnityFixture.RepeatCount= savedRepeat; + UnityFixture.DryRun = savedDryRun; UnityFixture.NameFilter = savedName; UnityFixture.GroupFilter = savedGroup; + UnityFixture.Name= savedNameExact; + UnityFixture.Group= savedGroup; } @@ -118,8 +127,11 @@ TEST(UnityCommandOptions, DefaultOptions) { UnityGetCommandLineOptions(1, noOptions); TEST_ASSERT_EQUAL(0, UnityFixture.Verbose); + TEST_ASSERT_EQUAL(0, UnityFixture.DryRun); TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.GroupFilter); TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.NameFilter); + TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.Group); + TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.Name); TEST_ASSERT_EQUAL(1, UnityFixture.RepeatCount); } @@ -134,6 +146,17 @@ TEST(UnityCommandOptions, OptionVerbose) TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); } +static const char* dryRun[] = { + "testrunner.exe", + "-d" +}; + +TEST(UnityCommandOptions, OptionDryRun) +{ + TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(2, dryRun)); + TEST_ASSERT_EQUAL(1, UnityFixture.DryRun); +} + static const char* group[] = { "testrunner.exe", "-g", "groupname" @@ -156,6 +179,28 @@ TEST(UnityCommandOptions, OptionSelectTestByName) STRCMP_EQUAL("testname", UnityFixture.NameFilter); } +static const char* groupExact[] = { + "testrunner.exe", + "-G", "groupname" +}; + +TEST(UnityCommandOptions, OptionSelectTestByGroupExact) +{ + TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, groupExact)); + STRCMP_EQUAL("groupname", UnityFixture.Group); +} + +static const char* nameExact[] = { + "testrunner.exe", + "-N", "testname" +}; + +TEST(UnityCommandOptions, OptionSelectTestByNameExact) +{ + TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, nameExact)); + STRCMP_EQUAL("testname", UnityFixture.Name); +} + static const char* repeat[] = { "testrunner.exe", "-r", "99" diff --git a/extras/fixture/test/unity_fixture_TestRunner.c b/extras/fixture/test/unity_fixture_TestRunner.c index 7b78c49c0..cecdcc090 100644 --- a/extras/fixture/test/unity_fixture_TestRunner.c +++ b/extras/fixture/test/unity_fixture_TestRunner.c @@ -1,9 +1,9 @@ -/* Copyright (c) 2010 James Grenning and Contributed to Unity Project - * ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity_fixture.h" @@ -19,8 +19,11 @@ TEST_GROUP_RUNNER(UnityCommandOptions) { RUN_TEST_CASE(UnityCommandOptions, DefaultOptions); RUN_TEST_CASE(UnityCommandOptions, OptionVerbose); + RUN_TEST_CASE(UnityCommandOptions, OptionDryRun); RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByGroup); RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByName); + RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByGroupExact); + RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByNameExact); RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount); RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsSpecificCount); RUN_TEST_CASE(UnityCommandOptions, MultipleOptions); diff --git a/extras/memory/src/unity_memory.c b/extras/memory/src/unity_memory.c index e4dc6654f..c71f77f84 100644 --- a/extras/memory/src/unity_memory.c +++ b/extras/memory/src/unity_memory.c @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #include "unity_memory.h" diff --git a/extras/memory/src/unity_memory.h b/extras/memory/src/unity_memory.h index ccdb826fe..7351be357 100644 --- a/extras/memory/src/unity_memory.h +++ b/extras/memory/src/unity_memory.h @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_MEMORY_OVERRIDES_H_ #define UNITY_MEMORY_OVERRIDES_H_ diff --git a/extras/memory/test/Makefile b/extras/memory/test/Makefile index f3f86ce60..790ab393c 100644 --- a/extras/memory/test/Makefile +++ b/extras/memory/test/Makefile @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + CC = gcc ifeq ($(shell uname -s), Darwin) CC = clang diff --git a/extras/memory/test/unity_memory_Test.c b/extras/memory/test/unity_memory_Test.c index 6f832e276..1e6541015 100644 --- a/extras/memory/test/unity_memory_Test.c +++ b/extras/memory/test/unity_memory_Test.c @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #include "unity_memory.h" diff --git a/extras/memory/test/unity_memory_TestRunner.c b/extras/memory/test/unity_memory_TestRunner.c index 4c91a5995..9fe2ead10 100644 --- a/extras/memory/test/unity_memory_TestRunner.c +++ b/extras/memory/test/unity_memory_TestRunner.c @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #include "unity_memory.h" diff --git a/extras/memory/test/unity_output_Spy.c b/extras/memory/test/unity_output_Spy.c index 772fe0bdf..e5b6db0f1 100644 --- a/extras/memory/test/unity_output_Spy.c +++ b/extras/memory/test/unity_output_Spy.c @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #include "unity_output_Spy.h" diff --git a/extras/memory/test/unity_output_Spy.h b/extras/memory/test/unity_output_Spy.h index e2e401c48..8c2dd3158 100644 --- a/extras/memory/test/unity_output_Spy.h +++ b/extras/memory/test/unity_output_Spy.h @@ -1,8 +1,9 @@ -/* ========================================== - * Unity Project - A Test Framework for C - * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - * [Released under MIT License. Please refer to license.txt for details] - * ========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_OUTPUT_SPY_H #define UNITY_OUTPUT_SPY_H diff --git a/library.json b/library.json index 914f5f687..839b5abd3 100644 --- a/library.json +++ b/library.json @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + { "name": "Unity", "version": "2.6.0", diff --git a/meson.build b/meson.build index 6585129c9..f510d8574 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 8e66784b8..264480cfa 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/platformio-build.py b/platformio-build.py index 66fea42fb..51251ddd6 100644 --- a/platformio-build.py +++ b/platformio-build.py @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + import os Import("env") diff --git a/src/unity.c b/src/unity.c index cc2e5ce1e..4b1aea6cd 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1,8 +1,9 @@ /* ========================================================================= - Unity Project - A Test Framework for C - Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -============================================================================ */ + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" @@ -60,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 *-----------------------------------------------*/ @@ -184,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) { @@ -222,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 { @@ -573,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); @@ -584,6 +625,7 @@ static void UnityAddMsgIfSpecified(const char* msg) UnityPrint(Unity.CurrentDetail2); } } +#endif #endif if (msg) { @@ -708,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; @@ -720,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; } @@ -876,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; } @@ -1027,6 +1110,7 @@ void UnityAssertFloatsWithin(const UNITY_FLOAT delta, } } +#ifndef UNITY_EXCLUDE_FLOAT_PRINT /*-----------------------------------------------*/ void UnityAssertFloatsNotWithin(const UNITY_FLOAT delta, const UNITY_FLOAT expected, @@ -1080,6 +1164,7 @@ void UnityAssertGreaterOrLessFloat(const UNITY_FLOAT threshold, UNITY_FAIL_AND_BAIL; } } +#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ /*-----------------------------------------------*/ void UnityAssertFloatSpecial(const UNITY_FLOAT actual, @@ -1254,6 +1339,7 @@ void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, } } +#ifndef UNITY_EXCLUDE_FLOAT_PRINT /*-----------------------------------------------*/ void UnityAssertDoublesNotWithin(const UNITY_DOUBLE delta, const UNITY_DOUBLE expected, @@ -1307,6 +1393,7 @@ void UnityAssertGreaterOrLessDouble(const UNITY_DOUBLE threshold, UNITY_FAIL_AND_BAIL; } } +#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ /*-----------------------------------------------*/ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, @@ -1376,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; } @@ -1567,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; } @@ -1804,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; } @@ -1936,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') { @@ -1953,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; @@ -2126,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; } @@ -2194,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()) { @@ -2262,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 *-----------------------------------------------*/ @@ -2270,6 +2396,7 @@ int UnityEnd(void) char* UnityOptionIncludeNamed = NULL; char* UnityOptionExcludeNamed = NULL; int UnityVerbosity = 1; +int UnityStrictMatch = 0; /*-----------------------------------------------*/ int UnityParseOptions(int argc, char** argv) @@ -2277,6 +2404,7 @@ int UnityParseOptions(int argc, char** argv) int i; UnityOptionIncludeNamed = NULL; UnityOptionExcludeNamed = NULL; + UnityStrictMatch = 0; for (i = 1; i < argc; i++) { @@ -2288,6 +2416,7 @@ int UnityParseOptions(int argc, char** argv) return -1; case 'n': /* include tests with name including this string */ case 'f': /* an alias for -n */ + UnityStrictMatch = (argv[i][1] == 'n'); /* strictly match this string if -n */ if (argv[i][2] == '=') { UnityOptionIncludeNamed = &argv[i][3]; @@ -2329,6 +2458,18 @@ int UnityParseOptions(int argc, char** argv) UnityPrint("ERROR: Unknown Option "); UNITY_OUTPUT_CHAR(argv[i][1]); UNITY_PRINT_EOL(); + /* Now display help */ + /* FALLTHRU */ + case 'h': + UnityPrint("Options: "); UNITY_PRINT_EOL(); + UnityPrint("-l List all tests and exit"); UNITY_PRINT_EOL(); + UnityPrint("-f NAME Filter to run only tests whose name includes NAME"); UNITY_PRINT_EOL(); + UnityPrint("-n NAME Run only the test named NAME"); UNITY_PRINT_EOL(); + UnityPrint("-h show this Help menu"); UNITY_PRINT_EOL(); + UnityPrint("-q Quiet/decrease verbosity"); UNITY_PRINT_EOL(); + UnityPrint("-v increase Verbosity"); UNITY_PRINT_EOL(); + UnityPrint("-x NAME eXclude tests whose name includes NAME"); UNITY_PRINT_EOL(); + UNITY_OUTPUT_FLUSH(); return 1; } } @@ -2338,7 +2479,7 @@ int UnityParseOptions(int argc, char** argv) } /*-----------------------------------------------*/ -int IsStringInBiggerString(const char* longstring, const char* shortstring) +static int IsStringInBiggerString(const char* longstring, const char* shortstring) { const char* lptr = longstring; const char* sptr = shortstring; @@ -2346,7 +2487,7 @@ int IsStringInBiggerString(const char* longstring, const char* shortstring) if (*sptr == '*') { - return 1; + return UnityStrictMatch ? 0 : 1; } while (*lptr) @@ -2359,19 +2500,29 @@ int IsStringInBiggerString(const char* longstring, const char* shortstring) lptr++; sptr++; - /* We're done if we match the entire string or up to a wildcard */ - if (*sptr == '*') - return 1; - if (*sptr == ',') - return 1; - if (*sptr == '"') - return 1; - if (*sptr == '\'') - return 1; - if (*sptr == ':') - return 2; - if (*sptr == 0) - return 1; + switch (*sptr) + { + case '*': /* we encountered a wild-card */ + return UnityStrictMatch ? 0 : 1; + + case ',': /* we encountered the end of match string */ + case '"': + case '\'': + case 0: + return (!UnityStrictMatch || (*lptr == 0)) ? 1 : 0; + + case ':': /* we encountered the end of a partial match */ + return 2; + + default: + break; + } + } + + /* If we didn't match and we're on strict matching, we already know we failed */ + if (UnityStrictMatch) + { + return 0; } /* Otherwise we start in the long pointer 1 character further and try again */ @@ -2383,7 +2534,7 @@ int IsStringInBiggerString(const char* longstring, const char* shortstring) } /*-----------------------------------------------*/ -int UnityStringArgumentMatches(const char* str) +static int UnityStringArgumentMatches(const char* str) { int retval; const char* ptr1; diff --git a/src/unity.h b/src/unity.h index 265e548d6..63109130b 100644 --- a/src/unity.h +++ b/src/unity.h @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_FRAMEWORK_H #define UNITY_FRAMEWORK_H @@ -10,7 +11,7 @@ #define UNITY_VERSION_MAJOR 2 #define UNITY_VERSION_MINOR 6 -#define UNITY_VERSION_BUILD 0 +#define UNITY_VERSION_BUILD 2 #define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD) #ifdef __cplusplus @@ -44,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 65938ff76..da17059f0 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #ifndef UNITY_INTERNALS_H #define UNITY_INTERNALS_H @@ -46,38 +47,58 @@ #define UNITY_FUNCTION_ATTR(a) /* ignore */ #endif -#ifndef UNITY_NORETURN - #if defined(__cplusplus) - #if __cplusplus >= 201103L +/* UNITY_NORETURN is only required if we have setjmp.h. */ +#ifndef UNITY_EXCLUDE_SETJMP_H + #ifndef UNITY_NORETURN + #if defined(__cplusplus) + #if __cplusplus >= 201103L + #define UNITY_NORETURN [[ noreturn ]] + #endif + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L + /* _Noreturn keyword is used from C11 but deprecated in C23. */ + #if defined(_WIN32) && defined(_MSC_VER) + /* We are using MSVC compiler on Windows platform. */ + /* Not all Windows SDKs supports , but compiler can support C11: */ + /* https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/ */ + /* Not sure, that Mingw compilers has Windows SDK headers at all. */ + #include + #endif + + /* Using Windows SDK predefined macro for detecting supported SDK with MSVC compiler. */ + /* Mingw GCC should work without that fixes. */ + /* Based on: */ + /* https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170 */ + /* NTDDI_WIN10_FE is equal to Windows 10 SDK 2104 */ + #if defined(_MSC_VER) && ((!defined(NTDDI_WIN10_FE)) || WDK_NTDDI_VERSION < NTDDI_WIN10_FE) + /* Based on tests and: */ + /* https://docs.microsoft.com/en-us/cpp/c-language/noreturn?view=msvc-170 */ + /* https://en.cppreference.com/w/c/language/_Noreturn */ + #define UNITY_NORETURN _Noreturn + #else /* Using newer Windows SDK or not MSVC compiler */ + #if defined(__GNUC__) + /* The header collides with __attribute(noreturn)__ from GCC. */ + #define UNITY_NORETURN _Noreturn + #else + #include + #define UNITY_NORETURN noreturn + #endif + #endif + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + /* 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 ]] - #endif - #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - #if defined(_WIN32) && defined(_MSC_VER) - /* We are using MSVC compiler on Windows platform. */ - /* Not all Windows SDKs supports , but compiler can support C11: */ - /* https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/ */ - /* Not sure, that Mingw compilers has Windows SDK headers at all. */ - #include - #endif - - /* Using Windows SDK predefined macro for detecting supported SDK with MSVC compiler. */ - /* Mingw GCC should work without that fixes. */ - /* Based on: */ - /* https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170 */ - /* NTDDI_WIN10_FE is equal to Windows 10 SDK 2104 */ - #if defined(_MSC_VER) && ((!defined(NTDDI_WIN10_FE)) || WDK_NTDDI_VERSION < NTDDI_WIN10_FE) + #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://docs.microsoft.com/en-us/cpp/c-language/noreturn?view=msvc-170 */ - /* https://en.cppreference.com/w/c/language/_Noreturn */ - #define UNITY_NORETURN _Noreturn - #else /* Using newer Windows SDK or not MSVC compiler */ - #include - #define UNITY_NORETURN noreturn + /* 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 -#endif -#ifndef UNITY_NORETURN - #define UNITY_NORETURN UNITY_FUNCTION_ATTR(__noreturn__) + #ifndef UNITY_NORETURN + #define UNITY_NORETURN UNITY_FUNCTION_ATTR(__noreturn__) + #endif #endif /*------------------------------------------------------- @@ -466,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 @@ -498,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; @@ -547,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 @@ -558,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 @@ -576,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); @@ -593,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, @@ -646,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, @@ -874,103 +968,103 @@ int UnityTestMatches(void); * Test Asserts *-------------------------------------------------------*/ -#define UNITY_TEST_ASSERT(condition, line, message) do { if (condition) { /* nothing*/ } else { UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message)); } } while (0) -#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message)) -#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message)) -#define UNITY_TEST_ASSERT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (UNITY_LINE_TYPE)(line), (message)) -#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (UNITY_LINE_TYPE)(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(condition, line, message) do { if (condition) { /* nothing*/ } else { UNITY_TEST_FAIL((line), (message)); } } while (0) +#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (line), (message)) +#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (line), (message)) +#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) 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) @@ -983,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) @@ -1024,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) @@ -1165,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/.rubocop.yml b/test/.rubocop.yml index a3b811bd1..a11c2461c 100644 --- a/test/.rubocop.yml +++ b/test/.rubocop.yml @@ -1,4 +1,9 @@ -# This is the configuration used to check the rubocop source code. +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= #inherit_from: .rubocop_todo.yml diff --git a/test/Makefile b/test/Makefile index 5be0488f1..35c2822bf 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,16 +1,22 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= CC = gcc ifeq ($(shell uname -s), Darwin) 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 #DEBUG = -O0 -g diff --git a/test/rakefile b/test/rakefile index e5f3b748f..f278d42c4 100644 --- a/test/rakefile +++ b/test/rakefile @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= $verbose = false $extra_paths = [] diff --git a/test/rakefile_helper.rb b/test/rakefile_helper.rb index 1a9fc3342..cabcc9951 100644 --- a/test/rakefile_helper.rb +++ b/test/rakefile_helper.rb @@ -1,8 +1,9 @@ -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require 'fileutils' require_relative '../auto/unity_test_summary' diff --git a/test/spec/generate_module_existing_file_spec.rb b/test/spec/generate_module_existing_file_spec.rb index 74e7fc840..732e6d731 100644 --- a/test/spec/generate_module_existing_file_spec.rb +++ b/test/spec/generate_module_existing_file_spec.rb @@ -1,3 +1,9 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require '../auto/generate_module.rb' require 'fileutils' diff --git a/test/targets/ansi.yml b/test/targets/ansi.yml index 81af4c7f5..c09642fdf 100644 --- a/test/targets/ansi.yml +++ b/test/targets/ansi.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/clang_file.yml b/test/targets/clang_file.yml index 964e8145c..1c4ed5371 100644 --- a/test/targets/clang_file.yml +++ b/test/targets/clang_file.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/clang_strict.yml b/test/targets/clang_strict.yml index f124e8fdd..110173508 100644 --- a/test/targets/clang_strict.yml +++ b/test/targets/clang_strict.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/gcc_32.yml b/test/targets/gcc_32.yml index ba388cf72..5a17b3070 100644 --- a/test/targets/gcc_32.yml +++ b/test/targets/gcc_32.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/gcc_64.yml b/test/targets/gcc_64.yml index ed9eb4a80..104cf7d73 100644 --- a/test/targets/gcc_64.yml +++ b/test/targets/gcc_64.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/gcc_auto_limits.yml b/test/targets/gcc_auto_limits.yml index 9cfda8d4a..3da6922bc 100644 --- a/test/targets/gcc_auto_limits.yml +++ b/test/targets/gcc_auto_limits.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/gcc_auto_stdint.yml b/test/targets/gcc_auto_stdint.yml index 66602ef71..9697ff745 100644 --- a/test/targets/gcc_auto_stdint.yml +++ b/test/targets/gcc_auto_stdint.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/gcc_manual_math.yml b/test/targets/gcc_manual_math.yml index b1b5b82e5..0524f727f 100644 --- a/test/targets/gcc_manual_math.yml +++ b/test/targets/gcc_manual_math.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- colour: true :unity: diff --git a/test/targets/hitech_picc18.yml b/test/targets/hitech_picc18.yml index b984edbd8..8dc912958 100644 --- a/test/targets/hitech_picc18.yml +++ b/test/targets/hitech_picc18.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- :cmock: :plugins: [] diff --git a/test/targets/iar_arm_v4.yml b/test/targets/iar_arm_v4.yml index 9a1a2761e..74d137de2 100644 --- a/test/targets/iar_arm_v4.yml +++ b/test/targets/iar_arm_v4.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ colour: true diff --git a/test/targets/iar_arm_v5.yml b/test/targets/iar_arm_v5.yml index d4b115f14..cd0930d00 100644 --- a/test/targets/iar_arm_v5.yml +++ b/test/targets/iar_arm_v5.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3\ colour: true diff --git a/test/targets/iar_arm_v5_3.yml b/test/targets/iar_arm_v5_3.yml index d4b115f14..cd0930d00 100644 --- a/test/targets/iar_arm_v5_3.yml +++ b/test/targets/iar_arm_v5_3.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3\ colour: true diff --git a/test/targets/iar_armcortex_LM3S9B92_v5_4.yml b/test/targets/iar_armcortex_LM3S9B92_v5_4.yml index 1703fe27c..1fc07c6ff 100644 --- a/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +++ b/test/targets/iar_armcortex_LM3S9B92_v5_4.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ colour: true diff --git a/test/targets/iar_cortexm3_v5.yml b/test/targets/iar_cortexm3_v5.yml index 8b0978ffa..c5d6ad281 100644 --- a/test/targets/iar_cortexm3_v5.yml +++ b/test/targets/iar_cortexm3_v5.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.4\ colour: true diff --git a/test/targets/iar_msp430.yml b/test/targets/iar_msp430.yml index 65872535f..de89245f0 100644 --- a/test/targets/iar_msp430.yml +++ b/test/targets/iar_msp430.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ core_root: &1 diff --git a/test/targets/iar_sh2a_v6.yml b/test/targets/iar_sh2a_v6.yml index b4371cd0a..8e5ded4b1 100644 --- a/test/targets/iar_sh2a_v6.yml +++ b/test/targets/iar_sh2a_v6.yml @@ -1,3 +1,10 @@ +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= + --- tools_root: C:\Program Files\IAR Systems\Embedded Workbench 6.0\ colour: true diff --git a/test/testdata/CException.h b/test/testdata/CException.h index 3872fa75f..c4c58edd8 100644 --- a/test/testdata/CException.h +++ b/test/testdata/CException.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #ifndef CEXCEPTION_H #define CEXCEPTION_H diff --git a/test/testdata/Defs.h b/test/testdata/Defs.h index 58678c124..ec83d6fd4 100644 --- a/test/testdata/Defs.h +++ b/test/testdata/Defs.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #ifndef DEF_H #define DEF_H diff --git a/test/testdata/cmock.h b/test/testdata/cmock.h index 33ddbfc56..37efb0b13 100644 --- a/test/testdata/cmock.h +++ b/test/testdata/cmock.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #ifndef CMOCK_H #define CMOCK_H diff --git a/test/testdata/mockMock.h b/test/testdata/mockMock.h index 5c6829d77..0aa5a0053 100644 --- a/test/testdata/mockMock.h +++ b/test/testdata/mockMock.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #ifndef MOCK_MOCK_H #define MOCK_MOCK_H diff --git a/test/testdata/testRunnerGenerator.c b/test/testdata/testRunnerGenerator.c index 475e24357..ef8f46847 100644 --- a/test/testdata/testRunnerGenerator.c +++ b/test/testdata/testRunnerGenerator.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + /* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ #include diff --git a/test/testdata/testRunnerGeneratorSmall.c b/test/testdata/testRunnerGeneratorSmall.c index 58bc65c0d..076efff7a 100644 --- a/test/testdata/testRunnerGeneratorSmall.c +++ b/test/testdata/testRunnerGeneratorSmall.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + /* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ #include diff --git a/test/testdata/testRunnerGeneratorWithMocks.c b/test/testdata/testRunnerGeneratorWithMocks.c index d48692ede..5bacd4b39 100644 --- a/test/testdata/testRunnerGeneratorWithMocks.c +++ b/test/testdata/testRunnerGeneratorWithMocks.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + /* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ #include diff --git a/test/tests/self_assessment_utils.h b/test/tests/self_assessment_utils.h index c8cb595db..95822bf08 100644 --- a/test/tests/self_assessment_utils.h +++ b/test/tests/self_assessment_utils.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #ifdef TEST_INSTANCES #include @@ -62,8 +69,13 @@ static const UNITY_DOUBLE d_zero = 0.0; #define SPY_BUFFER_MAX 40 static char putcharSpyBuffer[SPY_BUFFER_MAX]; #endif -static int indexSpyBuffer; -static int putcharSpyEnabled; +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) { @@ -101,8 +113,8 @@ void putcharSpy(int c) } /* This is for counting the calls to the flushSpy */ -static int flushSpyEnabled; -static int flushSpyCalls = 0; +static UNITY_COUNTER_TYPE flushSpyEnabled; +static UNITY_COUNTER_TYPE flushSpyCalls = 0; void startFlushSpy(void) { @@ -116,7 +128,7 @@ void endFlushSpy(void) flushSpyEnabled = 0; } -int getFlushSpyCalls(void) +UNITY_COUNTER_TYPE getFlushSpyCalls(void) { return flushSpyCalls; } @@ -126,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 658b6e2ec..5e0133f0e 100644 --- a/test/tests/test_generate_test_runner.rb +++ b/test/tests/test_generate_test_runner.rb @@ -1,8 +1,9 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== +# ========================================================================= +# Unity - A Test Framework for C +# ThrowTheSwitch.org +# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams +# SPDX-License-Identifier: MIT +# ========================================================================= require '../auto/generate_test_runner.rb' @@ -739,7 +740,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n test_", + :cmdline_args => "-f test_", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'test_NotBeConfusedByLongComplicatedStrings', @@ -757,7 +758,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n should_", + :cmdline_args => "-f should_", :expected => { :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], :to_fail => [ ], @@ -771,7 +772,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n should_,test_", + :cmdline_args => "-f should_,test_", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'test_NotBeConfusedByLongComplicatedStrings', @@ -789,7 +790,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n=testRunnerGeneratorSma*", + :cmdline_args => "-f=testRunnerGeneratorSma*", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'spec_ThisTestPassesWhenNormalSetupRan', @@ -805,7 +806,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGeneratorSmall:*", + :cmdline_args => "-f testRunnerGeneratorSmall:*", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'spec_ThisTestPassesWhenNormalSetupRan', @@ -821,7 +822,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGeneratorSmall:test_*", + :cmdline_args => "-f testRunnerGeneratorSmall:test_*", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ 'test_ThisTestAlwaysFails' ], @@ -835,7 +836,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGeneratorSmall:te*", + :cmdline_args => "-f testRunnerGeneratorSmall:te*", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ 'test_ThisTestAlwaysFails' ], @@ -849,7 +850,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGeneratorSm*:*", + :cmdline_args => "-f testRunnerGeneratorSm*:*", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'spec_ThisTestPassesWhenNormalSetupRan', @@ -884,7 +885,7 @@ :cmdline_args => true, :includes => ['Defs.h'], }, - :cmdline_args => "-n test_ -x Ignored", + :cmdline_args => "-f test_ -x Ignored", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'test_NotBeConfusedByLongComplicatedStrings', @@ -902,7 +903,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n ThisTestAlwaysPasses", + :cmdline_args => "-f ThisTestAlwaysPasses", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ ], @@ -916,7 +917,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGenerator:ThisTestAlwaysPasses", + :cmdline_args => "-f testRunnerGenerator:ThisTestAlwaysPasses", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ ], @@ -930,7 +931,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGenerator.c:ThisTestAlwaysPasses", + :cmdline_args => "-f testRunnerGenerator.c:ThisTestAlwaysPasses", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ ], @@ -944,7 +945,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n \"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"", + :cmdline_args => "-f \"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ 'test_ThisTestAlwaysFails' ], @@ -958,7 +959,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n 'testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails'", + :cmdline_args => "-f 'testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails'", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses' ], :to_fail => [ 'test_ThisTestAlwaysFails' ], @@ -966,13 +967,55 @@ } }, + { :name => 'ArgsHandlePreciseMatch', + :testfile => 'testdata/testRunnerGenerator.c', + :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], + :options => { + :cmdline_args => true, + }, + :cmdline_args => "-n 'test_ThisTestAlwaysPasses'", + :expected => { + :to_pass => [ 'test_ThisTestAlwaysPasses' ], + :to_fail => [ ], + :to_ignore => [ ], + } + }, + + { :name => 'ArgsHandlePreciseMatches', + :testfile => 'testdata/testRunnerGenerator.c', + :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], + :options => { + :cmdline_args => true, + }, + :cmdline_args => "-n 'test_ThisTestAlwaysPasses,test_ThisTestAlwaysFails'", + :expected => { + :to_pass => [ 'test_ThisTestAlwaysPasses' ], + :to_fail => [ 'test_ThisTestAlwaysFails' ], + :to_ignore => [ ], + } + }, + + { :name => 'ArgsRequiresPreciseMatchNotPartial', + :testfile => 'testdata/testRunnerGenerator.c', + :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], + :options => { + :cmdline_args => true, + }, + :cmdline_args => "-n ThisTestAlwaysPass", + :expected => { + :to_pass => [ ], + :to_fail => [ ], + :to_ignore => [ ], + } + }, + { :name => 'ArgsIncludeAValidTestForADifferentFile', :testfile => 'testdata/testRunnerGenerator.c', :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], :options => { :cmdline_args => true, }, - :cmdline_args => "-n AnotherFile:ThisTestDoesNotExist", + :cmdline_args => "-f AnotherFile:ThisTestDoesNotExist", :expected => { :to_pass => [ ], :to_fail => [ ], @@ -986,7 +1029,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n ThisTestDoesNotExist", + :cmdline_args => "-f ThisTestDoesNotExist", :expected => { :to_pass => [ ], :to_fail => [ ], @@ -1014,7 +1057,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n testRunnerGenerator", + :cmdline_args => "-f testRunnerGenerator", :expected => { :to_pass => [ 'test_ThisTestAlwaysPasses', 'spec_ThisTestPassesWhenNormalSetupRan', @@ -1052,7 +1095,7 @@ :cmdline_args => true, :test_prefix => "paratest" }, - :cmdline_args => "-n ShouldHandleParameterizedTests", + :cmdline_args => "-f ShouldHandleParameterizedTests", :features => [ :parameterized ], :expected => { :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', @@ -1123,7 +1166,7 @@ :options => { :cmdline_args => true, }, - :cmdline_args => "-n", + :cmdline_args => "-f", :expected => { :to_pass => [ ], :to_fail => [ ], @@ -1158,7 +1201,41 @@ :to_pass => [ ], :to_fail => [ ], :to_ignore => [ ], - :text => [ "ERROR: Unknown Option z" ], + :text => [ + "ERROR: Unknown Option z", + "Options:", + "-l List all tests and exit", + "-f NAME Filter to run only tests whose name includes NAME", + "-n NAME Run only the test named NAME", + "-h show this Help menu", + "-q Quiet/decrease verbosity", + "-v increase Verbosity", + "-x NAME eXclude tests whose name includes NAME", + ], + } + }, + + { :name => 'ArgsHelp', + :testfile => 'testdata/testRunnerGenerator.c', + :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], + :options => { + :cmdline_args => true, + }, + :cmdline_args => "-h", + :expected => { + :to_pass => [ ], + :to_fail => [ ], + :to_ignore => [ ], + :text => [ + "Options:", + "-l List all tests and exit", + "-f NAME Filter to run only tests whose name includes NAME", + "-n NAME Run only the test named NAME", + "-h show this Help menu", + "-q Quiet/decrease verbosity", + "-v increase Verbosity", + "-x NAME eXclude tests whose name includes NAME", + ], } }, ] diff --git a/test/tests/test_unity_arrays.c b/test/tests/test_unity_arrays.c index 598488368..9e811258d 100644 --- a/test/tests/test_unity_arrays.c +++ b/test/tests/test_unity_arrays.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES @@ -61,7 +62,7 @@ void testInt64ArrayWithinDeltaAndMessage(void) #endif } -void tesUInt64ArrayNotWithinDelta(void) +void testInt64ArrayNotWithinDelta(void) { #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); diff --git a/test/tests/test_unity_core.c b/test/tests/test_unity_core.c index d324e8619..dc3a1bf4c 100644 --- a/test/tests/test_unity_core.c +++ b/test/tests/test_unity_core.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES @@ -60,7 +61,7 @@ void testUnitySizeInitializationReminder(void) #ifndef UNITY_EXCLUDE_SETJMP_H jmp_buf AbortFrame; #endif - } _Expected_Unity; + } Expected_Unity; #else struct { const char* TestFile; @@ -80,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 @@ -88,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"); @@ -281,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(); @@ -292,13 +293,16 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void) #ifndef USING_OUTPUT_SPY TEST_IGNORE(); #else - UNITY_UINT savedFailures = Unity.TestFailures; + int failures = 0; + UNITY_COUNTER_TYPE savedGetFlushSpyCalls = 0; + UNITY_COUNTER_TYPE savedFailures = Unity.TestFailures; Unity.CurrentTestFailed = 1; startPutcharSpy(); /* Suppress output */ startFlushSpy(); - TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); + savedGetFlushSpyCalls = getFlushSpyCalls(); UnityConcludeTest(); endPutcharSpy(); + TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls); TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures); #if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION) TEST_ASSERT_EQUAL(1, getFlushSpyCalls()); @@ -308,7 +312,7 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void) endFlushSpy(); startPutcharSpy(); /* Suppress output */ - int failures = UnityEnd(); + failures = UnityEnd(); Unity.TestFailures--; endPutcharSpy(); TEST_ASSERT_EQUAL(savedFailures + 1, failures); diff --git a/test/tests/test_unity_doubles.c b/test/tests/test_unity_doubles.c index 0ad9494d6..7a41d03b4 100644 --- a/test/tests/test_unity_doubles.c +++ b/test/tests/test_unity_doubles.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES diff --git a/test/tests/test_unity_floats.c b/test/tests/test_unity_floats.c index 9e92f96a5..e02c65632 100644 --- a/test/tests/test_unity_floats.c +++ b/test/tests/test_unity_floats.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES @@ -1207,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) @@ -1256,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) @@ -1367,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 d615e5f0c..495d87da3 100644 --- a/test/tests/test_unity_integers.c +++ b/test/tests/test_unity_integers.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES diff --git a/test/tests/test_unity_integers_64.c b/test/tests/test_unity_integers_64.c index 867d1e797..e6a965aac 100644 --- a/test/tests/test_unity_integers_64.c +++ b/test/tests/test_unity_integers_64.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES @@ -61,7 +62,7 @@ void testInt64ArrayWithinDeltaAndMessage(void) #endif } -void tesUInt64ArrayNotWithinDelta(void) +void testInt64ArrayNotWithinDelta(void) { #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); diff --git a/test/tests/test_unity_memory.c b/test/tests/test_unity_memory.c index b3cff1319..7ee48d2bc 100644 --- a/test/tests/test_unity_memory.c +++ b/test/tests/test_unity_memory.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES diff --git a/test/tests/test_unity_parameterized.c b/test/tests/test_unity_parameterized.c index aa9f9c16a..805989335 100644 --- a/test/tests/test_unity_parameterized.c +++ b/test/tests/test_unity_parameterized.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include #include diff --git a/test/tests/test_unity_parameterizedDemo.c b/test/tests/test_unity_parameterizedDemo.c index 83dfad668..d0ea9626e 100644 --- a/test/tests/test_unity_parameterizedDemo.c +++ b/test/tests/test_unity_parameterizedDemo.c @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #include "unity.h" /* Support for Meta Test Rig */ diff --git a/test/tests/test_unity_strings.c b/test/tests/test_unity_strings.c index 964c5536d..bb38ecbbd 100644 --- a/test/tests/test_unity_strings.c +++ b/test/tests/test_unity_strings.c @@ -1,8 +1,9 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ #include "unity.h" #define TEST_INSTANCES diff --git a/test/tests/types_for_test.h b/test/tests/types_for_test.h index 6da4e5154..00f580d3c 100644 --- a/test/tests/types_for_test.h +++ b/test/tests/types_for_test.h @@ -1,3 +1,10 @@ +/* ========================================================================= + Unity - A Test Framework for C + ThrowTheSwitch.org + Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams + SPDX-License-Identifier: MIT +========================================================================= */ + #pragma once typedef enum {