mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-25 01:11:36 +01:00
Added stricter error checks by the compiler, and adapted all impacted code.
Primarily - * Added "static" to static functions. * Added proper signature with "void" to functions without arguments. * Marked unused arguments with "(void)". * Removed entirely unused static functions. * Added "const" to preserve const-correctness. * Added function prototypes for external functions.
This commit is contained in:
12
src/unity.c
12
src/unity.c
@@ -271,7 +271,7 @@ void UnityPrintOk(void)
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
||||
static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
||||
{
|
||||
UnityPrint(file);
|
||||
UNITY_OUTPUT_CHAR(':');
|
||||
@@ -282,7 +282,7 @@ void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
|
||||
static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
|
||||
{
|
||||
UnityTestResultsBegin(Unity.TestFile, line);
|
||||
UnityPrint(UnityStrFail);
|
||||
@@ -312,7 +312,7 @@ void UnityConcludeTest(void)
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
void UnityAddMsgIfSpecified(const char* msg)
|
||||
static void UnityAddMsgIfSpecified(const char* msg)
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
@@ -322,7 +322,7 @@ void UnityAddMsgIfSpecified(const char* msg)
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
|
||||
static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
|
||||
{
|
||||
UnityPrint(UnityStrExpected);
|
||||
if (expected != NULL)
|
||||
@@ -352,7 +352,7 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
||||
// Assertion & Control Helpers
|
||||
//-----------------------------------------------
|
||||
|
||||
int UnityCheckArraysForNull(UNITY_PTR_ATTRIBUTE const void* expected, UNITY_PTR_ATTRIBUTE const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
||||
static int UnityCheckArraysForNull(UNITY_PTR_ATTRIBUTE const void* expected, UNITY_PTR_ATTRIBUTE const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
||||
{
|
||||
//return true if they are both NULL
|
||||
if ((expected == NULL) && (actual == NULL))
|
||||
@@ -1102,6 +1102,8 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
||||
|
||||
//-----------------------------------------------
|
||||
#if defined(UNITY_WEAK_ATTRIBUTE)
|
||||
void setUp(void);
|
||||
void tearDown(void);
|
||||
UNITY_WEAK_ATTRIBUTE void setUp(void) { }
|
||||
UNITY_WEAK_ATTRIBUTE void tearDown(void) { }
|
||||
#elif defined(UNITY_WEAK_PRAGMA)
|
||||
|
||||
Reference in New Issue
Block a user