26 Dec 2011, 02:27
Generic-user-small

jiameifang (1 post)

When I run IGNORE_TEST(LedDriver, OutOfBoundsToDo), the ignored number is 0, not 1. (page 90 of pdf file) I trace into the problem and find that in unity fixture, when running UnityIgnoreTest, the Unity.TestIgnores does not increment. If after the ignored test is a normal test, the Unity.CurrentTestIgnored will be checked (check result is true, but that is not right).

I just modify UnityIgnoreTest as follows. It works ok. I am not sure it is a bug or I have missed somthing.

void UnityIgnoreTest(const char * printableName) { Unity.NumberOfTests++; //Unity.CurrentTestIgnored = 1; Unity.TestIgnores++; if (UnityFixture.Verbose) { UnityPrint(printableName); UNITY_OUTPUT_CHAR(‘\n’); } else UNITY_OUTPUT_CHAR(‘!’); }

15 Jul 2012, 17:10
Generic-user-small

Dennis Lambe (6 posts)

This definitely looks like a bug. I have a slightly more elaborate patch that also makes IGNORE look better in Vebose mode (-v).

Where are the unit tests for IGNORE_TEST? I went to update them and found there weren’t any in the first place!

diff --git a/extras/fixture/src/unity_fixture.c b/extras/fixture/src/unity_fixtu
index ec0b4c5..8d17092 100644
--- a/extras/fixture/src/unity_fixture.c
+++ b/extras/fixture/src/unity_fixture.c
@@ -116,11 +116,15 @@ void UnityTestRunner(unityfunction* setup,
     }
 }
 
-void UnityIgnoreTest()
+void UnityIgnoreTest(const char * printableName)
 {
     Unity.NumberOfTests++;
     Unity.CurrentTestIgnored = 1;
-    UNITY_OUTPUT_CHAR('!');
+    if (!UnityFixture.Verbose)
+        UNITY_OUTPUT_CHAR('!');
+    else
+        UnityPrint(printableName);
+    UnityConcludeFixtureTest();
 }
 
 
@@ -360,6 +364,10 @@ void UnityConcludeFixtureTest()
 {
     if (Unity.CurrentTestIgnored)
     {
+        if (UnityFixture.Verbose)
+        {
+            UNITY_OUTPUT_CHAR('\n');
+        }
         Unity.TestIgnores++;
     }
     else if (!Unity.CurrentTestFailed)
diff --git a/extras/fixture/src/unity_fixture.h b/extras/fixture/src/unity_fixtu
index da1f871..43c9f7c 100644
--- a/extras/fixture/src/unity_fixture.h
+++ b/extras/fixture/src/unity_fixture.h
@@ -41,7 +41,7 @@ int UnityMain(int argc, char* argv[], void (*runAllTests)());
     void TEST_##group##_##name##_();\
     void TEST_##group##_##name##_run()\
     {\
-        UnityIgnoreTest();\
+        UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")");\
     }\
     void  TEST_##group##_##name##_()
 
diff --git a/extras/fixture/src/unity_fixture_internals.h b/extras/fixture/src/u
index db23f67..46cbbcb 100644
--- a/extras/fixture/src/unity_fixture_internals.h
+++ b/extras/fixture/src/unity_fixture_internals.h
@@ -25,7 +25,7 @@ void UnityTestRunner(unityfunction * setup,
         const char * name,
         const char * file, int line);
 
-void UnityIgnoreTest();
+void UnityIgnoreTest(const char * printableName);
 void UnityMalloc_StartTest();
 void UnityMalloc_EndTest();
 int UnityFailureCount();
16 Jul 2012, 22:34
James2009_pragsmall

James Grenning (137 posts)

these are bugs. thanks for reporting them.

22 Nov 2012, 16:01
Generic-user-small

Dawid Babula (1 post)

Hi,

can you please tell me did you fix this bug, because I cannot see any commit on the GitHub which will be telling something about this. Looking forward for hearing from you.

Dawid

09 Jan 2013, 17:47
Generic-user-small

Dennis Lambe (6 posts)

I got the fix for these bugs merged upstream. Details here:

https://github.com/ThrowTheSwitch/Unity/pull/25

  You must be logged in to comment