SDL 2.0
testautomation_syswm.c File Reference
#include <stdio.h>
#include "SDL.h"
#include "SDL_syswm.h"
#include "SDL_test.h"
+ Include dependency graph for testautomation_syswm.c:

Go to the source code of this file.

Functions

int syswm_getWindowWMInfo (void *arg)
 Call to SDL_GetWindowWMInfo. More...
 

Variables

static const SDLTest_TestCaseReference syswmTest1
 
static const SDLTest_TestCaseReferencesyswmTests []
 
SDLTest_TestSuiteReference syswmTestSuite
 

Function Documentation

◆ syswm_getWindowWMInfo()

int syswm_getWindowWMInfo ( void arg)

Call to SDL_GetWindowWMInfo.

SysWM test suite

Definition at line 17 of file testautomation_syswm.c.

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}
#define SDL_DestroyWindow
#define SDL_CreateWindow
#define SDL_GetWindowWMInfo
GLuint64EXT * result
SDL_bool
Definition: SDL_stdinc.h:162
@ SDL_TRUE
Definition: SDL_stdinc.h:164
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.
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...
#define TEST_COMPLETED
#define TEST_ABORTED
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
#define SDL_VERSION(x)
Macro to determine SDL version program was compiled against.
Definition: SDL_version.h:79
@ SDL_WINDOW_HIDDEN
Definition: SDL_video.h:103
#define NULL
Definition: begin_code.h:167
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_version version
Definition: SDL_syswm.h:199
The type used to identify a window.
Definition: SDL_sysvideo.h:74

References NULL, SDL_CreateWindow, SDL_DestroyWindow, SDL_GetWindowWMInfo, SDL_TRUE, SDL_VERSION, SDL_WINDOW_HIDDEN, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_Log(), TEST_ABORTED, TEST_COMPLETED, and SDL_SysWMinfo::version.

Variable Documentation

◆ syswmTest1

const SDLTest_TestCaseReference syswmTest1
static
Initial value:
=
{ (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED }
#define TEST_ENABLED
int(* SDLTest_TestCaseFp)(void *arg)
int syswm_getWindowWMInfo(void *arg)
Call to SDL_GetWindowWMInfo.

Definition at line 47 of file testautomation_syswm.c.

◆ syswmTests

const SDLTest_TestCaseReference* syswmTests[]
static
Initial value:
= {
}
static const SDLTest_TestCaseReference syswmTest1

Definition at line 51 of file testautomation_syswm.c.

◆ syswmTestSuite

Initial value:
= {
"SysWM",
}
static const SDLTest_TestCaseReference * syswmTests[]

Definition at line 56 of file testautomation_syswm.c.