Fixed issue with c tests running too fast (overwhelming plugin)

This commit is contained in:
Chris Teubert
2017-05-02 16:51:58 -07:00
parent 10f3ce2854
commit db92652bc2
4 changed files with 90 additions and 35 deletions

View File

@@ -21,6 +21,14 @@ void runTest(int(*test)(), char* name)
}
}
void crossPlatformUSleep(int uSleep) {
#ifdef _WIN32
Sleep(uSleep/1000);
#else
usleep(uSleep);
#endif
}
int compareFloat(float expected, float actual)
{
return feq(expected, actual) || isnan(expected) ? 0 : -1;