From 772c6bba3b5ee149fcf9c683baada553cccf4aec Mon Sep 17 00:00:00 2001 From: Paul Calton Date: Thu, 29 Feb 2024 17:19:23 +0000 Subject: [PATCH] No calls to assert macros until after UnityConcludeTest clears CurrentTestFailed --- test/tests/test_unity_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tests/test_unity_core.c b/test/tests/test_unity_core.c index d324e861..4bc16088 100644 --- a/test/tests/test_unity_core.c +++ b/test/tests/test_unity_core.c @@ -296,8 +296,9 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void) Unity.CurrentTestFailed = 1; startPutcharSpy(); /* Suppress output */ startFlushSpy(); - TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); + UNITY_UINT savedGetFlushSpyCalls = getFlushSpyCalls(); UnityConcludeTest(); + TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls); endPutcharSpy(); TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures); #if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION)