SDL  2.0
testautomation_mouse.c
Go to the documentation of this file.
1 /**
2  * Mouse test suite
3  */
4 
5 #include <stdio.h>
6 #include <limits.h>
7 
8 #include "SDL.h"
9 #include "SDL_test.h"
10 
11 /* ================= Test Case Implementation ================== */
12 
13 /* Test case functions */
14 
15 /* Helper to evaluate state returned from SDL_GetMouseState */
17 {
18  return (state == 0) ||
19  (state == SDL_BUTTON(SDL_BUTTON_LEFT)) ||
20  (state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) ||
21  (state == SDL_BUTTON(SDL_BUTTON_RIGHT)) ||
22  (state == SDL_BUTTON(SDL_BUTTON_X1)) ||
23  (state == SDL_BUTTON(SDL_BUTTON_X2));
24 }
25 
26 /**
27  * @brief Check call to SDL_GetMouseState
28  *
29  */
30 int
32 {
33  int x;
34  int y;
35  Uint32 state;
36 
37  /* Pump some events to update mouse state */
39  SDLTest_AssertPass("Call to SDL_PumpEvents()");
40 
41  /* Case where x, y pointer is NULL */
42  state = SDL_GetMouseState(NULL, NULL);
43  SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)");
44  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
45 
46  /* Case where x pointer is not NULL */
47  x = INT_MIN;
48  state = SDL_GetMouseState(&x, NULL);
49  SDLTest_AssertPass("Call to SDL_GetMouseState(&x, NULL)");
50  SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
51  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
52 
53  /* Case where y pointer is not NULL */
54  y = INT_MIN;
55  state = SDL_GetMouseState(NULL, &y);
56  SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, &y)");
57  SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
58  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
59 
60  /* Case where x and y pointer is not NULL */
61  x = INT_MIN;
62  y = INT_MIN;
63  state = SDL_GetMouseState(&x, &y);
64  SDLTest_AssertPass("Call to SDL_GetMouseState(&x, &y)");
65  SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
66  SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
67  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
68 
69  return TEST_COMPLETED;
70 }
71 
72 /**
73  * @brief Check call to SDL_GetRelativeMouseState
74  *
75  */
76 int
78 {
79  int x;
80  int y;
81  Uint32 state;
82 
83  /* Pump some events to update mouse state */
85  SDLTest_AssertPass("Call to SDL_PumpEvents()");
86 
87  /* Case where x, y pointer is NULL */
89  SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)");
90  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
91 
92  /* Case where x pointer is not NULL */
93  x = INT_MIN;
94  state = SDL_GetRelativeMouseState(&x, NULL);
95  SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, NULL)");
96  SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
97  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
98 
99  /* Case where y pointer is not NULL */
100  y = INT_MIN;
101  state = SDL_GetRelativeMouseState(NULL, &y);
102  SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, &y)");
103  SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
104  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
105 
106  /* Case where x and y pointer is not NULL */
107  x = INT_MIN;
108  y = INT_MIN;
109  state = SDL_GetRelativeMouseState(&x, &y);
110  SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, &y)");
111  SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
112  SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
113  SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state);
114 
115  return TEST_COMPLETED;
116 }
117 
118 
119 /* XPM definition of mouse Cursor */
120 static const char *_mouseArrowData[] = {
121  /* pixels */
122  "X ",
123  "XX ",
124  "X.X ",
125  "X..X ",
126  "X...X ",
127  "X....X ",
128  "X.....X ",
129  "X......X ",
130  "X.......X ",
131  "X........X ",
132  "X.....XXXXX ",
133  "X..X..X ",
134  "X.X X..X ",
135  "XX X..X ",
136  "X X..X ",
137  " X..X ",
138  " X..X ",
139  " X..X ",
140  " XX ",
141  " ",
142  " ",
143  " ",
144  " ",
145  " ",
146  " ",
147  " ",
148  " ",
149  " ",
150  " ",
151  " ",
152  " ",
153  " "
154 };
155 
156 /* Helper that creates a new mouse cursor from an XPM */
157 static SDL_Cursor *_initArrowCursor(const char *image[])
158 {
160  int i, row, col;
161  Uint8 data[4*32];
162  Uint8 mask[4*32];
163 
164  i = -1;
165  for ( row=0; row<32; ++row ) {
166  for ( col=0; col<32; ++col ) {
167  if ( col % 8 ) {
168  data[i] <<= 1;
169  mask[i] <<= 1;
170  } else {
171  ++i;
172  data[i] = mask[i] = 0;
173  }
174  switch (image[row][col]) {
175  case 'X':
176  data[i] |= 0x01;
177  mask[i] |= 0x01;
178  break;
179  case '.':
180  mask[i] |= 0x01;
181  break;
182  case ' ':
183  break;
184  }
185  }
186  }
187 
188  cursor = SDL_CreateCursor(data, mask, 32, 32, 0, 0);
189  return cursor;
190 }
191 
192 /**
193  * @brief Check call to SDL_CreateCursor and SDL_FreeCursor
194  *
195  * @sa http://wiki.libsdl.org/moin.cgi/SDL_CreateCursor
196  * @sa http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor
197  */
198 int
200 {
202 
203  /* Create a cursor */
205  SDLTest_AssertPass("Call to SDL_CreateCursor()");
206  SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL");
207  if (cursor == NULL) {
208  return TEST_ABORTED;
209  }
210 
211  /* Free cursor again */
212  SDL_FreeCursor(cursor);
213  SDLTest_AssertPass("Call to SDL_FreeCursor()");
214 
215  return TEST_COMPLETED;
216 }
217 
218 /**
219  * @brief Check call to SDL_CreateColorCursor and SDL_FreeCursor
220  *
221  * @sa http://wiki.libsdl.org/moin.cgi/SDL_CreateColorCursor
222  * @sa http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor
223  */
224 int
226 {
227  SDL_Surface *face;
229 
230  /* Get sample surface */
231  face = SDLTest_ImageFace();
232  SDLTest_AssertCheck(face != NULL, "Validate sample input image is not NULL");
233  if (face == NULL) return TEST_ABORTED;
234 
235  /* Create a color cursor from surface */
236  cursor = SDL_CreateColorCursor(face, 0, 0);
237  SDLTest_AssertPass("Call to SDL_CreateColorCursor()");
238  SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL");
239  if (cursor == NULL) {
240  SDL_FreeSurface(face);
241  return TEST_ABORTED;
242  }
243 
244  /* Free cursor again */
245  SDL_FreeCursor(cursor);
246  SDLTest_AssertPass("Call to SDL_FreeCursor()");
247 
248  /* Clean up */
249  SDL_FreeSurface(face);
250 
251  return TEST_COMPLETED;
252 }
253 
254 /* Helper that changes cursor visibility */
256 {
257  int oldState;
258  int newState;
259  int result;
260 
261  oldState = SDL_ShowCursor(SDL_QUERY);
262  SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)");
263 
264  result = SDL_ShowCursor(state);
265  SDLTest_AssertPass("Call to SDL_ShowCursor(%s)", (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE");
266  SDLTest_AssertCheck(result == oldState, "Validate result from SDL_ShowCursor(%s), expected: %i, got: %i",
267  (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE", oldState, result);
268 
269  newState = SDL_ShowCursor(SDL_QUERY);
270  SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)");
271  SDLTest_AssertCheck(state == newState, "Validate new state, expected: %i, got: %i",
272  state, newState);
273 }
274 
275 /**
276  * @brief Check call to SDL_ShowCursor
277  *
278  * @sa http://wiki.libsdl.org/moin.cgi/SDL_ShowCursor
279  */
280 int
282 {
283  int currentState;
284 
285  /* Get current state */
286  currentState = SDL_ShowCursor(SDL_QUERY);
287  SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)");
288  SDLTest_AssertCheck(currentState == SDL_DISABLE || currentState == SDL_ENABLE,
289  "Validate result is %i or %i, got: %i", SDL_DISABLE, SDL_ENABLE, currentState);
290  if (currentState == SDL_DISABLE) {
291  /* Show the cursor, then hide it again */
294  } else if (currentState == SDL_ENABLE) {
295  /* Hide the cursor, then show it again */
298  } else {
299  return TEST_ABORTED;
300  }
301 
302  return TEST_COMPLETED;
303 }
304 
305 /**
306  * @brief Check call to SDL_SetCursor
307  *
308  * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetCursor
309  */
310 int
311 mouse_setCursor(void *arg)
312 {
314 
315  /* Create a cursor */
317  SDLTest_AssertPass("Call to SDL_CreateCursor()");
318  SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL");
319  if (cursor == NULL) {
320  return TEST_ABORTED;
321  }
322 
323  /* Set the arrow cursor */
324  SDL_SetCursor(cursor);
325  SDLTest_AssertPass("Call to SDL_SetCursor(cursor)");
326 
327  /* Force redraw */
329  SDLTest_AssertPass("Call to SDL_SetCursor(NULL)");
330 
331  /* Free cursor again */
332  SDL_FreeCursor(cursor);
333  SDLTest_AssertPass("Call to SDL_FreeCursor()");
334 
335  return TEST_COMPLETED;
336 }
337 
338 /**
339  * @brief Check call to SDL_GetCursor
340  *
341  * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetCursor
342  */
343 int
344 mouse_getCursor(void *arg)
345 {
347 
348  /* Get current cursor */
349  cursor = SDL_GetCursor();
350  SDLTest_AssertPass("Call to SDL_GetCursor()");
351  SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL");
352 
353  return TEST_COMPLETED;
354 }
355 
356 /**
357  * @brief Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode
358  *
359  * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetRelativeMouseMode
360  * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetRelativeMouseMode
361  */
362 int
364 {
365  int result;
366  int i;
367  SDL_bool initialState;
368  SDL_bool currentState;
369 
370  /* Capture original state so we can revert back to it later */
371  initialState = SDL_GetRelativeMouseMode();
372  SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
373 
374  /* Repeat twice to check D->D transition */
375  for (i=0; i<2; i++) {
376  /* Disable - should always be supported */
378  SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)");
379  SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
380  currentState = SDL_GetRelativeMouseMode();
381  SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
382  SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState);
383  }
384 
385  /* Repeat twice to check D->E->E transition */
386  for (i=0; i<2; i++) {
387  /* Enable - may not be supported */
389  SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(TRUE)");
390  if (result != -1) {
391  SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
392  currentState = SDL_GetRelativeMouseMode();
393  SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
394  SDLTest_AssertCheck(currentState == SDL_TRUE, "Validate current state is TRUE, got: %i", currentState);
395  }
396  }
397 
398  /* Disable to check E->D transition */
400  SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)");
401  SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
402  currentState = SDL_GetRelativeMouseMode();
403  SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
404  SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState);
405 
406  /* Revert to original state - ignore result */
407  result = SDL_SetRelativeMouseMode(initialState);
408 
409  return TEST_COMPLETED;
410 }
411 
412 #define MOUSE_TESTWINDOW_WIDTH 320
413 #define MOUSE_TESTWINDOW_HEIGHT 200
414 
415 /**
416  * Creates a test window
417  */
419 {
420  int posX = 100, posY = 100, width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT;
422  window = SDL_CreateWindow("mouse_createMouseSuiteTestWindow", posX, posY, width, height, 0);
423  SDLTest_AssertPass("SDL_CreateWindow()");
424  SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
425  return window;
426 }
427 
428 /*
429  * Destroy test window
430  */
432 {
433  if (window != NULL) {
434  SDL_DestroyWindow(window);
435  window = NULL;
436  SDLTest_AssertPass("SDL_DestroyWindow()");
437  }
438 }
439 
440 /**
441  * @brief Check call to SDL_WarpMouseInWindow
442  *
443  * @sa http://wiki.libsdl.org/moin.cgi/SDL_WarpMouseInWindow
444  */
445 int
447 {
449  int numPositions = 6;
450  int xPositions[] = {-1, 0, 1, w-1, w, w+1 };
451  int yPositions[] = {-1, 0, 1, h-1, h, h+1 };
452  int x, y, i, j;
454 
455  /* Create test window */
456  window = _createMouseSuiteTestWindow();
457  if (window == NULL) return TEST_ABORTED;
458 
459  /* Mouse to random position inside window */
460  x = SDLTest_RandomIntegerInRange(1, w-1);
461  y = SDLTest_RandomIntegerInRange(1, h-1);
462  SDL_WarpMouseInWindow(window, x, y);
463  SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
464 
465  /* Same position again */
466  SDL_WarpMouseInWindow(window, x, y);
467  SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
468 
469  /* Mouse to various boundary positions */
470  for (i=0; i<numPositions; i++) {
471  for (j=0; j<numPositions; j++) {
472  x = xPositions[i];
473  y = yPositions[j];
474  SDL_WarpMouseInWindow(window, x, y);
475  SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
476 
477  /* TODO: add tracking of events and check that each call generates a mouse motion event */
478  SDL_PumpEvents();
479  SDLTest_AssertPass("SDL_PumpEvents()");
480  }
481  }
482 
483 
484  /* Clean up test window */
486 
487  return TEST_COMPLETED;
488 }
489 
490 /**
491  * @brief Check call to SDL_GetMouseFocus
492  *
493  * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetMouseFocus
494  */
495 int
497 {
499  int x, y;
501  SDL_Window *focusWindow;
502 
503  /* Get focus - focus non-deterministic */
504  focusWindow = SDL_GetMouseFocus();
505  SDLTest_AssertPass("SDL_GetMouseFocus()");
506 
507  /* Create test window */
508  window = _createMouseSuiteTestWindow();
509  if (window == NULL) return TEST_ABORTED;
510 
511  /* Mouse to random position inside window */
512  x = SDLTest_RandomIntegerInRange(1, w-1);
513  y = SDLTest_RandomIntegerInRange(1, h-1);
514  SDL_WarpMouseInWindow(window, x, y);
515  SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
516 
517  /* Pump events to update focus state */
518  SDL_PumpEvents();
519  SDLTest_AssertPass("SDL_PumpEvents()");
520 
521  /* Get focus with explicit window setup - focus deterministic */
522  focusWindow = SDL_GetMouseFocus();
523  SDLTest_AssertPass("SDL_GetMouseFocus()");
524  SDLTest_AssertCheck (focusWindow != NULL, "Check returned window value is not NULL");
525  SDLTest_AssertCheck (focusWindow == window, "Check returned window value is test window");
526 
527  /* Mouse to random position outside window */
528  x = SDLTest_RandomIntegerInRange(-9, -1);
529  y = SDLTest_RandomIntegerInRange(-9, -1);
530  SDL_WarpMouseInWindow(window, x, y);
531  SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y);
532 
533  /* Clean up test window */
535 
536  /* Pump events to update focus state */
537  SDL_PumpEvents();
538  SDLTest_AssertPass("SDL_PumpEvents()");
539 
540  /* Get focus for non-existing window */
541  focusWindow = SDL_GetMouseFocus();
542  SDLTest_AssertPass("SDL_GetMouseFocus()");
543  SDLTest_AssertCheck (focusWindow == NULL, "Check returned window value is NULL");
544 
545 
546  return TEST_COMPLETED;
547 }
548 
549 /* ================= Test References ================== */
550 
551 /* Mouse test cases */
553  { (SDLTest_TestCaseFp)mouse_getMouseState, "mouse_getMouseState", "Check call to SDL_GetMouseState", TEST_ENABLED };
554 
556  { (SDLTest_TestCaseFp)mouse_getRelativeMouseState, "mouse_getRelativeMouseState", "Check call to SDL_GetRelativeMouseState", TEST_ENABLED };
557 
559  { (SDLTest_TestCaseFp)mouse_createFreeCursor, "mouse_createFreeCursor", "Check call to SDL_CreateCursor and SDL_FreeCursor", TEST_ENABLED };
560 
562  { (SDLTest_TestCaseFp)mouse_showCursor, "mouse_showCursor", "Check call to SDL_ShowCursor", TEST_ENABLED };
563 
565  { (SDLTest_TestCaseFp)mouse_setCursor, "mouse_setCursor", "Check call to SDL_SetCursor", TEST_ENABLED };
566 
568  { (SDLTest_TestCaseFp)mouse_getCursor, "mouse_getCursor", "Check call to SDL_GetCursor", TEST_ENABLED };
569 
571  { (SDLTest_TestCaseFp)mouse_warpMouseInWindow, "mouse_warpMouseInWindow", "Check call to SDL_WarpMouseInWindow", TEST_ENABLED };
572 
574  { (SDLTest_TestCaseFp)mouse_getMouseFocus, "mouse_getMouseFocus", "Check call to SDL_getMouseFocus", TEST_ENABLED };
575 
577  { (SDLTest_TestCaseFp)mouse_createFreeColorCursor, "mouse_createFreeColorCursor", "Check call to SDL_CreateColorCursor and SDL_FreeCursor", TEST_ENABLED };
578 
580  { (SDLTest_TestCaseFp)mouse_getSetRelativeMouseMode, "mouse_getSetRelativeMouseMode", "Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode", TEST_ENABLED };
581 
582 /* Sequence of Mouse test cases */
586 };
587 
588 /* Mouse test suite (global) */
590  "Mouse",
591  NULL,
592  mouseTests,
593  NULL
594 };
static const SDLTest_TestCaseReference mouseTest8
#define TEST_ABORTED
GLuint64EXT * result
GLint GLint GLsizei width
Definition: SDL_opengl.h:1565
GLeglImageOES image
Definition: SDL_opengl.h:2141
int mouse_warpMouseInWindow(void *arg)
Check call to SDL_WarpMouseInWindow.
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1567
void _destroyMouseSuiteTestWindow(SDL_Window *window)
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.
SDL_Surface * SDLTest_ImageFace()
Returns the Face test image as SDL_Surface.
static SDL_Window * window
#define SDL_BUTTON_RIGHT
Definition: SDL_mouse.h:284
struct xkb_state * state
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1967
static SDL_Cursor * _initArrowCursor(const char *image[])
#define SDL_ENABLE
Definition: SDL_events.h:722
int mouse_getCursor(void *arg)
Check call to SDL_GetCursor.
SDLTest_TestSuiteReference mouseTestSuite
static const SDLTest_TestCaseReference mouseTest1
#define SDL_CreateWindow
int mouse_getMouseState(void *arg)
Check call to SDL_GetMouseState.
#define SDL_SetCursor
#define SDL_SetRelativeMouseMode
#define SDL_BUTTON_X1
Definition: SDL_mouse.h:285
static const SDLTest_TestCaseReference mouseTest6
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:159
int mouse_createFreeColorCursor(void *arg)
Check call to SDL_CreateColorCursor and SDL_FreeCursor.
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1565
SDL_Window * _createMouseSuiteTestWindow()
static const SDLTest_TestCaseReference mouseTest5
static const char * _mouseArrowData[]
#define MOUSE_TESTWINDOW_WIDTH
#define SDL_PumpEvents
static const SDLTest_TestCaseReference mouseTest7
int(* SDLTest_TestCaseFp)(void *arg)
static const SDLTest_TestCaseReference mouseTest3
#define SDL_GetRelativeMouseMode
GLenum GLuint GLint GLenum face
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1567
#define SDL_BUTTON_LEFT
Definition: SDL_mouse.h:282
int _mouseStateCheck(Uint32 state)
static const SDLTest_TestCaseReference mouseTest10
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 SDL_FreeSurface
int mouse_createFreeCursor(void *arg)
Check call to SDL_CreateCursor and SDL_FreeCursor.
#define SDL_GetRelativeMouseState
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:143
int mouse_getMouseFocus(void *arg)
Check call to SDL_GetMouseFocus.
int mouse_getRelativeMouseState(void *arg)
Check call to SDL_GetRelativeMouseState.
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
#define SDL_BUTTON_MIDDLE
Definition: SDL_mouse.h:283
#define SDL_CreateColorCursor
#define TEST_COMPLETED
static const SDLTest_TestCaseReference mouseTest4
GLenum GLint GLuint mask
SDL_Cursor * cursor
#define TEST_ENABLED
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
int mouse_setCursor(void *arg)
Check call to SDL_SetCursor.
#define SDL_DISABLE
Definition: SDL_events.h:721
#define NULL
Definition: begin_code.h:143
SDL_bool
Definition: SDL_stdinc.h:130
#define SDL_GetMouseFocus
#define SDL_CreateCursor
int mouse_showCursor(void *arg)
Check call to SDL_ShowCursor.
The type used to identify a window.
Definition: SDL_sysvideo.h:71
static const SDLTest_TestCaseReference mouseTest9
#define SDL_GetCursor
#define SDL_BUTTON(X)
Definition: SDL_mouse.h:281
GLubyte GLubyte GLubyte GLubyte w
#define SDL_WarpMouseInWindow
static const SDLTest_TestCaseReference mouseTest2
#define SDL_QUERY
Definition: SDL_events.h:719
#define SDL_FreeCursor
#define SDL_BUTTON_X2
Definition: SDL_mouse.h:286
void _changeCursorVisibility(int state)
#define SDL_ShowCursor
#define SDL_DestroyWindow
GLenum GLenum void * row
#define SDL_GetMouseState
GLfloat GLfloat GLfloat GLfloat h
int mouse_getSetRelativeMouseMode(void *arg)
Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode.
#define MOUSE_TESTWINDOW_HEIGHT
static const SDLTest_TestCaseReference * mouseTests[]