Windows Unit Test Support (#629)

Window Unit Test Support
This commit is contained in:
Nick Banks
2016-09-20 18:11:19 -07:00
committed by Jonathan Hui
parent 4bd62977d4
commit 25cea9414b
19 changed files with 753 additions and 123 deletions
+7 -28
View File
@@ -43,34 +43,11 @@ enum
};
static Thread::TimerScheduler sTimerScheduler;
static uint32_t sNow;
static uint32_t sPlatT0;
static uint32_t sPlatDt;
static bool sTimerOn;
static uint32_t sCallCount[kCallCountIndexMax];
extern "C" {
void otPlatAlarmStop(otInstance *)
{
sTimerOn = false;
sCallCount[kCallCountIndexAlarmStop]++;
}
void otPlatAlarmStartAt(otInstance *, uint32_t aT0, uint32_t aDt)
{
sTimerOn = true;
sCallCount[kCallCountIndexAlarmStart]++;
sPlatT0 = aT0;
sPlatDt = aDt;
}
uint32_t otPlatAlarmGetNow(void)
{
return sNow;
}
} // extern "C"
extern uint32_t sNow;
extern uint32_t sPlatT0;
extern uint32_t sPlatDt;
extern bool sTimerOn;
extern uint32_t sCallCount[kCallCountIndexMax];
void InitCounters(void)
{
@@ -409,9 +386,11 @@ void RunTimerTests(void)
TestTenTimers();
}
#ifdef ENABLE_TEST_MAIN
int main(void)
{
RunTimerTests();
printf("All tests passed\n");
return 0;
}
#endif