Remove more reserved identifiers (#6925)

This commit is contained in:
Sylvain Becker 2022-12-29 22:58:16 +01:00 committed by GitHub
parent ce412c2c71
commit d7d3c22dbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 517 additions and 517 deletions

View file

@ -5,17 +5,17 @@
#include <SDL3/SDL_test.h>
/* Flag indicating if the param should be checked */
int _paramCheck = 0;
static int g_paramCheck = 0;
/* Userdata value to check */
int _paramValue = 0;
static int g_paramValue = 0;
/* Flag indicating that the callback was called */
int _timerCallbackCalled = 0;
static int g_timerCallbackCalled = 0;
/* Fixture */
void _timerSetUp(void *arg)
static void timerSetUp(void *arg)
{
/* Start SDL timer subsystem */
int ret = SDL_InitSubSystem(SDL_INIT_TIMER);
@ -97,14 +97,14 @@ int timer_delayAndGetTicks(void *arg)
}
/* Test callback */
Uint32 SDLCALL _timerTestCallback(Uint32 interval, void *param)
static Uint32 SDLCALL timerTestCallback(Uint32 interval, void *param)
{
_timerCallbackCalled = 1;
g_timerCallbackCalled = 1;
if (_paramCheck != 0) {
if (g_paramCheck != 0) {
SDLTest_AssertCheck(param != NULL, "Check param pointer, expected: non-NULL, got: %s", (param != NULL) ? "non-NULL" : "NULL");
if (param != NULL) {
SDLTest_AssertCheck(*(int *)param == _paramValue, "Check param value, expected: %i, got: %i", _paramValue, *(int *)param);
SDLTest_AssertCheck(*(int *)param == g_paramValue, "Check param value, expected: %i, got: %i", g_paramValue, *(int *)param);
}
}
@ -121,11 +121,11 @@ int timer_addRemoveTimer(void *arg)
int param;
/* Reset state */
_paramCheck = 0;
_timerCallbackCalled = 0;
g_paramCheck = 0;
g_timerCallbackCalled = 0;
/* Set timer with a long delay */
id = SDL_AddTimer(10000, _timerTestCallback, NULL);
id = SDL_AddTimer(10000, timerTestCallback, NULL);
SDLTest_AssertPass("Call to SDL_AddTimer(10000,...)");
SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id);
@ -133,7 +133,7 @@ int timer_addRemoveTimer(void *arg)
result = SDL_RemoveTimer(id);
SDLTest_AssertPass("Call to SDL_RemoveTimer()");
SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected: %i, got: %i", SDL_TRUE, result);
SDLTest_AssertCheck(_timerCallbackCalled == 0, "Check callback WAS NOT called, expected: 0, got: %i", _timerCallbackCalled);
SDLTest_AssertCheck(g_timerCallbackCalled == 0, "Check callback WAS NOT called, expected: 0, got: %i", g_timerCallbackCalled);
/* Try to remove timer again (should be a NOOP) */
result = SDL_RemoveTimer(id);
@ -142,12 +142,12 @@ int timer_addRemoveTimer(void *arg)
/* Reset state */
param = SDLTest_RandomIntegerInRange(-1024, 1024);
_paramCheck = 1;
_paramValue = param;
_timerCallbackCalled = 0;
g_paramCheck = 1;
g_paramValue = param;
g_timerCallbackCalled = 0;
/* Set timer with a short delay */
id = SDL_AddTimer(10, _timerTestCallback, (void *)&param);
id = SDL_AddTimer(10, timerTestCallback, (void *)&param);
SDLTest_AssertPass("Call to SDL_AddTimer(10, param)");
SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id);
@ -159,7 +159,7 @@ int timer_addRemoveTimer(void *arg)
result = SDL_RemoveTimer(id);
SDLTest_AssertPass("Call to SDL_RemoveTimer()");
SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result);
SDLTest_AssertCheck(_timerCallbackCalled == 1, "Check callback WAS called, expected: 1, got: %i", _timerCallbackCalled);
SDLTest_AssertCheck(g_timerCallbackCalled == 1, "Check callback WAS called, expected: 1, got: %i", g_timerCallbackCalled);
return TEST_COMPLETED;
}
@ -191,7 +191,7 @@ static const SDLTest_TestCaseReference *timerTests[] = {
/* Timer test suite (global) */
SDLTest_TestSuiteReference timerTestSuite = {
"Timer",
_timerSetUp,
timerSetUp,
timerTests,
NULL
};