提交 f8d5f0ee 编写于 作者: J jsalling

Clean up Ignore Test function in Fixture

 By removing the call to the Conclude function the code is simplified
  and doesn't depend on global state updates. Tests that are ignored
  after the testBody is called still output the right EOL.
上级 915e3fb9
...@@ -75,7 +75,6 @@ void UnityTestRunner(unityfunction* setup, ...@@ -75,7 +75,6 @@ void UnityTestRunner(unityfunction* setup,
{ {
if (testSelected(name) && groupSelected(group)) if (testSelected(name) && groupSelected(group))
{ {
Unity.CurrentTestFailed = 0;
Unity.TestFile = file; Unity.TestFile = file;
Unity.CurrentTestName = printableName; Unity.CurrentTestName = printableName;
Unity.CurrentTestLineNumber = line; Unity.CurrentTestLineNumber = line;
...@@ -112,12 +111,14 @@ void UnityIgnoreTest(const char* printableName, const char* group, const char* n ...@@ -112,12 +111,14 @@ void UnityIgnoreTest(const char* printableName, const char* group, const char* n
if (testSelected(name) && groupSelected(group)) if (testSelected(name) && groupSelected(group))
{ {
Unity.NumberOfTests++; Unity.NumberOfTests++;
Unity.CurrentTestIgnored = 1; Unity.TestIgnores++;
if (!UnityFixture.Verbose) if (!UnityFixture.Verbose)
UNITY_OUTPUT_CHAR('!'); UNITY_OUTPUT_CHAR('!');
else else
{
UnityPrint(printableName); UnityPrint(printableName);
UnityConcludeFixtureTest(); UNITY_PRINT_EOL();
}
} }
} }
...@@ -403,11 +404,8 @@ void UnityConcludeFixtureTest(void) ...@@ -403,11 +404,8 @@ void UnityConcludeFixtureTest(void)
{ {
if (Unity.CurrentTestIgnored) if (Unity.CurrentTestIgnored)
{ {
if (UnityFixture.Verbose)
{
UNITY_PRINT_EOL();
}
Unity.TestIgnores++; Unity.TestIgnores++;
UNITY_PRINT_EOL();
} }
else if (!Unity.CurrentTestFailed) else if (!Unity.CurrentTestFailed)
{ {
...@@ -417,7 +415,7 @@ void UnityConcludeFixtureTest(void) ...@@ -417,7 +415,7 @@ void UnityConcludeFixtureTest(void)
UNITY_PRINT_EOL(); UNITY_PRINT_EOL();
} }
} }
else if (Unity.CurrentTestFailed) else // Unity.CurrentTestFailed
{ {
Unity.TestFailures++; Unity.TestFailures++;
UNITY_PRINT_EOL(); UNITY_PRINT_EOL();
......
...@@ -343,7 +343,6 @@ TEST(LeakDetection, DetectsLeak) ...@@ -343,7 +343,6 @@ TEST(LeakDetection, DetectsLeak)
TEST(LeakDetection, BufferOverrunFoundDuringFree) TEST(LeakDetection, BufferOverrunFoundDuringFree)
{ {
#ifndef USING_OUTPUT_SPY #ifndef USING_OUTPUT_SPY
UNITY_PRINT_EOL();
TEST_IGNORE(); TEST_IGNORE();
#else #else
void* m = malloc(10); void* m = malloc(10);
...@@ -363,7 +362,6 @@ TEST(LeakDetection, BufferOverrunFoundDuringFree) ...@@ -363,7 +362,6 @@ TEST(LeakDetection, BufferOverrunFoundDuringFree)
TEST(LeakDetection, BufferOverrunFoundDuringRealloc) TEST(LeakDetection, BufferOverrunFoundDuringRealloc)
{ {
#ifndef USING_OUTPUT_SPY #ifndef USING_OUTPUT_SPY
UNITY_PRINT_EOL();
TEST_IGNORE(); TEST_IGNORE();
#else #else
void* m = malloc(10); void* m = malloc(10);
...@@ -383,7 +381,6 @@ TEST(LeakDetection, BufferOverrunFoundDuringRealloc) ...@@ -383,7 +381,6 @@ TEST(LeakDetection, BufferOverrunFoundDuringRealloc)
TEST(LeakDetection, BufferGuardWriteFoundDuringFree) TEST(LeakDetection, BufferGuardWriteFoundDuringFree)
{ {
#ifndef USING_OUTPUT_SPY #ifndef USING_OUTPUT_SPY
UNITY_PRINT_EOL();
TEST_IGNORE(); TEST_IGNORE();
#else #else
void* m = malloc(10); void* m = malloc(10);
...@@ -404,7 +401,6 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringFree) ...@@ -404,7 +401,6 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringFree)
TEST(LeakDetection, BufferGuardWriteFoundDuringRealloc) TEST(LeakDetection, BufferGuardWriteFoundDuringRealloc)
{ {
#ifndef USING_OUTPUT_SPY #ifndef USING_OUTPUT_SPY
UNITY_PRINT_EOL();
TEST_IGNORE(); TEST_IGNORE();
#else #else
void* m = malloc(10); void* m = malloc(10);
...@@ -424,7 +420,6 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringRealloc) ...@@ -424,7 +420,6 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringRealloc)
TEST(LeakDetection, PointerSettingMax) TEST(LeakDetection, PointerSettingMax)
{ {
#ifndef USING_OUTPUT_SPY #ifndef USING_OUTPUT_SPY
UNITY_PRINT_EOL();
TEST_IGNORE(); TEST_IGNORE();
#else #else
int i; int i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册