提交 69341784 编写于 作者: J jsalling

Remove unnecessary stdio.h dependency and clean up Fixture

 Delete unused variables and empty functions
 Make setUp & tearDown (used in Unity core) optionally defined
  if 'weak' linking is present
上级 10146392
...@@ -6,21 +6,19 @@ ...@@ -6,21 +6,19 @@
========================================== */ ========================================== */
#include <string.h> #include <string.h>
#include <stdio.h>
#include "unity_fixture.h" #include "unity_fixture.h"
#include "unity_internals.h" #include "unity_internals.h"
UNITY_FIXTURE_T UnityFixture; UNITY_FIXTURE_T UnityFixture;
//If you decide to use the function pointer approach. //If you decide to use the function pointer approach.
int (*outputChar)(int) = putchar; //Build with -D UNITY_OUTPUT_CHAR=outputChar and include <stdio.h>
//int (*outputChar)(int) = putchar;
int verbose = 0; #if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA)
void setUp(void);
void tearDown(void);
void setUp(void) { /*does nothing*/ } void setUp(void) { /*does nothing*/ }
void tearDown(void) { /*does nothing*/ } void tearDown(void) { /*does nothing*/ }
#endif
static void announceTestRun(unsigned int runNumber) static void announceTestRun(unsigned int runNumber)
{ {
...@@ -67,11 +65,6 @@ static int groupSelected(const char* group) ...@@ -67,11 +65,6 @@ static int groupSelected(const char* group)
return selected(UnityFixture.GroupFilter, group); return selected(UnityFixture.GroupFilter, group);
} }
static void runTestCase(void)
{
}
void UnityTestRunner(unityfunction* setup, void UnityTestRunner(unityfunction* setup,
unityfunction* testBody, unityfunction* testBody,
unityfunction* teardown, unityfunction* teardown,
...@@ -95,7 +88,6 @@ void UnityTestRunner(unityfunction* setup, ...@@ -95,7 +88,6 @@ void UnityTestRunner(unityfunction* setup,
UnityMalloc_StartTest(); UnityMalloc_StartTest();
UnityPointer_Init(); UnityPointer_Init();
runTestCase();
if (TEST_PROTECT()) if (TEST_PROTECT())
{ {
setup(); setup();
...@@ -174,7 +166,6 @@ void UnityMalloc_MakeMallocFailAfterCount(int countdown) ...@@ -174,7 +166,6 @@ void UnityMalloc_MakeMallocFailAfterCount(int countdown)
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
typedef struct GuardBytes typedef struct GuardBytes
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册