1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

Added flushSpy and the respective helper functions

This commit is contained in:
Fabian Zahn
2018-02-18 14:46:42 +01:00
parent 456759296b
commit 25804f3ab4

View File

@@ -54,6 +54,10 @@ void startPutcharSpy(void);
void endPutcharSpy(void);
char* getBufferPutcharSpy(void);
void startFlushSpy(void);
void endFlushSpy(void);
unsigned int getFlushSpyCalls(void);
static int SetToOneToFailInTearDown;
static int SetToOneMeanWeAlreadyCheckedThisGuy;
@@ -3335,13 +3339,18 @@ void putcharSpy(int c)
#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)
{
static unsigned int calls = 0;
calls++; // count every call
if (flushSpyEnabled){ flushSpyCalls++; }
}
#endif
void testFailureCountIncrementsAndIsReturnedAtEnd(void)
{
@@ -3420,6 +3429,20 @@ void testPrintNumbersUnsigned32(void)
#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 ==================
void testPrintNumbersInt64(void)