tests: Disable mouse warp test under Wayland
Wayland does not allow warping the mouse pointer, thus these tests are unreliable and should be skipped.
This commit is contained in:
@@ -499,6 +499,7 @@ static int mouse_getMouseFocus(void *arg)
|
||||
float x, y;
|
||||
SDL_Window *window;
|
||||
SDL_Window *focusWindow;
|
||||
const SDL_bool video_driver_is_wayland = !SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland");
|
||||
|
||||
/* Get focus - focus non-deterministic */
|
||||
focusWindow = SDL_GetMouseFocus();
|
||||
@@ -510,6 +511,8 @@ static int mouse_getMouseFocus(void *arg)
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
/* Wayland explicitly disallows warping the mouse pointer, so this test must be skipped. */
|
||||
if (!video_driver_is_wayland) {
|
||||
/* Mouse to random position inside window */
|
||||
x = (float)SDLTest_RandomIntegerInRange(1, w - 1);
|
||||
y = (float)SDLTest_RandomIntegerInRange(1, h - 1);
|
||||
@@ -532,6 +535,9 @@ static int mouse_getMouseFocus(void *arg)
|
||||
y = (float)SDLTest_RandomIntegerInRange(-9, -1);
|
||||
SDL_WarpMouseInWindow(window, x, y);
|
||||
SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%.f,%.f)", x, y);
|
||||
} else {
|
||||
SDLTest_Log("Skipping mouse warp fcous tests: Wayland does not support warping the mouse pointer");
|
||||
}
|
||||
|
||||
/* Clean up test window */
|
||||
destroyMouseSuiteTestWindow(window);
|
||||
|
||||
Reference in New Issue
Block a user