71 const Uint32 testDelay = 100;
72 const Uint32 marginOfError = 25;
99 difference = result2 -
result;
100 SDLTest_AssertCheck(difference > (testDelay - marginOfError),
"Check difference, expected: >%d, got: %d", testDelay - marginOfError, difference);
101 SDLTest_AssertCheck(difference < (testDelay + marginOfError),
"Check difference, expected: <%d, got: %d", testDelay + marginOfError, difference);
int timer_getPerformanceCounter(void *arg)
Call to SDL_GetPerformanceCounter.
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
static const SDLTest_TestCaseReference timerTest3
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
Uint64 SDL_GetPerformanceFrequency(void)
Get the count per second of the high resolution counter.
int timer_getPerformanceFrequency(void *arg)
Call to SDL_GetPerformanceFrequency.
Uint32 _timerTestCallback(Uint32 interval, void *param)
int timer_delayAndGetTicks(void *arg)
Call to SDL_Delay and SDL_GetTicks.
#define SDL_InitSubSystem
int timer_addRemoveTimer(void *arg)
Call to SDL_AddTimer and SDL_RemoveTimer.
SDLTest_TestSuiteReference timerTestSuite
static const SDLTest_TestCaseReference timerTest1
static const SDLTest_TestCaseReference * timerTests[]
int(* SDLTest_TestCaseFp)(void *arg)
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and the ERROR priority.
static const SDLTest_TestCaseReference timerTest2
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
static const SDLTest_TestCaseReference timerTest4
#define SDL_GetPerformanceCounter
void _timerSetUp(void *arg)