Debian Codegraph @

test/testautomation_syswm.c

raw
1 /**
2 * SysWM test suite
3 */
4
5 #include <stdio.h>
6
7 #include "SDL.h"
8 #include "SDL_syswm.h"
9 #include "SDL_test.h"
10
11 /* Test case functions */
12
13 /**
14 * @brief Call to SDL_GetWindowWMInfo
15 */
16 int syswm_getWindowWMInfo(void *arg)
17 {
18 SDL_bool result;
19 SDL_Window *window;
20 SDL_SysWMinfo info;
21
22 window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
23 SDLTest_AssertPass("Call to SDL_CreateWindow()");
24 SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
25 if (window == NULL) {
26 return TEST_ABORTED;
27 }
28
29 /* Initialize info structure with SDL version info */
30 SDL_VERSION(&info.version);
31
32 /* Make call */
33 result = SDL_GetWindowWMInfo(window, &info);
34 SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()");
35 SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
36
37 SDL_DestroyWindow(window);
38 SDLTest_AssertPass("Call to SDL_DestroyWindow()");
39
40 return TEST_COMPLETED;
41 }
42
43 /* ================= Test References ================== */
44
45 /* SysWM test cases */
46 static const SDLTest_TestCaseReference syswmTest1 = {
47 (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED
48 };
49
50 /* Sequence of SysWM test cases */
51 static const SDLTest_TestCaseReference *syswmTests[] = {
52 &syswmTest1, NULL
53 };
54
55 /* SysWM test suite (global) */
56 SDLTest_TestSuiteReference syswmTestSuite = {
57 "SysWM",
58 NULL,
59 syswmTests,
60 NULL
61 };