mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-25 18:57:58 +08:00
Merge pull request #255 from jsalling/cleanup/function-prototypes
Removing unnecessary function prototypes, inline PrintOk/Fail
This commit is contained in:
25
src/unity.c
25
src/unity.c
@ -93,7 +93,6 @@ void UnityPrint(const char* string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnityPrintLen(const char* string, const UNITY_UINT32 length);
|
|
||||||
void UnityPrintLen(const char* string, const UNITY_UINT32 length)
|
void UnityPrintLen(const char* string, const UNITY_UINT32 length)
|
||||||
{
|
{
|
||||||
const char* pch = string;
|
const char* pch = string;
|
||||||
@ -326,21 +325,6 @@ void UnityPrintFloat(UNITY_DOUBLE number)
|
|||||||
#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */
|
#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
|
|
||||||
void UnityPrintFail(void);
|
|
||||||
void UnityPrintFail(void)
|
|
||||||
{
|
|
||||||
UnityPrint(UnityStrFail);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnityPrintOk(void);
|
|
||||||
void UnityPrintOk(void)
|
|
||||||
{
|
|
||||||
UnityPrint(UnityStrOk);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
|
||||||
static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line);
|
|
||||||
static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
||||||
{
|
{
|
||||||
UnityPrint(file);
|
UnityPrint(file);
|
||||||
@ -352,7 +336,6 @@ static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line);
|
|
||||||
static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
|
static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
|
||||||
{
|
{
|
||||||
UnityTestResultsBegin(Unity.TestFile, line);
|
UnityTestResultsBegin(Unity.TestFile, line);
|
||||||
@ -384,7 +367,6 @@ void UnityConcludeTest(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
static void UnityAddMsgIfSpecified(const char* msg);
|
|
||||||
static void UnityAddMsgIfSpecified(const char* msg)
|
static void UnityAddMsgIfSpecified(const char* msg)
|
||||||
{
|
{
|
||||||
if (msg)
|
if (msg)
|
||||||
@ -408,7 +390,6 @@ static void UnityAddMsgIfSpecified(const char* msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual);
|
|
||||||
static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
|
static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
|
||||||
{
|
{
|
||||||
UnityPrint(UnityStrExpected);
|
UnityPrint(UnityStrExpected);
|
||||||
@ -1141,7 +1122,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
RETURN_IF_FAIL_OR_IGNORE;
|
RETURN_IF_FAIL_OR_IGNORE;
|
||||||
|
|
||||||
UnityTestResultsBegin(Unity.TestFile, line);
|
UnityTestResultsBegin(Unity.TestFile, line);
|
||||||
UnityPrintFail();
|
UnityPrint(UnityStrFail);
|
||||||
if (msg != NULL)
|
if (msg != NULL)
|
||||||
{
|
{
|
||||||
UNITY_OUTPUT_CHAR(':');
|
UNITY_OUTPUT_CHAR(':');
|
||||||
@ -1245,11 +1226,11 @@ int UnityEnd(void)
|
|||||||
UNITY_PRINT_EOL();
|
UNITY_PRINT_EOL();
|
||||||
if (Unity.TestFailures == 0U)
|
if (Unity.TestFailures == 0U)
|
||||||
{
|
{
|
||||||
UnityPrintOk();
|
UnityPrint(UnityStrOk);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnityPrintFail();
|
UnityPrint(UnityStrFail);
|
||||||
#ifdef UNITY_DIFFERENTIATE_FINAL_FAIL
|
#ifdef UNITY_DIFFERENTIATE_FINAL_FAIL
|
||||||
UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D');
|
UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D');
|
||||||
#endif
|
#endif
|
||||||
|
@ -419,6 +419,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
|
|||||||
*-------------------------------------------------------*/
|
*-------------------------------------------------------*/
|
||||||
|
|
||||||
void UnityPrint(const char* string);
|
void UnityPrint(const char* string);
|
||||||
|
void UnityPrintLen(const char* string, const UNITY_UINT32 length);
|
||||||
void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number);
|
void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number);
|
||||||
void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style);
|
void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style);
|
||||||
void UnityPrintNumber(const UNITY_INT number);
|
void UnityPrintNumber(const UNITY_INT number);
|
||||||
|
Reference in New Issue
Block a user