mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-08-06 03:07:52 +00:00
Added flushSpy and the respective helper functions
This commit is contained in:
+27
-4
@@ -54,6 +54,10 @@ void startPutcharSpy(void);
|
|||||||
void endPutcharSpy(void);
|
void endPutcharSpy(void);
|
||||||
char* getBufferPutcharSpy(void);
|
char* getBufferPutcharSpy(void);
|
||||||
|
|
||||||
|
void startFlushSpy(void);
|
||||||
|
void endFlushSpy(void);
|
||||||
|
unsigned int getFlushSpyCalls(void);
|
||||||
|
|
||||||
static int SetToOneToFailInTearDown;
|
static int SetToOneToFailInTearDown;
|
||||||
static int SetToOneMeanWeAlreadyCheckedThisGuy;
|
static int SetToOneMeanWeAlreadyCheckedThisGuy;
|
||||||
|
|
||||||
@@ -3335,13 +3339,18 @@ void putcharSpy(int c)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
/* This is for counting the calls to the flushSpy */
|
||||||
|
static int flushSpyEnabled;
|
||||||
|
static unsigned int flushSpyCalls = 0;
|
||||||
|
|
||||||
|
void startFlushSpy(void) { flushSpyCalls = 0; flushSpyEnabled = 1; }
|
||||||
|
void endFlushSpy(void) { flushSpyCalls = 0; flushSpyEnabled = 0; }
|
||||||
|
unsigned int getFlushSpyCalls(void) { return flushSpyCalls; }
|
||||||
|
|
||||||
void flushSpy(void)
|
void flushSpy(void)
|
||||||
{
|
{
|
||||||
static unsigned int calls = 0;
|
if (flushSpyEnabled){ flushSpyCalls++; }
|
||||||
calls++; // count every call
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
||||||
{
|
{
|
||||||
@@ -3420,6 +3429,20 @@ void testPrintNumbersUnsigned32(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* This is for counting the calls to the flushSpy */
|
||||||
|
static int flushSpyEnabled;
|
||||||
|
static unsigned int flushSpyCalls = 0;
|
||||||
|
|
||||||
|
void startFlushSpy(void) { flushSpyCalls = 0; flushSpyEnabled = 1; }
|
||||||
|
void endFlushSpy(void) { flushSpyCalls = 0; flushSpyEnabled = 0; }
|
||||||
|
unsigned int getFlushSpyCalls(void) { return flushSpyCalls; }
|
||||||
|
|
||||||
|
void flushSpy(void)
|
||||||
|
{
|
||||||
|
if (flushSpyEnabled){ flushSpyCalls++; }
|
||||||
|
}
|
||||||
|
|
||||||
// ===================== THESE TEST WILL RUN IF YOUR CONFIG INCLUDES 64 BIT SUPPORT ==================
|
// ===================== THESE TEST WILL RUN IF YOUR CONFIG INCLUDES 64 BIT SUPPORT ==================
|
||||||
|
|
||||||
void testPrintNumbersInt64(void)
|
void testPrintNumbersInt64(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user