1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

- Protect against people not defining UNITY_USE_COMMAND)LINES_ARGS but enabling cmd_lines in test runner generator. (Cherry-pick PR 739)

- Fix UNITY_NORETURN usage (Cherry-pick PR 742)
- Other standards and formatting tweaks.
This commit is contained in:
Mark VanderVoord
2024-08-01 16:01:09 -04:00
parent 18fb33921f
commit c546414657
5 changed files with 54 additions and 37 deletions

View File

@@ -17,6 +17,7 @@ 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

View File

@@ -69,8 +69,8 @@ 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;
void startPutcharSpy(void)
{
@@ -108,8 +108,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)
{
@@ -123,7 +123,7 @@ void endFlushSpy(void)
flushSpyEnabled = 0;
}
int getFlushSpyCalls(void)
UNITY_COUNTER_TYPE getFlushSpyCalls(void)
{
return flushSpyCalls;
}

View File

@@ -293,8 +293,9 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
#ifndef USING_OUTPUT_SPY
TEST_IGNORE();
#else
UNITY_UINT savedGetFlushSpyCalls = 0;
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();
@@ -311,7 +312,7 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
endFlushSpy();
startPutcharSpy(); /* Suppress output */
int failures = UnityEnd();
failures = UnityEnd();
Unity.TestFailures--;
endPutcharSpy();
TEST_ASSERT_EQUAL(savedFailures + 1, failures);