diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 339bd23a..f0b6d930 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: # 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/README.md b/README.md index 71488b3e..2ebf988e 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. diff --git a/auto/run_test.erb b/auto/run_test.erb index 68b33730..e334d657 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/src/unity.c b/src/unity.c index 7fd703ab..c91c3853 100644 --- a/src/unity.c +++ b/src/unity.c @@ -2351,7 +2351,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; @@ -2396,7 +2396,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_internals.h b/src/unity_internals.h index 1214bf07..ca962af1 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -875,11 +875,11 @@ 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(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) 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) diff --git a/test/tests/test_unity_core.c b/test/tests/test_unity_core.c index 094d48a5..6638fb94 100644 --- a/test/tests/test_unity_core.c +++ b/test/tests/test_unity_core.c @@ -300,8 +300,8 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void) startFlushSpy(); savedGetFlushSpyCalls = getFlushSpyCalls(); UnityConcludeTest(); - TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls); 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());