From e038ae2ade1e9436322a92a043d3a5abf3866a6e Mon Sep 17 00:00:00 2001 From: Fabian Zahn Date: Sun, 18 Feb 2018 18:44:58 +0100 Subject: [PATCH] Refactored the test evaluation of the flushSpy --- test/Makefile | 1 - test/tests/testunity.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/Makefile b/test/Makefile index f3981bd..89ece81 100644 --- a/test/Makefile +++ b/test/Makefile @@ -17,7 +17,6 @@ DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=putcharSpy\(int\) DEFINES += -D UNITY_OUTPUT_FLUSH=flushSpy DEFINES += -D UNITY_OUTPUT_FLUSH_HEADER_DECLARATION=flushSpy\(void\) -DEFINES += -D USING_FLUSH_SPY DEFINES += $(UNITY_SUPPORT_64) $(UNITY_INCLUDE_DOUBLE) UNITY_SUPPORT_64 = -D UNITY_SUPPORT_64 UNITY_INCLUDE_DOUBLE = -D UNITY_INCLUDE_DOUBLE diff --git a/test/tests/testunity.c b/test/tests/testunity.c index e05b2ba..95c8280 100644 --- a/test/tests/testunity.c +++ b/test/tests/testunity.c @@ -3357,17 +3357,17 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void) UNITY_UINT savedFailures = Unity.TestFailures; Unity.CurrentTestFailed = 1; startPutcharSpy(); // Suppress output -#ifdef USING_FLUSH_SPY startFlushSpy(); TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); -#endif UnityConcludeTest(); endPutcharSpy(); TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures); -#ifdef USING_FLUSH_SPY +#if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION) TEST_ASSERT_EQUAL(1, getFlushSpyCalls()); - endFlushSpy(); +#else + TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); #endif + endFlushSpy(); startPutcharSpy(); // Suppress output int failures = UnityEnd();