SDL  2.0
testautomation_syswm.c
Go to the documentation of this file.
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
18 {
21  SDL_SysWMinfo info;
22 
23  window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
24  SDLTest_AssertPass("Call to SDL_CreateWindow()");
25  SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
26  if (window == NULL) {
27  return TEST_ABORTED;
28  }
29 
30  /* Initialize info structure with SDL version info */
31  SDL_VERSION(&info.version);
32 
33  /* Make call */
35  SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()");
36  SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
37 
39  SDLTest_AssertPass("Call to SDL_DestroyWindow()");
40 
41  return TEST_COMPLETED;
42 }
43 
44 /* ================= Test References ================== */
45 
46 /* SysWM test cases */
48  { (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED };
49 
50 /* Sequence of SysWM test cases */
53 };
54 
55 /* SysWM test suite (global) */
57  "SysWM",
58  NULL,
59  syswmTests,
60  NULL
61 };
SDL.h
syswmTestSuite
SDLTest_TestSuiteReference syswmTestSuite
Definition: testautomation_syswm.c:56
SDL_test.h
NULL
#define NULL
Definition: begin_code.h:167
SDL_VERSION
#define SDL_VERSION(x)
Macro to determine SDL version program was compiled against.
Definition: SDL_version.h:79
SDL_SysWMinfo
Definition: SDL_syswm.h:201
SDLTest_Log
void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and INFO priority.
Definition: SDL_test_log.c:85
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
SDL_CreateWindow
#define SDL_CreateWindow
Definition: SDL_dynapi_overrides.h:514
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
syswmTest1
static const SDLTest_TestCaseReference syswmTest1
Definition: testautomation_syswm.c:47
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:74
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
SDLTest_AssertPass
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
Definition: SDL_test_assert.c:94
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDLTest_TestCaseReference
Definition: SDL_test_harness.h:75
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_GetWindowWMInfo
#define SDL_GetWindowWMInfo
Definition: SDL_dynapi_overrides.h:473
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
SDL_WINDOW_HIDDEN
@ SDL_WINDOW_HIDDEN
Definition: SDL_video.h:102
SDL_SysWMinfo::version
SDL_version version
Definition: SDL_syswm.h:203
syswm_getWindowWMInfo
int syswm_getWindowWMInfo(void *arg)
Call to SDL_GetWindowWMInfo.
Definition: testautomation_syswm.c:17
SDLTest_TestSuiteReference
Definition: SDL_test_harness.h:89
SDL_DestroyWindow
#define SDL_DestroyWindow
Definition: SDL_dynapi_overrides.h:549
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_syswm.h
syswmTests
static const SDLTest_TestCaseReference * syswmTests[]
Definition: testautomation_syswm.c:51