From 1be9a7d4f52ccc71206f48a89465db39bcd7095b Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Fri, 23 Jan 2026 14:07:04 -0500 Subject: [PATCH] cleanup of warnings --- README.md | 2 +- auto/generate_test_runner.rb | 10 ++++------ auto/unity_test_summary.rb | 0 src/unity.c | 5 ++--- src/unity_internals.h | 8 ++++++++ 5 files changed, 15 insertions(+), 10 deletions(-) mode change 100644 => 100755 auto/unity_test_summary.rb diff --git a/README.md b/README.md index 6be02aa..ac0ac38 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Unity Test ![CI][] -__Copyright (c) 2007 - 2024 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__ +__Copyright (c) 2007 - 2026 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. diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 2b2cf61..11d8e51 100755 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -239,17 +239,15 @@ class UnityTestRunnerGenerator if @options[:use_param_tests] idx = 0 tests.each do |test| - if (test[:args].nil? || test[:args].empty?) + if test[:args].nil? || test[:args].empty? idx += 1 else - test[:args].each do |args| - idx += 1 - end + test[:args].each { idx += 1 } end end - return idx + idx else - return tests.size + tests.size end end diff --git a/auto/unity_test_summary.rb b/auto/unity_test_summary.rb old mode 100644 new mode 100755 diff --git a/src/unity.c b/src/unity.c index 4b1aea6..198577c 100644 --- a/src/unity.c +++ b/src/unity.c @@ -868,6 +868,8 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, const UNITY_DISPLAY_STYLE_T style, const UNITY_FLAGS_T flags) { + UNITY_INT expect_val = 0; + UNITY_INT actual_val = 0; UNITY_UINT32 elements = num_elements; unsigned int length = style & 0xF; unsigned int increment = 0; @@ -895,9 +897,6 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, while ((elements > 0) && (elements--)) { - UNITY_INT expect_val; - UNITY_INT actual_val; - switch (length) { case 1: diff --git a/src/unity_internals.h b/src/unity_internals.h index da17059..80143b0 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -528,6 +528,10 @@ typedef enum #endif #endif +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpadded" +#endif struct UNITY_STORAGE_T { const char* TestFile; @@ -556,6 +560,9 @@ struct UNITY_STORAGE_T jmp_buf AbortFrame; #endif }; +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif extern struct UNITY_STORAGE_T Unity; @@ -857,6 +864,7 @@ extern const char UnityStrErrFloat[]; extern const char UnityStrErrDouble[]; extern const char UnityStrErr64[]; extern const char UnityStrErrShorthand[]; +extern const char UnityStrErrDetailStack[]; /*------------------------------------------------------- * Test Running Macros