testautomation_mouse.c File Reference
`#include <stdio.h>`
`#include <limits.h>`
`#include "SDL.h"`
`#include "SDL_test.h"`
Include dependency graph for testautomation_mouse.c:

Go to the source code of this file.

## Macros

#define | MOUSE_TESTWINDOW_WIDTH 320
#define | MOUSE_TESTWINDOW_HEIGHT 200

## Functions

int | _mouseStateCheck (Uint32 state)
int | mouse_getMouseState (void *arg)
| Check call to SDL_GetMouseState. More...
int | mouse_getRelativeMouseState (void *arg)
| Check call to SDL_GetRelativeMouseState. More...
static SDL_Cursor * | _initArrowCursor (const char *image[])
int | mouse_createFreeCursor (void *arg)
| Check call to SDL_CreateCursor and SDL_FreeCursor. More...
int | mouse_createFreeColorCursor (void *arg)
| Check call to SDL_CreateColorCursor and SDL_FreeCursor. More...
void | _changeCursorVisibility (int state)
int | mouse_showCursor (void *arg)
| Check call to SDL_ShowCursor. More...
int | mouse_setCursor (void *arg)
| Check call to SDL_SetCursor. More...
int | mouse_getCursor (void *arg)
| Check call to SDL_GetCursor. More...
int | mouse_getSetRelativeMouseMode (void *arg)
| Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode. More...
SDL_Window * | _createMouseSuiteTestWindow ()
void | _destroyMouseSuiteTestWindow (SDL_Window *window)
int | mouse_warpMouseInWindow (void *arg)
| Check call to SDL_WarpMouseInWindow. More...
int | mouse_getMouseFocus (void *arg)
| Check call to SDL_GetMouseFocus. More...

## Variables

static const char * | _mouseArrowData []
static const SDLTest_TestCaseReference | mouseTest1
static const SDLTest_TestCaseReference | mouseTest2
static const SDLTest_TestCaseReference | mouseTest3
static const SDLTest_TestCaseReference | mouseTest4
static const SDLTest_TestCaseReference | mouseTest5
static const SDLTest_TestCaseReference | mouseTest6
static const SDLTest_TestCaseReference | mouseTest7
static const SDLTest_TestCaseReference | mouseTest8
static const SDLTest_TestCaseReference | mouseTest9
static const SDLTest_TestCaseReference | mouseTest10
static const SDLTest_TestCaseReference * | mouseTests []
SDLTest_TestSuiteReference | mouseTestSuite

## Macro Definition Documentation

## MOUSE_TESTWINDOW_HEIGHT

#define MOUSE_TESTWINDOW_HEIGHT 200

Definition at line 413 of file testautomation_mouse.c.

Referenced by _createMouseSuiteTestWindow(), mouse_getMouseFocus(), and mouse_warpMouseInWindow().

## MOUSE_TESTWINDOW_WIDTH

#define MOUSE_TESTWINDOW_WIDTH 320

Definition at line 412 of file testautomation_mouse.c.

Referenced by _createMouseSuiteTestWindow(), mouse_getMouseFocus(), and mouse_warpMouseInWindow().

## Function Documentation

## _changeCursorVisibility()

void _changeCursorVisibility | ( | int | state | ) |

Definition at line 255 of file testautomation_mouse.c.

References SDL_ENABLE, SDL_QUERY, SDL_ShowCursor, SDLTest_AssertCheck(), and SDLTest_AssertPass().

Referenced by mouse_showCursor().

{
int oldState;
int newState;
int result;
oldState = SDL_ShowCursor(SDL_QUERY);
SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)");
result = SDL_ShowCursor(state);
SDLTest_AssertPass("Call to SDL_ShowCursor(%s)", (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE");
SDLTest_AssertCheck(result == oldState, "Validate result from SDL_ShowCursor(%s), expected: %i, got: %i",
(state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE", oldState, result);
newState = SDL_ShowCursor(SDL_QUERY);
SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)");
SDLTest_AssertCheck(state == newState, "Validate new state, expected: %i, got: %i",
state, newState);
}
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
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
SDL_ENABLE
#define SDL_ENABLE
Definition: SDL_events.h:722
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_QUERY
#define SDL_QUERY
Definition: SDL_events.h:719
SDL_ShowCursor
#define SDL_ShowCursor
Definition: SDL_dynapi_overrides.h:258

## _createMouseSuiteTestWindow()

SDL_Window* _createMouseSuiteTestWindow | ( |  | ) |

Creates a test window

Definition at line 418 of file testautomation_mouse.c.

References MOUSE_TESTWINDOW_HEIGHT, MOUSE_TESTWINDOW_WIDTH, NULL, SDL_CreateWindow, SDLTest_AssertCheck(), and SDLTest_AssertPass().

Referenced by mouse_getMouseFocus(), and mouse_warpMouseInWindow().

{
int posX = 100, posY = 100, width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT;
SDL_Window *window;
window = SDL_CreateWindow("mouse_createMouseSuiteTestWindow", posX, posY, width, height, 0);
SDLTest_AssertPass("SDL_CreateWindow()");
SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
return window;
}
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
SDL_CreateWindow
#define SDL_CreateWindow
Definition: SDL_dynapi_overrides.h:514
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
MOUSE_TESTWINDOW_WIDTH
#define MOUSE_TESTWINDOW_WIDTH
Definition: testautomation_mouse.c:412
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
NULL
#define NULL
Definition: begin_code.h:164
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
MOUSE_TESTWINDOW_HEIGHT
#define MOUSE_TESTWINDOW_HEIGHT
Definition: testautomation_mouse.c:413

## _destroyMouseSuiteTestWindow()

void _destroyMouseSuiteTestWindow | ( | SDL_Window * | window | ) |

Definition at line 431 of file testautomation_mouse.c.

References NULL, SDL_DestroyWindow, and SDLTest_AssertPass().

Referenced by mouse_getMouseFocus(), and mouse_warpMouseInWindow().

{
if (window != NULL) {
SDL_DestroyWindow(window);
window = NULL;
SDLTest_AssertPass("SDL_DestroyWindow()");
}
}
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
NULL
#define NULL
Definition: begin_code.h:164
SDL_DestroyWindow
#define SDL_DestroyWindow
Definition: SDL_dynapi_overrides.h:549

## _initArrowCursor()

static SDL_Cursor* _initArrowCursor | ( | const char * | image[] | ) |

static

Definition at line 157 of file testautomation_mouse.c.

References cursor, i, and SDL_CreateCursor.

Referenced by mouse_createFreeCursor(), and mouse_setCursor().

{
SDL_Cursor *cursor;
int i, row, col;
Uint8 data[4*32];
Uint8 mask[4*32];
i = -1;
for ( row=0; row<32; ++row ) {
for ( col=0; col<32; ++col ) {
if ( col % 8 ) {
data[i] <<= 1;
mask[i] <<= 1;
} else {
++i;
data[i] = mask[i] = 0;
}
switch (image[row][col]) {
case 'X':
data[i] |= 0x01;
mask[i] |= 0x01;
break;
case '.':
mask[i] |= 0x01;
break;
case ' ':
break;
}
}
}
cursor = SDL_CreateCursor(data, mask, 32, 32, 0, 0);
return cursor;
}
image
GLeglImageOES image
Definition: SDL_opengl.h:2148
SDL_Cursor
Definition: SDL_mouse_c.h:30
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:157
mask
GLenum GLint GLuint mask
Definition: SDL_opengl_glext.h:657
cursor
SDL_Cursor * cursor
Definition: testcustomcursor.c:119
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_CreateCursor
#define SDL_CreateCursor
Definition: SDL_dynapi_overrides.h:251
row
GLenum GLenum void * row
Definition: SDL_opengl_glext.h:3138

## _mouseStateCheck()

int _mouseStateCheck | ( | Uint32 | state | ) |

Mouse test suite

Definition at line 16 of file testautomation_mouse.c.

References SDL_BUTTON, SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_X1, and SDL_BUTTON_X2.

Referenced by mouse_getMouseState(), and mouse_getRelativeMouseState().

{
return (state == 0) ||
(state == SDL_BUTTON(SDL_BUTTON_LEFT)) ||
(state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) ||
(state == SDL_BUTTON(SDL_BUTTON_RIGHT)) ||
(state == SDL_BUTTON(SDL_BUTTON_X1)) ||
(state == SDL_BUTTON(SDL_BUTTON_X2));
}
SDL_BUTTON_RIGHT
#define SDL_BUTTON_RIGHT
Definition: SDL_mouse.h:284
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
SDL_BUTTON_X1
#define SDL_BUTTON_X1
Definition: SDL_mouse.h:285
SDL_BUTTON_LEFT
#define SDL_BUTTON_LEFT
Definition: SDL_mouse.h:282
SDL_BUTTON_MIDDLE
#define SDL_BUTTON_MIDDLE
Definition: SDL_mouse.h:283
SDL_BUTTON
#define SDL_BUTTON(X)
Definition: SDL_mouse.h:281
SDL_BUTTON_X2
#define SDL_BUTTON_X2
Definition: SDL_mouse.h:286

## mouse_createFreeColorCursor()

int mouse_createFreeColorCursor | ( | void * | arg | ) |

Check call to SDL_CreateColorCursor and SDL_FreeCursor.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_CreateColorCursor
  http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor

Definition at line 225 of file testautomation_mouse.c.

References cursor, NULL, SDL_CreateColorCursor, SDL_FreeCursor, SDL_FreeSurface, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_ImageFace(), TEST_ABORTED, and TEST_COMPLETED.

{
SDL_Surface *face;
SDL_Cursor *cursor;
/* Get sample surface */
face = SDLTest_ImageFace();
SDLTest_AssertCheck(face != NULL, "Validate sample input image is not NULL");
if (face == NULL) return TEST_ABORTED;
/* Create a color cursor from surface */
cursor = SDL_CreateColorCursor(face, 0, 0);
SDLTest_AssertPass("Call to SDL_CreateColorCursor()");
SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL");
if (cursor == NULL) {
SDL_FreeSurface(face);
return TEST_ABORTED;
}
/* Free cursor again */
SDL_FreeCursor(cursor);
SDLTest_AssertPass("Call to SDL_FreeCursor()");
/* Clean up */
SDL_FreeSurface(face);
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
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
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
SDL_Cursor
Definition: SDL_mouse_c.h:30
SDLTest_ImageFace
SDL_Surface * SDLTest_ImageFace(void)
Returns the Face test image as SDL_Surface.
Definition: SDL_test_imageFace.c:224
face
GLenum GLuint GLint GLenum face
Definition: SDL_opengl_glext.h:3019
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_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:446
SDL_CreateColorCursor
#define SDL_CreateColorCursor
Definition: SDL_dynapi_overrides.h:252
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
cursor
SDL_Cursor * cursor
Definition: testcustomcursor.c:119
NULL
#define NULL
Definition: begin_code.h:164
SDL_FreeCursor
#define SDL_FreeCursor
Definition: SDL_dynapi_overrides.h:257

## mouse_createFreeCursor()

int mouse_createFreeCursor | ( | void * | arg | ) |

Check call to SDL_CreateCursor and SDL_FreeCursor.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_CreateCursor
  http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor

Definition at line 199 of file testautomation_mouse.c.

References _initArrowCursor(), _mouseArrowData, cursor, NULL, SDL_FreeCursor, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, and TEST_COMPLETED.

{
SDL_Cursor *cursor;
/* Create a cursor */
cursor = _initArrowCursor(_mouseArrowData);
SDLTest_AssertPass("Call to SDL_CreateCursor()");
SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL");
if (cursor == NULL) {
return TEST_ABORTED;
}
/* Free cursor again */
SDL_FreeCursor(cursor);
SDLTest_AssertPass("Call to SDL_FreeCursor()");
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
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
SDL_Cursor
Definition: SDL_mouse_c.h:30
_initArrowCursor
static SDL_Cursor * _initArrowCursor(const char *image[])
Definition: testautomation_mouse.c:157
_mouseArrowData
static const char * _mouseArrowData[]
Definition: testautomation_mouse.c:120
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
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
cursor
SDL_Cursor * cursor
Definition: testcustomcursor.c:119
NULL
#define NULL
Definition: begin_code.h:164
SDL_FreeCursor
#define SDL_FreeCursor
Definition: SDL_dynapi_overrides.h:257

## mouse_getCursor()

int mouse_getCursor | ( | void * | arg | ) |

Check call to SDL_GetCursor.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_GetCursor

Definition at line 344 of file testautomation_mouse.c.

References cursor, NULL, SDL_GetCursor, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

{
SDL_Cursor *cursor;
/* Get current cursor */
cursor = SDL_GetCursor();
SDLTest_AssertPass("Call to SDL_GetCursor()");
SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL");
return TEST_COMPLETED;
}
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
SDL_Cursor
Definition: SDL_mouse_c.h:30
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
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
cursor
SDL_Cursor * cursor
Definition: testcustomcursor.c:119
NULL
#define NULL
Definition: begin_code.h:164
SDL_GetCursor
#define SDL_GetCursor
Definition: SDL_dynapi_overrides.h:255

## mouse_getMouseFocus()

int mouse_getMouseFocus | ( | void * | arg | ) |

Check call to SDL_GetMouseFocus.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_GetMouseFocus

Definition at line 508 of file testautomation_mouse.c.

References _createMouseSuiteTestWindow(), _destroyMouseSuiteTestWindow(), MOUSE_TESTWINDOW_HEIGHT, MOUSE_TESTWINDOW_WIDTH, NULL, SDL_GetMouseFocus, SDL_PumpEvents, SDL_WarpMouseInWindow, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), TEST_ABORTED, and TEST_COMPLETED.

{
const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT;
int x, y;
SDL_Window *window;
SDL_Window *focusWindow;
/* Get focus - focus non-deterministic */
focusWindow = SDL_GetMouseFocus();
SDLTest_AssertPass("SDL_GetMouseFocus()");
/* Create test window */
window = _createMouseSuiteTestWindow();
if (window == NULL) return TEST_ABORTED;
/* Mouse to random position inside window */
x = SDLTest_RandomIntegerInRange(1, w-1);
y = SDLTest_RandomIntegerInRange(1, h-1);
SDL_WarpMouseInWindow(window, x, y);
SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
/* Pump events to update focus state */
SDL_PumpEvents();
SDLTest_AssertPass("SDL_PumpEvents()");
/* Get focus with explicit window setup - focus deterministic */
focusWindow = SDL_GetMouseFocus();
SDLTest_AssertPass("SDL_GetMouseFocus()");
SDLTest_AssertCheck (focusWindow != NULL, "Check returned window value is not NULL");
SDLTest_AssertCheck (focusWindow == window, "Check returned window value is test window");
/* Mouse to random position outside window */
x = SDLTest_RandomIntegerInRange(-9, -1);
y = SDLTest_RandomIntegerInRange(-9, -1);
SDL_WarpMouseInWindow(window, x, y);
SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
/* Clean up test window */
_destroyMouseSuiteTestWindow(window);
/* Pump events to update focus state */
SDL_PumpEvents();
SDLTest_AssertPass("SDL_PumpEvents()");
/* Get focus for non-existing window */
focusWindow = SDL_GetMouseFocus();
SDLTest_AssertPass("SDL_GetMouseFocus()");
SDLTest_AssertCheck (focusWindow == NULL, "Check returned window value is NULL");
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
_destroyMouseSuiteTestWindow
void _destroyMouseSuiteTestWindow(SDL_Window *window)
Definition: testautomation_mouse.c:431
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
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946
_createMouseSuiteTestWindow
SDL_Window * _createMouseSuiteTestWindow()
Definition: testautomation_mouse.c:418
MOUSE_TESTWINDOW_WIDTH
#define MOUSE_TESTWINDOW_WIDTH
Definition: testautomation_mouse.c:412
SDL_PumpEvents
#define SDL_PumpEvents
Definition: SDL_dynapi_overrides.h:116
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
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_GetMouseFocus
#define SDL_GetMouseFocus
Definition: SDL_dynapi_overrides.h:245
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_WarpMouseInWindow
#define SDL_WarpMouseInWindow
Definition: SDL_dynapi_overrides.h:248
MOUSE_TESTWINDOW_HEIGHT
#define MOUSE_TESTWINDOW_HEIGHT
Definition: testautomation_mouse.c:413

## mouse_getMouseState()

int mouse_getMouseState | ( | void * | arg | ) |

Check call to SDL_GetMouseState.

Definition at line 31 of file testautomation_mouse.c.

References _mouseStateCheck(), NULL, SDL_GetMouseState, SDL_PumpEvents, SDLTest_AssertCheck(), SDLTest_AssertPass(), state, and TEST_COMPLETED.

{
int x;
int y;
Uint32 state;
/* Pump some events to update mouse state */
SDL_PumpEvents();
SDLTest_AssertPass("Call to SDL_PumpEvents()");
/* Case where x, y pointer is NULL */
state = SDL_GetMouseState(NULL, NULL);
SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)");
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
/* Case where x pointer is not NULL */
x = INT_MIN;
state = SDL_GetMouseState(&x, NULL);
SDLTest_AssertPass("Call to SDL_GetMouseState(&x, NULL)");
SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
/* Case where y pointer is not NULL */
y = INT_MIN;
state = SDL_GetMouseState(NULL, &y);
SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, &y)");
SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
/* Case where x and y pointer is not NULL */
x = INT_MIN;
y = INT_MIN;
state = SDL_GetMouseState(&x, &y);
SDLTest_AssertPass("Call to SDL_GetMouseState(&x, &y)");
SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
return TEST_COMPLETED;
}
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
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
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:181
SDL_PumpEvents
#define SDL_PumpEvents
Definition: SDL_dynapi_overrides.h:116
_mouseStateCheck
int _mouseStateCheck(Uint32 state)
Definition: testautomation_mouse.c:16
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
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_GetMouseState
#define SDL_GetMouseState
Definition: SDL_dynapi_overrides.h:246

## mouse_getRelativeMouseState()

int mouse_getRelativeMouseState | ( | void * | arg | ) |

Check call to SDL_GetRelativeMouseState.

Definition at line 77 of file testautomation_mouse.c.

References _mouseStateCheck(), NULL, SDL_GetRelativeMouseState, SDL_PumpEvents, SDLTest_AssertCheck(), SDLTest_AssertPass(), state, and TEST_COMPLETED.

{
int x;
int y;
Uint32 state;
/* Pump some events to update mouse state */
SDL_PumpEvents();
SDLTest_AssertPass("Call to SDL_PumpEvents()");
/* Case where x, y pointer is NULL */
state = SDL_GetRelativeMouseState(NULL, NULL);
SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)");
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
/* Case where x pointer is not NULL */
x = INT_MIN;
state = SDL_GetRelativeMouseState(&x, NULL);
SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, NULL)");
SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
/* Case where y pointer is not NULL */
y = INT_MIN;
state = SDL_GetRelativeMouseState(NULL, &y);
SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, &y)");
SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
/* Case where x and y pointer is not NULL */
x = INT_MIN;
y = INT_MIN;
state = SDL_GetRelativeMouseState(&x, &y);
SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, &y)");
SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
return TEST_COMPLETED;
}
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
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
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:181
SDL_PumpEvents
#define SDL_PumpEvents
Definition: SDL_dynapi_overrides.h:116
_mouseStateCheck
int _mouseStateCheck(Uint32 state)
Definition: testautomation_mouse.c:16
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_GetRelativeMouseState
#define SDL_GetRelativeMouseState
Definition: SDL_dynapi_overrides.h:247
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164

## mouse_getSetRelativeMouseMode()

int mouse_getSetRelativeMouseMode | ( | void * | arg | ) |

Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_GetRelativeMouseMode
  http://wiki.libsdl.org/moin.cgi/SDL_SetRelativeMouseMode

Definition at line 363 of file testautomation_mouse.c.

References i, SDL_FALSE, SDL_GetRelativeMouseMode, SDL_SetRelativeMouseMode, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

{
int result;
int i;
SDL_bool initialState;
SDL_bool currentState;
/* Capture original state so we can revert back to it later */
initialState = SDL_GetRelativeMouseMode();
SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
/* Repeat twice to check D->D transition */
for (i=0; i<2; i++) {
/* Disable - should always be supported */
result = SDL_SetRelativeMouseMode(SDL_FALSE);
SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)");
SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
currentState = SDL_GetRelativeMouseMode();
SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState);
}
/* Repeat twice to check D->E->E transition */
for (i=0; i<2; i++) {
/* Enable - may not be supported */
result = SDL_SetRelativeMouseMode(SDL_TRUE);
SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(TRUE)");
if (result != -1) {
SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
currentState = SDL_GetRelativeMouseMode();
SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
SDLTest_AssertCheck(currentState == SDL_TRUE, "Validate current state is TRUE, got: %i", currentState);
}
}
/* Disable to check E->D transition */
result = SDL_SetRelativeMouseMode(SDL_FALSE);
SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)");
SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
currentState = SDL_GetRelativeMouseMode();
SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState);
/* Revert to original state - ignore result */
result = SDL_SetRelativeMouseMode(initialState);
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
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
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_SetRelativeMouseMode
#define SDL_SetRelativeMouseMode
Definition: SDL_dynapi_overrides.h:249
SDL_GetRelativeMouseMode
#define SDL_GetRelativeMouseMode
Definition: SDL_dynapi_overrides.h:250
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
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139

## mouse_setCursor()

int mouse_setCursor | ( | void * | arg | ) |

Check call to SDL_SetCursor.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetCursor

Definition at line 311 of file testautomation_mouse.c.

References _initArrowCursor(), _mouseArrowData, cursor, NULL, SDL_FreeCursor, SDL_SetCursor, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, and TEST_COMPLETED.

{
SDL_Cursor *cursor;
/* Create a cursor */
cursor = _initArrowCursor(_mouseArrowData);
SDLTest_AssertPass("Call to SDL_CreateCursor()");
SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL");
if (cursor == NULL) {
return TEST_ABORTED;
}
/* Set the arrow cursor */
SDL_SetCursor(cursor);
SDLTest_AssertPass("Call to SDL_SetCursor(cursor)");
/* Force redraw */
SDL_SetCursor(NULL);
SDLTest_AssertPass("Call to SDL_SetCursor(NULL)");
/* Free cursor again */
SDL_FreeCursor(cursor);
SDLTest_AssertPass("Call to SDL_FreeCursor()");
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
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
SDL_Cursor
Definition: SDL_mouse_c.h:30
_initArrowCursor
static SDL_Cursor * _initArrowCursor(const char *image[])
Definition: testautomation_mouse.c:157
SDL_SetCursor
#define SDL_SetCursor
Definition: SDL_dynapi_overrides.h:254
_mouseArrowData
static const char * _mouseArrowData[]
Definition: testautomation_mouse.c:120
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
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
cursor
SDL_Cursor * cursor
Definition: testcustomcursor.c:119
NULL
#define NULL
Definition: begin_code.h:164
SDL_FreeCursor
#define SDL_FreeCursor
Definition: SDL_dynapi_overrides.h:257

## mouse_showCursor()

int mouse_showCursor | ( | void * | arg | ) |

Check call to SDL_ShowCursor.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_ShowCursor

Definition at line 281 of file testautomation_mouse.c.

References _changeCursorVisibility(), SDL_DISABLE, SDL_ENABLE, SDL_QUERY, SDL_ShowCursor, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, and TEST_COMPLETED.

{
int currentState;
/* Get current state */
currentState = SDL_ShowCursor(SDL_QUERY);
SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)");
SDLTest_AssertCheck(currentState == SDL_DISABLE || currentState == SDL_ENABLE,
"Validate result is %i or %i, got: %i", SDL_DISABLE, SDL_ENABLE, currentState);
if (currentState == SDL_DISABLE) {
/* Show the cursor, then hide it again */
_changeCursorVisibility(SDL_ENABLE);
_changeCursorVisibility(SDL_DISABLE);
} else if (currentState == SDL_ENABLE) {
/* Hide the cursor, then show it again */
_changeCursorVisibility(SDL_DISABLE);
_changeCursorVisibility(SDL_ENABLE);
} else {
return TEST_ABORTED;
}
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
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
SDL_ENABLE
#define SDL_ENABLE
Definition: SDL_events.h:722
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
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_DISABLE
#define SDL_DISABLE
Definition: SDL_events.h:721
SDL_QUERY
#define SDL_QUERY
Definition: SDL_events.h:719
_changeCursorVisibility
void _changeCursorVisibility(int state)
Definition: testautomation_mouse.c:255
SDL_ShowCursor
#define SDL_ShowCursor
Definition: SDL_dynapi_overrides.h:258

## mouse_warpMouseInWindow()

int mouse_warpMouseInWindow | ( | void * | arg | ) |

Check call to SDL_WarpMouseInWindow.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_WarpMouseInWindow

Definition at line 446 of file testautomation_mouse.c.

References _createMouseSuiteTestWindow(), _destroyMouseSuiteTestWindow(), i, j, MOUSE_TESTWINDOW_HEIGHT, MOUSE_TESTWINDOW_WIDTH, NULL, SDL_PumpEvents, SDL_WarpMouseInWindow, SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), TEST_ABORTED, and TEST_COMPLETED.

{
const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT;
int numPositions = 6;
int xPositions[6];
int yPositions[6];
int x, y, i, j;
SDL_Window *window;
xPositions[0] = -1;
xPositions[1] = 0;
xPositions[2] = 1;
xPositions[3] = w-1;
xPositions[4] = w;
xPositions[5] = w+1;
yPositions[0] = -1;
yPositions[1] = 0;
yPositions[2] = 1;
yPositions[3] = h-1;
yPositions[4] = h;
yPositions[5] = h+1;
/* Create test window */
window = _createMouseSuiteTestWindow();
if (window == NULL) return TEST_ABORTED;
/* Mouse to random position inside window */
x = SDLTest_RandomIntegerInRange(1, w-1);
y = SDLTest_RandomIntegerInRange(1, h-1);
SDL_WarpMouseInWindow(window, x, y);
SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
/* Same position again */
SDL_WarpMouseInWindow(window, x, y);
SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
/* Mouse to various boundary positions */
for (i=0; i<numPositions; i++) {
for (j=0; j<numPositions; j++) {
x = xPositions[i];
y = yPositions[j];
SDL_WarpMouseInWindow(window, x, y);
SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
/* TODO: add tracking of events and check that each call generates a mouse motion event */
SDL_PumpEvents();
SDLTest_AssertPass("SDL_PumpEvents()");
}
}
/* Clean up test window */
_destroyMouseSuiteTestWindow(window);
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
_destroyMouseSuiteTestWindow
void _destroyMouseSuiteTestWindow(SDL_Window *window)
Definition: testautomation_mouse.c:431
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
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946
_createMouseSuiteTestWindow
SDL_Window * _createMouseSuiteTestWindow()
Definition: testautomation_mouse.c:418
MOUSE_TESTWINDOW_WIDTH
#define MOUSE_TESTWINDOW_WIDTH
Definition: testautomation_mouse.c:412
SDL_PumpEvents
#define SDL_PumpEvents
Definition: SDL_dynapi_overrides.h:116
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:50
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
NULL
#define NULL
Definition: begin_code.h:164
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_WarpMouseInWindow
#define SDL_WarpMouseInWindow
Definition: SDL_dynapi_overrides.h:248
MOUSE_TESTWINDOW_HEIGHT
#define MOUSE_TESTWINDOW_HEIGHT
Definition: testautomation_mouse.c:413

## Variable Documentation

## _mouseArrowData

const char* _mouseArrowData[]

static

Definition at line 120 of file testautomation_mouse.c.

Referenced by mouse_createFreeCursor(), and mouse_setCursor().

## mouseTest1

const SDLTest_TestCaseReference mouseTest1

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_getMouseState, "mouse_getMouseState", "Check call to SDL_GetMouseState", TEST_ENABLED }
mouse_getMouseState
int mouse_getMouseState(void *arg)
Check call to SDL_GetMouseState.
Definition: testautomation_mouse.c:31
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 564 of file testautomation_mouse.c.

## mouseTest10

const SDLTest_TestCaseReference mouseTest10

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_getSetRelativeMouseMode, "mouse_getSetRelativeMouseMode", "Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode", 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
mouse_getSetRelativeMouseMode
int mouse_getSetRelativeMouseMode(void *arg)
Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode.
Definition: testautomation_mouse.c:363

Definition at line 591 of file testautomation_mouse.c.

## mouseTest2

const SDLTest_TestCaseReference mouseTest2

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_getRelativeMouseState, "mouse_getRelativeMouseState", "Check call to SDL_GetRelativeMouseState", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
mouse_getRelativeMouseState
int mouse_getRelativeMouseState(void *arg)
Check call to SDL_GetRelativeMouseState.
Definition: testautomation_mouse.c:77
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 567 of file testautomation_mouse.c.

## mouseTest3

const SDLTest_TestCaseReference mouseTest3

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_createFreeCursor, "mouse_createFreeCursor", "Check call to SDL_CreateCursor and SDL_FreeCursor", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
mouse_createFreeCursor
int mouse_createFreeCursor(void *arg)
Check call to SDL_CreateCursor and SDL_FreeCursor.
Definition: testautomation_mouse.c:199
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 570 of file testautomation_mouse.c.

## mouseTest4

const SDLTest_TestCaseReference mouseTest4

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_showCursor, "mouse_showCursor", "Check call to SDL_ShowCursor", 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
mouse_showCursor
int mouse_showCursor(void *arg)
Check call to SDL_ShowCursor.
Definition: testautomation_mouse.c:281

Definition at line 573 of file testautomation_mouse.c.

## mouseTest5

const SDLTest_TestCaseReference mouseTest5

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_setCursor, "mouse_setCursor", "Check call to SDL_SetCursor", 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
mouse_setCursor
int mouse_setCursor(void *arg)
Check call to SDL_SetCursor.
Definition: testautomation_mouse.c:311

Definition at line 576 of file testautomation_mouse.c.

## mouseTest6

const SDLTest_TestCaseReference mouseTest6

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_getCursor, "mouse_getCursor", "Check call to SDL_GetCursor", TEST_ENABLED }
mouse_getCursor
int mouse_getCursor(void *arg)
Check call to SDL_GetCursor.
Definition: testautomation_mouse.c:344
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 579 of file testautomation_mouse.c.

## mouseTest7

const SDLTest_TestCaseReference mouseTest7

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_warpMouseInWindow, "mouse_warpMouseInWindow", "Check call to SDL_WarpMouseInWindow", TEST_ENABLED }
mouse_warpMouseInWindow
int mouse_warpMouseInWindow(void *arg)
Check call to SDL_WarpMouseInWindow.
Definition: testautomation_mouse.c:446
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 582 of file testautomation_mouse.c.

## mouseTest8

const SDLTest_TestCaseReference mouseTest8

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_getMouseFocus, "mouse_getMouseFocus", "Check call to SDL_getMouseFocus", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
mouse_getMouseFocus
int mouse_getMouseFocus(void *arg)
Check call to SDL_GetMouseFocus.
Definition: testautomation_mouse.c:508
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 585 of file testautomation_mouse.c.

## mouseTest9

const SDLTest_TestCaseReference mouseTest9

static

Initial value:
=
{ (SDLTest_TestCaseFp)mouse_createFreeColorCursor, "mouse_createFreeColorCursor", "Check call to SDL_CreateColorCursor and SDL_FreeCursor", TEST_ENABLED }
mouse_createFreeColorCursor
int mouse_createFreeColorCursor(void *arg)
Check call to SDL_CreateColorCursor and SDL_FreeCursor.
Definition: testautomation_mouse.c:225
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 588 of file testautomation_mouse.c.

## mouseTests

const SDLTest_TestCaseReference* mouseTests[]

static

Initial value:
= {
&mouseTest1, &mouseTest2, &mouseTest3, &mouseTest4, &mouseTest5, &mouseTest6,
&mouseTest7, &mouseTest8, &mouseTest9, &mouseTest10, NULL
}
mouseTest8
static const SDLTest_TestCaseReference mouseTest8
Definition: testautomation_mouse.c:585
mouseTest1
static const SDLTest_TestCaseReference mouseTest1
Definition: testautomation_mouse.c:564
mouseTest6
static const SDLTest_TestCaseReference mouseTest6
Definition: testautomation_mouse.c:579
mouseTest5
static const SDLTest_TestCaseReference mouseTest5
Definition: testautomation_mouse.c:576
mouseTest7
static const SDLTest_TestCaseReference mouseTest7
Definition: testautomation_mouse.c:582
mouseTest3
static const SDLTest_TestCaseReference mouseTest3
Definition: testautomation_mouse.c:570
mouseTest10
static const SDLTest_TestCaseReference mouseTest10
Definition: testautomation_mouse.c:591
mouseTest4
static const SDLTest_TestCaseReference mouseTest4
Definition: testautomation_mouse.c:573
NULL
#define NULL
Definition: begin_code.h:164
mouseTest9
static const SDLTest_TestCaseReference mouseTest9
Definition: testautomation_mouse.c:588
mouseTest2
static const SDLTest_TestCaseReference mouseTest2
Definition: testautomation_mouse.c:567

Definition at line 595 of file testautomation_mouse.c.

## mouseTestSuite

SDLTest_TestSuiteReference mouseTestSuite

Initial value:
= {
"Mouse",
NULL,
mouseTests,
NULL
}
NULL
#define NULL
Definition: begin_code.h:164
mouseTests
static const SDLTest_TestCaseReference * mouseTests[]
Definition: testautomation_mouse.c:595

Definition at line 601 of file testautomation_mouse.c.