提交 d4353166 编写于 作者: J jsalling

Replace all hard-coded '\n' with UNITY_PRINT_EOL macro in fixture

Delete the { ;} braces and semicolon from UNITY_PRINT_EOL to give it expected
  behavior: 1) requires a semicolon 2) works in one-liner if-else statements
If you need "\r\n" for EOL, define as the following to get the same behavior:
  do{UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n');}while(0)
上级 5fc2b092
...@@ -28,7 +28,7 @@ static void announceTestRun(unsigned int runNumber) ...@@ -28,7 +28,7 @@ static void announceTestRun(unsigned int runNumber)
UnityPrintNumber(runNumber+1); UnityPrintNumber(runNumber+1);
UnityPrint(" of "); UnityPrint(" of ");
UnityPrintNumber(UnityFixture.RepeatCount); UnityPrintNumber(UnityFixture.RepeatCount);
UNITY_OUTPUT_CHAR('\n'); UNITY_PRINT_EOL;
} }
int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)) int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
...@@ -43,7 +43,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)) ...@@ -43,7 +43,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
UnityBegin(argv[0]); UnityBegin(argv[0]);
announceTestRun(r); announceTestRun(r);
runAllTests(); runAllTests();
UNITY_OUTPUT_CHAR('\n'); UNITY_PRINT_EOL;
UnityEnd(); UnityEnd();
} }
...@@ -396,7 +396,7 @@ void UnityConcludeFixtureTest(void) ...@@ -396,7 +396,7 @@ void UnityConcludeFixtureTest(void)
{ {
//if (UnityFixture.Verbose) //if (UnityFixture.Verbose)
//{ //{
UNITY_OUTPUT_CHAR('\n'); UNITY_PRINT_EOL;
//} //}
Unity.TestIgnores++; Unity.TestIgnores++;
} }
...@@ -405,13 +405,13 @@ void UnityConcludeFixtureTest(void) ...@@ -405,13 +405,13 @@ void UnityConcludeFixtureTest(void)
if (UnityFixture.Verbose) if (UnityFixture.Verbose)
{ {
UnityPrint(" PASS"); UnityPrint(" PASS");
UNITY_OUTPUT_CHAR('\n'); UNITY_PRINT_EOL;
} }
} }
else if (Unity.CurrentTestFailed) else if (Unity.CurrentTestFailed)
{ {
Unity.TestFailures++; Unity.TestFailures++;
UNITY_OUTPUT_CHAR('\n'); UNITY_PRINT_EOL;
} }
Unity.CurrentTestFailed = 0; Unity.CurrentTestFailed = 0;
......
...@@ -292,7 +292,7 @@ extern int UNITY_OUTPUT_CHAR(int); ...@@ -292,7 +292,7 @@ extern int UNITY_OUTPUT_CHAR(int);
#endif #endif
#ifndef UNITY_PRINT_EOL #ifndef UNITY_PRINT_EOL
#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); } #define UNITY_PRINT_EOL UNITY_OUTPUT_CHAR('\n')
#endif #endif
#ifndef UNITY_OUTPUT_START #ifndef UNITY_OUTPUT_START
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册