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

@ -7,8 +7,8 @@
/* Test case functions */
/* Definition of all RGB formats used to test pixel conversions */
const int _numRGBPixelFormats = 31;
Uint32 _RGBPixelFormats[] = {
const int g_numRGBPixelFormats = 31;
Uint32 g_RGBPixelFormats[] = {
SDL_PIXELFORMAT_INDEX1LSB,
SDL_PIXELFORMAT_INDEX1MSB,
SDL_PIXELFORMAT_INDEX4LSB,
@ -41,7 +41,7 @@ Uint32 _RGBPixelFormats[] = {
SDL_PIXELFORMAT_BGRA8888,
SDL_PIXELFORMAT_ARGB2101010
};
const char *_RGBPixelFormatsVerbose[] = {
const char *g_RGBPixelFormatsVerbose[] = {
"SDL_PIXELFORMAT_INDEX1LSB",
"SDL_PIXELFORMAT_INDEX1MSB",
"SDL_PIXELFORMAT_INDEX4LSB",
@ -76,8 +76,8 @@ const char *_RGBPixelFormatsVerbose[] = {
};
/* Definition of all Non-RGB formats used to test pixel conversions */
const int _numNonRGBPixelFormats = 7;
Uint32 _nonRGBPixelFormats[] = {
const int g_numNonRGBPixelFormats = 7;
static Uint32 g_nonRGBPixelFormats[] = {
SDL_PIXELFORMAT_YV12,
SDL_PIXELFORMAT_IYUV,
SDL_PIXELFORMAT_YUY2,
@ -86,7 +86,7 @@ Uint32 _nonRGBPixelFormats[] = {
SDL_PIXELFORMAT_NV12,
SDL_PIXELFORMAT_NV21
};
const char *_nonRGBPixelFormatsVerbose[] = {
const char *g_nonRGBPixelFormatsVerbose[] = {
"SDL_PIXELFORMAT_YV12",
"SDL_PIXELFORMAT_IYUV",
"SDL_PIXELFORMAT_YUY2",
@ -97,12 +97,12 @@ const char *_nonRGBPixelFormatsVerbose[] = {
};
/* Definition of some invalid formats for negative tests */
const int _numInvalidPixelFormats = 2;
Uint32 _invalidPixelFormats[] = {
const int g_numInvalidPixelFormats = 2;
static Uint32 g_invalidPixelFormats[] = {
0xfffffffe,
0xffffffff
};
const char *_invalidPixelFormatsVerbose[] = {
const char *g_invalidPixelFormatsVerbose[] = {
"SDL_PIXELFORMAT_UNKNOWN",
"SDL_PIXELFORMAT_UNKNOWN"
};
@ -146,9 +146,9 @@ int pixels_allocFreeFormat(void *arg)
}
/* RGB formats */
for (i = 0; i < _numRGBPixelFormats; i++) {
format = _RGBPixelFormats[i];
SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
for (i = 0; i < g_numRGBPixelFormats; i++) {
format = g_RGBPixelFormats[i];
SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", g_RGBPixelFormatsVerbose[i], format);
/* Allocate format */
result = SDL_CreatePixelFormat(format);
@ -170,9 +170,9 @@ int pixels_allocFreeFormat(void *arg)
}
/* Non-RGB formats */
for (i = 0; i < _numNonRGBPixelFormats; i++) {
format = _nonRGBPixelFormats[i];
SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
for (i = 0; i < g_numNonRGBPixelFormats; i++) {
format = g_nonRGBPixelFormats[i];
SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", g_nonRGBPixelFormatsVerbose[i], format);
/* Try to allocate format */
result = SDL_CreatePixelFormat(format);
@ -183,10 +183,10 @@ int pixels_allocFreeFormat(void *arg)
/* Negative cases */
/* Invalid Formats */
for (i = 0; i < _numInvalidPixelFormats; i++) {
for (i = 0; i < g_numInvalidPixelFormats; i++) {
SDL_ClearError();
SDLTest_AssertPass("Call to SDL_ClearError()");
format = _invalidPixelFormats[i];
format = g_invalidPixelFormats[i];
result = SDL_CreatePixelFormat(format);
SDLTest_AssertPass("Call to SDL_CreatePixelFormat(%" SDL_PRIu32 ")", format);
SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
@ -243,9 +243,9 @@ int pixels_getPixelFormatName(void *arg)
}
/* RGB formats */
for (i = 0; i < _numRGBPixelFormats; i++) {
format = _RGBPixelFormats[i];
SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
for (i = 0; i < g_numRGBPixelFormats; i++) {
format = g_RGBPixelFormats[i];
SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", g_RGBPixelFormatsVerbose[i], format);
/* Get name of format */
result = SDL_GetPixelFormatName(format);
@ -253,15 +253,15 @@ int pixels_getPixelFormatName(void *arg)
SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
if (result != NULL) {
SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
SDLTest_AssertCheck(SDL_strcmp(result, _RGBPixelFormatsVerbose[i]) == 0,
"Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result);
SDLTest_AssertCheck(SDL_strcmp(result, g_RGBPixelFormatsVerbose[i]) == 0,
"Verify result text; expected: %s, got %s", g_RGBPixelFormatsVerbose[i], result);
}
}
/* Non-RGB formats */
for (i = 0; i < _numNonRGBPixelFormats; i++) {
format = _nonRGBPixelFormats[i];
SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
for (i = 0; i < g_numNonRGBPixelFormats; i++) {
format = g_nonRGBPixelFormats[i];
SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", g_nonRGBPixelFormatsVerbose[i], format);
/* Get name of format */
result = SDL_GetPixelFormatName(format);
@ -269,8 +269,8 @@ int pixels_getPixelFormatName(void *arg)
SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
if (result != NULL) {
SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
SDLTest_AssertCheck(SDL_strcmp(result, _nonRGBPixelFormatsVerbose[i]) == 0,
"Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result);
SDLTest_AssertCheck(SDL_strcmp(result, g_nonRGBPixelFormatsVerbose[i]) == 0,
"Verify result text; expected: %s, got %s", g_nonRGBPixelFormatsVerbose[i], result);
}
}
@ -279,16 +279,16 @@ int pixels_getPixelFormatName(void *arg)
/* Invalid Formats */
SDL_ClearError();
SDLTest_AssertPass("Call to SDL_ClearError()");
for (i = 0; i < _numInvalidPixelFormats; i++) {
format = _invalidPixelFormats[i];
for (i = 0; i < g_numInvalidPixelFormats; i++) {
format = g_invalidPixelFormats[i];
result = SDL_GetPixelFormatName(format);
SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%" SDL_PRIu32 ")", format);
SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
if (result != NULL) {
SDLTest_AssertCheck(result[0] != '\0',
"Verify result is non-empty; got: %s", result);
SDLTest_AssertCheck(SDL_strcmp(result, _invalidPixelFormatsVerbose[i]) == 0,
"Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result);
SDLTest_AssertCheck(SDL_strcmp(result, g_invalidPixelFormatsVerbose[i]) == 0,
"Validate name is UNKNOWN, expected: '%s', got: '%s'", g_invalidPixelFormatsVerbose[i], result);
}
error = SDL_GetError();
SDLTest_AssertPass("Call to SDL_GetError()");