提交 25804f3a 编写于 作者: F Fabian Zahn

Added flushSpy and the respective helper functions

上级 45675929
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册