tests: Fix whitespace

This commit is contained in:
Frank Praznik 2023-12-12 17:17:00 -05:00
parent a78cdbd7e3
commit cc6d8eb72b

View file

@ -1145,8 +1145,8 @@ int video_getSetWindowPosition(void *arg)
SDL_Rect display_bounds; SDL_Rect display_bounds;
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
SDLTest_Log("Skipping test: wayland does not support window positioning"); SDLTest_Log("Skipping test: wayland does not support window positioning");
return TEST_SKIPPED; return TEST_SKIPPED;
} }
/* Call against new test window */ /* Call against new test window */
@ -1156,26 +1156,26 @@ int video_getSetWindowPosition(void *arg)
} }
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) {
/* The X11 server allows arbitrary window placement, but compositing /* The X11 server allows arbitrary window placement, but compositing
* window managers such as GNOME and KDE force windows to be within * window managers such as GNOME and KDE force windows to be within
* desktop bounds. * desktop bounds.
*/ */
maxxVariation = 2; maxxVariation = 2;
maxyVariation = 2; maxyVariation = 2;
SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds);
} else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "cocoa") == 0) { } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "cocoa") == 0) {
/* Platform doesn't allow windows with negative Y desktop bounds */ /* Platform doesn't allow windows with negative Y desktop bounds */
maxxVariation = 4; maxxVariation = 4;
maxyVariation = 3; maxyVariation = 3;
SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds);
} else { } else {
/* Platform allows windows to be placed out of bounds */ /* Platform allows windows to be placed out of bounds */
maxxVariation = 4; maxxVariation = 4;
maxyVariation = 4; maxyVariation = 4;
SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window), &display_bounds);
} }
for (xVariation = 0; xVariation < maxxVariation; xVariation++) { for (xVariation = 0; xVariation < maxxVariation; xVariation++) {
@ -1183,41 +1183,41 @@ int video_getSetWindowPosition(void *arg)
switch (xVariation) { switch (xVariation) {
default: default:
case 0: case 0:
/* Zero X Position */ /* Zero X Position */
desiredX = display_bounds.x > 0 ? display_bounds.x : 0; desiredX = display_bounds.x > 0 ? display_bounds.x : 0;
break; break;
case 1: case 1:
/* Random X position inside screen */ /* Random X position inside screen */
desiredX = SDLTest_RandomIntegerInRange(display_bounds.x + 1, display_bounds.x + 100); desiredX = SDLTest_RandomIntegerInRange(display_bounds.x + 1, display_bounds.x + 100);
break; break;
case 2: case 2:
/* Random X position outside screen (positive) */ /* Random X position outside screen (positive) */
desiredX = SDLTest_RandomIntegerInRange(10000, 11000); desiredX = SDLTest_RandomIntegerInRange(10000, 11000);
break; break;
case 3: case 3:
/* Random X position outside screen (negative) */ /* Random X position outside screen (negative) */
desiredX = SDLTest_RandomIntegerInRange(-1000, -100); desiredX = SDLTest_RandomIntegerInRange(-1000, -100);
break; break;
} }
switch (yVariation) { switch (yVariation) {
default: default:
case 0: case 0:
/* Zero Y Position */ /* Zero Y Position */
desiredY = display_bounds.y > 0 ? display_bounds.y : 0; desiredY = display_bounds.y > 0 ? display_bounds.y : 0;
break; break;
case 1: case 1:
/* Random Y position inside screen */ /* Random Y position inside screen */
desiredY = SDLTest_RandomIntegerInRange(display_bounds.y + 1, display_bounds.y + 100); desiredY = SDLTest_RandomIntegerInRange(display_bounds.y + 1, display_bounds.y + 100);
break; break;
case 2: case 2:
/* Random Y position outside screen (positive) */ /* Random Y position outside screen (positive) */
desiredY = SDLTest_RandomIntegerInRange(10000, 11000); desiredY = SDLTest_RandomIntegerInRange(10000, 11000);
break; break;
case 3: case 3:
/* Random Y position outside screen (negative) */ /* Random Y position outside screen (negative) */
desiredY = SDLTest_RandomIntegerInRange(-1000, -100); desiredY = SDLTest_RandomIntegerInRange(-1000, -100);
break; break;
} }
/* Set position */ /* Set position */
@ -1352,13 +1352,13 @@ int video_getSetWindowSize(void *arg)
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") == 0 || if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") == 0 ||
SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) {
/* Platform clips window size to screen size */ /* Platform clips window size to screen size */
maxwVariation = 4; maxwVariation = 4;
maxhVariation = 4; maxhVariation = 4;
} else { } else {
/* Platform allows window size >= screen size */ /* Platform allows window size >= screen size */
maxwVariation = 5; maxwVariation = 5;
maxhVariation = 5; maxhVariation = 5;
} }
for (wVariation = 0; wVariation < maxwVariation; wVariation++) { for (wVariation = 0; wVariation < maxwVariation; wVariation++) {
@ -1438,7 +1438,6 @@ int video_getSetWindowSize(void *arg)
} }
} }
/* Get just width */ /* Get just width */
currentW = desiredW + 1; currentW = desiredW + 1;
SDL_GetWindowSize(window, &currentW, NULL); SDL_GetWindowSize(window, &currentW, NULL);