mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-05 23:10:58 +00:00
tests: port failing window test from pysdl2 to testautomation
(cherry picked from commit 4f488b9be2
)
This commit is contained in:
parent
2775e7a78f
commit
ffbd434a11
1 changed files with 31 additions and 0 deletions
|
@ -2444,6 +2444,33 @@ static int SDLCALL video_getWindowSurface(void *arg)
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests SDL_RaiseWindow
|
||||||
|
*/
|
||||||
|
static int SDLCALL video_raiseWindow(void *arg)
|
||||||
|
{
|
||||||
|
bool result;
|
||||||
|
SDL_Window *window;
|
||||||
|
|
||||||
|
SDLTest_AssertPass("SDL_SetWindowInputFocus is not supported on dummy and SDL2 wayland driver");
|
||||||
|
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0 || SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
|
||||||
|
return TEST_SKIPPED;
|
||||||
|
}
|
||||||
|
|
||||||
|
window = createVideoSuiteTestWindow("video_raiseWindow");
|
||||||
|
if (!window) {
|
||||||
|
return TEST_ABORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLTest_AssertPass("About to call SDL_RaiseWindow(window)");
|
||||||
|
result = SDL_RaiseWindow(window);
|
||||||
|
SDLTest_AssertCheck(result, "Result is %d, expected 1 (%s)", result, SDL_GetError());
|
||||||
|
|
||||||
|
destroyVideoSuiteTestWindow(window);
|
||||||
|
|
||||||
|
return TEST_COMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
/* ================= Test References ================== */
|
/* ================= Test References ================== */
|
||||||
|
|
||||||
/* Video test cases */
|
/* Video test cases */
|
||||||
|
@ -2534,6 +2561,9 @@ static const SDLTest_TestCaseReference videoTestCreateMaximized = {
|
||||||
static const SDLTest_TestCaseReference videoTestGetWindowSurface = {
|
static const SDLTest_TestCaseReference videoTestGetWindowSurface = {
|
||||||
video_getWindowSurface, "video_getWindowSurface", "Checks window surface functionality", TEST_ENABLED
|
video_getWindowSurface, "video_getWindowSurface", "Checks window surface functionality", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
static const SDLTest_TestCaseReference videoTestRaiseWindow = {
|
||||||
|
video_raiseWindow, "video_raiseWindow", "Checks window focus", TEST_ENABLED
|
||||||
|
};
|
||||||
|
|
||||||
/* Sequence of Video test cases */
|
/* Sequence of Video test cases */
|
||||||
static const SDLTest_TestCaseReference *videoTests[] = {
|
static const SDLTest_TestCaseReference *videoTests[] = {
|
||||||
|
@ -2559,6 +2589,7 @@ static const SDLTest_TestCaseReference *videoTests[] = {
|
||||||
&videoTestCreateMinimized,
|
&videoTestCreateMinimized,
|
||||||
&videoTestCreateMaximized,
|
&videoTestCreateMaximized,
|
||||||
&videoTestGetWindowSurface,
|
&videoTestGetWindowSurface,
|
||||||
|
&videoTestRaiseWindow,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue