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_TestCaseReference * | syswmTests []
SDLTest_TestSuiteReference | syswmTestSuite

## Function Documentation

int syswm_getWindowWMInfo | ( | void * | arg | ) |

Call to SDL_GetWindowWMInfo.

SysWM test suite

Definition at line 17 of file testautomation_syswm.c.

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, SDL_SysWMinfo::version, and window.

{
SDL_bool result;
SDL_Window *window;
SDL_SysWMinfo info;
window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
SDLTest_AssertPass("Call to SDL_CreateWindow()");
SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
if (window == NULL) {
return TEST_ABORTED;
}
/* Initialize info structure with SDL version info */
SDL_VERSION(&info.version);
/* Make call */
result = SDL_GetWindowWMInfo(window, &info);
SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()");
SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
SDL_DestroyWindow(window);
SDLTest_AssertPass("Call to SDL_DestroyWindow()");
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
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
window
SDL_Window * window
Definition: testautomation_render.c:26
SDL_SysWMinfo::version
SDL_version version
Definition: SDL_syswm.h:183
SDL_CreateWindow
#define SDL_CreateWindow
Definition: SDL_dynapi_overrides.h:518
SDL_WINDOW_HIDDEN
Definition: SDL_video.h:101
SDL_VERSION
#define SDL_VERSION(x)
Macro to determine SDL version program was compiled against.
Definition: SDL_version.h:79
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:126
SDL_SysWMinfo
Definition: SDL_syswm.h:181
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
SDL_TRUE
Definition: SDL_stdinc.h:129
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_GetWindowWMInfo
#define SDL_GetWindowWMInfo
Definition: SDL_dynapi_overrides.h:477
NULL
#define NULL
Definition: begin_code.h:143
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:71
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:71
SDL_DestroyWindow
#define SDL_DestroyWindow
Definition: SDL_dynapi_overrides.h:553

## Variable Documentation

const SDLTest_TestCaseReference syswmTest1

static

Initial value:
=
{ (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
syswm_getWindowWMInfo
int syswm_getWindowWMInfo(void *arg)
Call to SDL_GetWindowWMInfo.
Definition: testautomation_syswm.c:17

Definition at line 47 of file testautomation_syswm.c.

const SDLTest_TestCaseReference* syswmTests[]

static

Initial value:
= {
&syswmTest1, NULL
}
syswmTest1
static const SDLTest_TestCaseReference syswmTest1
Definition: testautomation_syswm.c:47
NULL
#define NULL
Definition: begin_code.h:143

Definition at line 51 of file testautomation_syswm.c.

SDLTest_TestSuiteReference syswmTestSuite

Initial value:
= {
"SysWM",
NULL,
syswmTests,
NULL
}
syswmTests
static const SDLTest_TestCaseReference * syswmTests[]
Definition: testautomation_syswm.c:51
NULL
#define NULL
Definition: begin_code.h:143

Definition at line 56 of file testautomation_syswm.c.