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

Go to the source code of this file.

Functions

int keyboard_getKeyboardState (void *arg)
 Check call to SDL_GetKeyboardState with and without numkeys reference. More...
 
int keyboard_getKeyboardFocus (void *arg)
 Check call to SDL_GetKeyboardFocus. More...
 
int keyboard_getKeyFromName (void *arg)
 Check call to SDL_GetKeyFromName for known, unknown and invalid name. More...
 
void _checkInvalidScancodeError ()
 
int keyboard_getKeyFromScancode (void *arg)
 Check call to SDL_GetKeyFromScancode. More...
 
int keyboard_getKeyName (void *arg)
 Check call to SDL_GetKeyName. More...
 
int keyboard_getScancodeNameNegative (void *arg)
 SDL_GetScancodeName negative cases. More...
 
int keyboard_getKeyNameNegative (void *arg)
 SDL_GetKeyName negative cases. More...
 
int keyboard_getSetModState (void *arg)
 Check call to SDL_GetModState and SDL_SetModState. More...
 
int keyboard_startStopTextInput (void *arg)
 Check call to SDL_StartTextInput and SDL_StopTextInput. More...
 
void _testSetTextInputRect (SDL_Rect refRect)
 
int keyboard_setTextInputRect (void *arg)
 Check call to SDL_SetTextInputRect. More...
 
int keyboard_setTextInputRectNegative (void *arg)
 Check call to SDL_SetTextInputRect with invalid data. More...
 
int keyboard_getScancodeFromKey (void *arg)
 Check call to SDL_GetScancodeFromKey. More...
 
int keyboard_getScancodeFromName (void *arg)
 Check call to SDL_GetScancodeFromName. More...
 
void _checkInvalidNameError ()
 
int keyboard_getScancodeFromNameNegative (void *arg)
 Check call to SDL_GetScancodeFromName with invalid data. More...
 

Variables

static const SDLTest_TestCaseReference keyboardTest1
 
static const SDLTest_TestCaseReference keyboardTest2
 
static const SDLTest_TestCaseReference keyboardTest3
 
static const SDLTest_TestCaseReference keyboardTest4
 
static const SDLTest_TestCaseReference keyboardTest5
 
static const SDLTest_TestCaseReference keyboardTest6
 
static const SDLTest_TestCaseReference keyboardTest7
 
static const SDLTest_TestCaseReference keyboardTest8
 
static const SDLTest_TestCaseReference keyboardTest9
 
static const SDLTest_TestCaseReference keyboardTest10
 
static const SDLTest_TestCaseReference keyboardTest11
 
static const SDLTest_TestCaseReference keyboardTest12
 
static const SDLTest_TestCaseReference keyboardTest13
 
static const SDLTest_TestCaseReference keyboardTest14
 
static const SDLTest_TestCaseReferencekeyboardTests []
 
SDLTest_TestSuiteReference keyboardTestSuite
 

Function Documentation

◆ _checkInvalidNameError()

void _checkInvalidNameError ( )

Definition at line 593 of file testautomation_keyboard.c.

References NULL, SDL_ClearError, SDL_GetError, SDL_strcmp, SDLTest_AssertCheck(), and SDLTest_AssertPass().

Referenced by keyboard_getScancodeFromNameNegative().

594 {
595  const char *expectedError = "Parameter 'name' is invalid";
596  const char *error;
597  error = SDL_GetError();
598  SDLTest_AssertPass("Call to SDL_GetError()");
599  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
600  if (error != NULL) {
601  SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
602  "Validate error message, expected: '%s', got: '%s'", expectedError, error);
603  SDL_ClearError();
604  SDLTest_AssertPass("Call to SDL_ClearError()");
605  }
606 }
#define SDL_ClearError
#define SDL_GetError
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 NULL
Definition: begin_code.h:164
#define SDL_strcmp

◆ _checkInvalidScancodeError()

void _checkInvalidScancodeError ( )

Definition at line 111 of file testautomation_keyboard.c.

References NULL, SDL_ClearError, SDL_GetError, SDL_strcmp, SDLTest_AssertCheck(), and SDLTest_AssertPass().

Referenced by keyboard_getKeyFromScancode(), keyboard_getKeyNameNegative(), and keyboard_getScancodeNameNegative().

112 {
113  const char *expectedError = "Parameter 'scancode' is invalid";
114  const char *error;
115  error = SDL_GetError();
116  SDLTest_AssertPass("Call to SDL_GetError()");
117  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
118  if (error != NULL) {
119  SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
120  "Validate error message, expected: '%s', got: '%s'", expectedError, error);
121  SDL_ClearError();
122  SDLTest_AssertPass("Call to SDL_ClearError()");
123  }
124 }
#define SDL_ClearError
#define SDL_GetError
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 NULL
Definition: begin_code.h:164
#define SDL_strcmp

◆ _testSetTextInputRect()

void _testSetTextInputRect ( SDL_Rect  refRect)

Definition at line 379 of file testautomation_keyboard.c.

References SDL_Rect::h, SDL_SetTextInputRect, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by keyboard_setTextInputRect().

380 {
381  SDL_Rect testRect;
382 
383  testRect = refRect;
384  SDL_SetTextInputRect(&testRect);
385  SDLTest_AssertPass("Call to SDL_SetTextInputRect with refRect(x:%i,y:%i,w:%i,h:%i)", refRect.x, refRect.y, refRect.w, refRect.h);
387  (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h),
388  "Check that input data was not modified, expected: x:%i,y:%i,w:%i,h:%i, got: x:%i,y:%i,w:%i,h:%i",
389  refRect.x, refRect.y, refRect.w, refRect.h,
390  testRect.x, testRect.y, testRect.w, testRect.h);
391 }
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...
int x
Definition: SDL_rect.h:66
int w
Definition: SDL_rect.h:67
#define SDL_SetTextInputRect
int h
Definition: SDL_rect.h:67
int y
Definition: SDL_rect.h:66
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

◆ keyboard_getKeyboardFocus()

int keyboard_getKeyboardFocus ( void arg)

Check call to SDL_GetKeyboardFocus.

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

Definition at line 48 of file testautomation_keyboard.c.

References SDL_GetKeyboardFocus, SDLTest_AssertPass(), and TEST_COMPLETED.

49 {
51 
52  /* Call, but ignore return value */
53  window = SDL_GetKeyboardFocus();
54  SDLTest_AssertPass("Call to SDL_GetKeyboardFocus()");
55 
56  return TEST_COMPLETED;
57 }
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.
#define SDL_GetKeyboardFocus
#define TEST_COMPLETED
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
The type used to identify a window.
Definition: SDL_sysvideo.h:73

◆ keyboard_getKeyboardState()

int keyboard_getKeyboardState ( void arg)

Check call to SDL_GetKeyboardState with and without numkeys reference.

Keyboard test suite

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

Definition at line 22 of file testautomation_keyboard.c.

References NULL, SDL_GetKeyboardState, SDLTest_AssertCheck(), SDLTest_AssertPass(), state, and TEST_COMPLETED.

23 {
24  int numkeys;
25  Uint8 *state;
26 
27  /* Case where numkeys pointer is NULL */
28  state = (Uint8 *)SDL_GetKeyboardState(NULL);
29  SDLTest_AssertPass("Call to SDL_GetKeyboardState(NULL)");
30  SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL");
31 
32  /* Case where numkeys pointer is not NULL */
33  numkeys = -1;
34  state = (Uint8 *)SDL_GetKeyboardState(&numkeys);
35  SDLTest_AssertPass("Call to SDL_GetKeyboardState(&numkeys)");
36  SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL");
37  SDLTest_AssertCheck(numkeys >= 0, "Validate that value of numkeys is >= 0, got: %i", numkeys);
38 
39  return TEST_COMPLETED;
40 }
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.
struct xkb_state * state
#define SDL_GetKeyboardState
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...
uint8_t Uint8
Definition: SDL_stdinc.h:157
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:164

◆ keyboard_getKeyFromName()

int keyboard_getKeyFromName ( void arg)

Check call to SDL_GetKeyFromName for known, unknown and invalid name.

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

Definition at line 65 of file testautomation_keyboard.c.

References NULL, SDL_GetKeyFromName, SDLK_a, SDLK_AUDIOSTOP, SDLK_END, SDLK_F1, SDLK_FIND, SDLK_UNKNOWN, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

66 {
68 
69  /* Case where Key is known, 1 character input */
70  result = SDL_GetKeyFromName("A");
71  SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)");
72  SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %i", SDLK_a, result);
73 
74  /* Case where Key is known, 2 character input */
75  result = SDL_GetKeyFromName("F1");
76  SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/double)");
77  SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %i", SDLK_F1, result);
78 
79  /* Case where Key is known, 3 character input */
80  result = SDL_GetKeyFromName("End");
81  SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/triple)");
82  SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %i", SDLK_END, result);
83 
84  /* Case where Key is known, 4 character input */
85  result = SDL_GetKeyFromName("Find");
86  SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/quad)");
87  SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %i", SDLK_FIND, result);
88 
89  /* Case where Key is known, multiple character input */
90  result = SDL_GetKeyFromName("AudioStop");
91  SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/multi)");
92  SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %i", SDLK_AUDIOSTOP, result);
93 
94  /* Case where Key is unknown */
95  result = SDL_GetKeyFromName("NotThere");
96  SDLTest_AssertPass("Call to SDL_GetKeyFromName(unknown)");
97  SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
98 
99  /* Case where input is NULL/invalid */
100  result = SDL_GetKeyFromName(NULL);
101  SDLTest_AssertPass("Call to SDL_GetKeyFromName(NULL)");
102  SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
103 
104  return TEST_COMPLETED;
105 }
GLuint64EXT * result
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.
Sint32 SDL_Keycode
The SDL virtual key representation.
Definition: SDL_keycode.h:45
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 NULL
Definition: begin_code.h:164
#define SDL_GetKeyFromName

◆ keyboard_getKeyFromScancode()

int keyboard_getKeyFromScancode ( void arg)

Check call to SDL_GetKeyFromScancode.

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

Definition at line 132 of file testautomation_keyboard.c.

References _checkInvalidScancodeError(), SDL_ClearError, SDL_GetKeyFromScancode, SDL_SCANCODE_A, SDLK_a, SDLK_UNKNOWN, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

133 {
135 
136  /* Case where input is valid */
138  SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)");
139  SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %i", SDLK_a, result);
140 
141  /* Case where input is zero */
142  result = SDL_GetKeyFromScancode(0);
143  SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)");
144  SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
145 
146  /* Clear error message */
147  SDL_ClearError();
148  SDLTest_AssertPass("Call to SDL_ClearError()");
149 
150  /* Case where input is invalid (too small) */
151  result = SDL_GetKeyFromScancode(-999);
152  SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)");
153  SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
155 
156  /* Case where input is invalid (too big) */
157  result = SDL_GetKeyFromScancode(999);
158  SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)");
159  SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
161 
162  return TEST_COMPLETED;
163 }
#define SDL_ClearError
GLuint64EXT * result
#define SDL_GetKeyFromScancode
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.
Sint32 SDL_Keycode
The SDL virtual key representation.
Definition: SDL_keycode.h:45
void _checkInvalidScancodeError()
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

◆ keyboard_getKeyName()

int keyboard_getKeyName ( void arg)

Check call to SDL_GetKeyName.

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

Definition at line 171 of file testautomation_keyboard.c.

References NULL, SDL_GetKeyName, SDL_strcmp, SDLK_3, SDLK_BRIGHTNESSUP, SDLK_CUT, SDLK_DOWN, SDLK_F1, SDLK_KP_MEMSTORE, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

172 {
173  char *result;
174  char *expected;
175 
176  /* Case where key has a 1 character name */
177  expected = "3";
178  result = (char *)SDL_GetKeyName(SDLK_3);
179  SDLTest_AssertPass("Call to SDL_GetKeyName()");
180  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
181  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result);
182 
183  /* Case where key has a 2 character name */
184  expected = "F1";
185  result = (char *)SDL_GetKeyName(SDLK_F1);
186  SDLTest_AssertPass("Call to SDL_GetKeyName()");
187  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
188  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result);
189 
190  /* Case where key has a 3 character name */
191  expected = "Cut";
192  result = (char *)SDL_GetKeyName(SDLK_CUT);
193  SDLTest_AssertPass("Call to SDL_GetKeyName()");
194  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
195  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result);
196 
197  /* Case where key has a 4 character name */
198  expected = "Down";
199  result = (char *)SDL_GetKeyName(SDLK_DOWN);
200  SDLTest_AssertPass("Call to SDL_GetKeyName()");
201  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
202  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result);
203 
204  /* Case where key has a N character name */
205  expected = "BrightnessUp";
206  result = (char *)SDL_GetKeyName(SDLK_BRIGHTNESSUP);
207  SDLTest_AssertPass("Call to SDL_GetKeyName()");
208  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
209  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result);
210 
211  /* Case where key has a N character name with space */
212  expected = "Keypad MemStore";
213  result = (char *)SDL_GetKeyName(SDLK_KP_MEMSTORE);
214  SDLTest_AssertPass("Call to SDL_GetKeyName()");
215  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
216  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result);
217 
218  return TEST_COMPLETED;
219 }
GLuint64EXT * result
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 NULL
Definition: begin_code.h:164
#define SDL_GetKeyName
#define SDL_strcmp

◆ keyboard_getKeyNameNegative()

int keyboard_getKeyNameNegative ( void arg)

SDL_GetKeyName negative cases.

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

Definition at line 254 of file testautomation_keyboard.c.

References _checkInvalidScancodeError(), NULL, SDL_ClearError, SDL_GetKeyName, SDL_strcmp, SDLK_UNKNOWN, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), and TEST_COMPLETED.

255 {
256  SDL_Keycode keycode;
257  char *result;
258  char *expected = "";
259 
260  /* Unknown keycode */
261  keycode = SDLK_UNKNOWN;
262  result = (char *)SDL_GetKeyName(keycode);
263  SDLTest_AssertPass("Call to SDL_GetKeyName(%d/unknown)", keycode);
264  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
265  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
266 
267  /* Clear error message */
268  SDL_ClearError();
269  SDLTest_AssertPass("Call to SDL_ClearError()");
270 
271  /* Negative keycode */
272  keycode = (SDL_Keycode)SDLTest_RandomIntegerInRange(-255, -1);
273  result = (char *)SDL_GetKeyName(keycode);
274  SDLTest_AssertPass("Call to SDL_GetKeyName(%d/negative)", keycode);
275  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
276  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
278 
279  SDL_ClearError();
280  SDLTest_AssertPass("Call to SDL_ClearError()");
281 
282  return TEST_COMPLETED;
283 }
#define SDL_ClearError
GLuint64EXT * result
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
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.
Sint32 SDL_Keycode
The SDL virtual key representation.
Definition: SDL_keycode.h:45
void _checkInvalidScancodeError()
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 NULL
Definition: begin_code.h:164
#define SDL_GetKeyName
#define SDL_strcmp

◆ keyboard_getScancodeFromKey()

int keyboard_getScancodeFromKey ( void arg)

Check call to SDL_GetScancodeFromKey.

See also
http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromKey
http://wiki.libsdl.org/moin.cgi/SDL_Keycode

Definition at line 518 of file testautomation_keyboard.c.

References SDL_GetScancodeFromKey, SDL_SCANCODE_4, SDLK_4, SDLK_PLUS, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

519 {
520  SDL_Scancode scancode;
521 
522  /* Regular key */
523  scancode = SDL_GetScancodeFromKey(SDLK_4);
524  SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_4)");
525  SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromKey, expected: %i, got: %i", SDL_SCANCODE_4, scancode);
526 
527  /* Virtual key */
528  scancode = SDL_GetScancodeFromKey(SDLK_PLUS);
529  SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_PLUS)");
530  SDLTest_AssertCheck(scancode == 0, "Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %i", scancode);
531 
532  return TEST_COMPLETED;
533 }
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.
#define SDL_GetScancodeFromKey
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
SDL_Scancode
The SDL keyboard scancode representation.
Definition: SDL_scancode.h:43

◆ keyboard_getScancodeFromName()

int keyboard_getScancodeFromName ( void arg)

Check call to SDL_GetScancodeFromName.

See also
http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromName
http://wiki.libsdl.org/moin.cgi/SDL_Keycode

Definition at line 542 of file testautomation_keyboard.c.

References SDL_GetScancodeFromName, SDL_SCANCODE_4, SDL_SCANCODE_A, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_END, SDL_SCANCODE_F1, SDL_SCANCODE_FIND, SDL_SCANCODE_KP_ENTER, SDL_SCANCODE_SLEEP, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

543 {
544  SDL_Scancode scancode;
545 
546  /* Regular key, 1 character, first name in list */
547  scancode = SDL_GetScancodeFromName("A");
548  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('A')");
549  SDLTest_AssertCheck(scancode == SDL_SCANCODE_A, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_A, scancode);
550 
551  /* Regular key, 1 character */
552  scancode = SDL_GetScancodeFromName("4");
553  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('4')");
554  SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_4, scancode);
555 
556  /* Regular key, 2 characters */
557  scancode = SDL_GetScancodeFromName("F1");
558  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('F1')");
559  SDLTest_AssertCheck(scancode == SDL_SCANCODE_F1, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_F1, scancode);
560 
561  /* Regular key, 3 characters */
562  scancode = SDL_GetScancodeFromName("End");
563  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('End')");
564  SDLTest_AssertCheck(scancode == SDL_SCANCODE_END, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_END, scancode);
565 
566  /* Regular key, 4 characters */
567  scancode = SDL_GetScancodeFromName("Find");
568  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Find')");
569  SDLTest_AssertCheck(scancode == SDL_SCANCODE_FIND, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_FIND, scancode);
570 
571  /* Regular key, several characters */
572  scancode = SDL_GetScancodeFromName("Backspace");
573  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Backspace')");
574  SDLTest_AssertCheck(scancode == SDL_SCANCODE_BACKSPACE, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_BACKSPACE, scancode);
575 
576  /* Regular key, several characters with space */
577  scancode = SDL_GetScancodeFromName("Keypad Enter");
578  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Keypad Enter')");
579  SDLTest_AssertCheck(scancode == SDL_SCANCODE_KP_ENTER, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_KP_ENTER, scancode);
580 
581  /* Regular key, last name in list */
582  scancode = SDL_GetScancodeFromName("Sleep");
583  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Sleep')");
584  SDLTest_AssertCheck(scancode == SDL_SCANCODE_SLEEP, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_SLEEP, scancode);
585 
586  return TEST_COMPLETED;
587 }
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.
#define SDL_GetScancodeFromName
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
SDL_Scancode
The SDL keyboard scancode representation.
Definition: SDL_scancode.h:43

◆ keyboard_getScancodeFromNameNegative()

int keyboard_getScancodeFromNameNegative ( void arg)

Check call to SDL_GetScancodeFromName with invalid data.

See also
http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromName
http://wiki.libsdl.org/moin.cgi/SDL_Keycode

Definition at line 615 of file testautomation_keyboard.c.

References _checkInvalidNameError(), NULL, SDL_ClearError, SDL_free, SDL_GetScancodeFromName, SDL_SCANCODE_UNKNOWN, SDLTest_Assert(), SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomAsciiStringOfSize(), TEST_ABORTED, and TEST_COMPLETED.

616 {
617  char *name;
618  SDL_Scancode scancode;
619 
620  /* Clear error message */
621  SDL_ClearError();
622  SDLTest_AssertPass("Call to SDL_ClearError()");
623 
624  /* Random string input */
626  SDLTest_Assert(name != NULL, "Check that random name is not NULL");
627  if (name == NULL) {
628  return TEST_ABORTED;
629  }
630  scancode = SDL_GetScancodeFromName((const char *)name);
631  SDLTest_AssertPass("Call to SDL_GetScancodeFromName('%s')", name);
632  SDL_free(name);
633  SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode);
635 
636  /* Zero length string input */
637  name = "";
638  scancode = SDL_GetScancodeFromName((const char *)name);
639  SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)");
640  SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode);
642 
643  /* NULL input */
644  name = NULL;
645  scancode = SDL_GetScancodeFromName((const char *)name);
646  SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)");
647  SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode);
649 
650  return TEST_COMPLETED;
651 }
#define SDL_ClearError
#define TEST_ABORTED
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.
void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert that logs and break execution flow on failures.
GLuint const GLchar * name
#define SDL_GetScancodeFromName
void _checkInvalidNameError()
char * SDLTest_RandomAsciiStringOfSize(int size)
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_free
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:164
SDL_Scancode
The SDL keyboard scancode representation.
Definition: SDL_scancode.h:43

◆ keyboard_getScancodeNameNegative()

int keyboard_getScancodeNameNegative ( void arg)

SDL_GetScancodeName negative cases.

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

Definition at line 227 of file testautomation_keyboard.c.

References _checkInvalidScancodeError(), NULL, SDL_ClearError, SDL_GetScancodeName, SDL_NUM_SCANCODES, SDL_strcmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

228 {
229  SDL_Scancode scancode;
230  char *result;
231  char *expected = "";
232 
233  /* Clear error message */
234  SDL_ClearError();
235  SDLTest_AssertPass("Call to SDL_ClearError()");
236 
237  /* Out-of-bounds scancode */
238  scancode = (SDL_Scancode)SDL_NUM_SCANCODES;
239  result = (char *)SDL_GetScancodeName(scancode);
240  SDLTest_AssertPass("Call to SDL_GetScancodeName(%d/large)", scancode);
241  SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
242  SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
244 
245  return TEST_COMPLETED;
246 }
#define SDL_ClearError
GLuint64EXT * result
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.
void _checkInvalidScancodeError()
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 NULL
Definition: begin_code.h:164
#define SDL_GetScancodeName
#define SDL_strcmp
SDL_Scancode
The SDL keyboard scancode representation.
Definition: SDL_scancode.h:43

◆ keyboard_getSetModState()

int keyboard_getSetModState ( void arg)

Check call to SDL_GetModState and SDL_SetModState.

See also
http://wiki.libsdl.org/moin.cgi/SDL_GetModState
http://wiki.libsdl.org/moin.cgi/SDL_SetModState

Definition at line 292 of file testautomation_keyboard.c.

References KMOD_CAPS, KMOD_LALT, KMOD_LCTRL, KMOD_LGUI, KMOD_LSHIFT, KMOD_MODE, KMOD_NONE, KMOD_NUM, KMOD_RALT, KMOD_RCTRL, KMOD_RESERVED, KMOD_RGUI, KMOD_RSHIFT, SDL_GetModState, SDL_SetModState, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), and TEST_COMPLETED.

293 {
295  SDL_Keymod currentState;
296  SDL_Keymod newState;
297  SDL_Keymod allStates =
298  KMOD_NONE |
299  KMOD_LSHIFT |
300  KMOD_RSHIFT |
301  KMOD_LCTRL |
302  KMOD_RCTRL |
303  KMOD_LALT |
304  KMOD_RALT |
305  KMOD_LGUI |
306  KMOD_RGUI |
307  KMOD_NUM |
308  KMOD_CAPS |
309  KMOD_MODE |
311 
312  /* Get state, cache for later reset */
313  result = SDL_GetModState();
314  SDLTest_AssertPass("Call to SDL_GetModState()");
315  SDLTest_AssertCheck(/*result >= 0 &&*/ result <= allStates, "Verify result from call is valid, expected: 0 <= result <= %i, got: %i", allStates, result);
316  currentState = result;
317 
318  /* Set random state */
319  newState = SDLTest_RandomIntegerInRange(0, allStates);
320  SDL_SetModState(newState);
321  SDLTest_AssertPass("Call to SDL_SetModState(%i)", newState);
322  result = SDL_GetModState();
323  SDLTest_AssertPass("Call to SDL_GetModState()");
324  SDLTest_AssertCheck(result == newState, "Verify result from call is valid, expected: %i, got: %i", newState, result);
325 
326  /* Set zero state */
327  SDL_SetModState(0);
328  SDLTest_AssertPass("Call to SDL_SetModState(0)");
329  result = SDL_GetModState();
330  SDLTest_AssertPass("Call to SDL_GetModState()");
331  SDLTest_AssertCheck(result == 0, "Verify result from call is valid, expected: 0, got: %i", result);
332 
333  /* Revert back to cached current state if needed */
334  if (currentState != 0) {
335  SDL_SetModState(currentState);
336  SDLTest_AssertPass("Call to SDL_SetModState(%i)", currentState);
337  result = SDL_GetModState();
338  SDLTest_AssertPass("Call to SDL_GetModState()");
339  SDLTest_AssertCheck(result == currentState, "Verify result from call is valid, expected: %i, got: %i", currentState, result);
340  }
341 
342  return TEST_COMPLETED;
343 }
GLuint64EXT * result
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
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.
#define SDL_SetModState
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
SDL_Keymod
Enumeration of valid key mods (possibly OR&#39;d together).
Definition: SDL_keycode.h:325
#define SDL_GetModState

◆ keyboard_setTextInputRect()

int keyboard_setTextInputRect ( void arg)

Check call to SDL_SetTextInputRect.

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

Definition at line 399 of file testautomation_keyboard.c.

References _testSetTextInputRect(), SDL_Rect::h, NULL, SDL_SetTextInputRect, SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

400 {
401  SDL_Rect refRect;
402 
403  /* Normal visible refRect, origin inside */
404  refRect.x = SDLTest_RandomIntegerInRange(1, 50);
405  refRect.y = SDLTest_RandomIntegerInRange(1, 50);
406  refRect.w = SDLTest_RandomIntegerInRange(10, 50);
407  refRect.h = SDLTest_RandomIntegerInRange(10, 50);
408  _testSetTextInputRect(refRect);
409 
410  /* Normal visible refRect, origin 0,0 */
411  refRect.x = 0;
412  refRect.y = 0;
413  refRect.w = SDLTest_RandomIntegerInRange(10, 50);
414  refRect.h = SDLTest_RandomIntegerInRange(10, 50);
415  _testSetTextInputRect(refRect);
416 
417  /* 1Pixel refRect */
418  refRect.x = SDLTest_RandomIntegerInRange(10, 50);
419  refRect.y = SDLTest_RandomIntegerInRange(10, 50);
420  refRect.w = 1;
421  refRect.h = 1;
422  _testSetTextInputRect(refRect);
423 
424  /* 0pixel refRect */
425  refRect.x = 1;
426  refRect.y = 1;
427  refRect.w = 1;
428  refRect.h = 0;
429  _testSetTextInputRect(refRect);
430 
431  /* 0pixel refRect */
432  refRect.x = 1;
433  refRect.y = 1;
434  refRect.w = 0;
435  refRect.h = 1;
436  _testSetTextInputRect(refRect);
437 
438  /* 0pixel refRect */
439  refRect.x = 1;
440  refRect.y = 1;
441  refRect.w = 0;
442  refRect.h = 0;
443  _testSetTextInputRect(refRect);
444 
445  /* 0pixel refRect */
446  refRect.x = 0;
447  refRect.y = 0;
448  refRect.w = 0;
449  refRect.h = 0;
450  _testSetTextInputRect(refRect);
451 
452  /* negative refRect */
453  refRect.x = SDLTest_RandomIntegerInRange(-200, -100);
454  refRect.y = SDLTest_RandomIntegerInRange(-200, -100);
455  refRect.w = 50;
456  refRect.h = 50;
457  _testSetTextInputRect(refRect);
458 
459  /* oversized refRect */
460  refRect.x = SDLTest_RandomIntegerInRange(1, 50);
461  refRect.y = SDLTest_RandomIntegerInRange(1, 50);
462  refRect.w = 5000;
463  refRect.h = 5000;
464  _testSetTextInputRect(refRect);
465 
466  /* NULL refRect */
468  SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)");
469 
470  return TEST_COMPLETED;
471 }
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
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 x
Definition: SDL_rect.h:66
#define TEST_COMPLETED
int w
Definition: SDL_rect.h:67
void _testSetTextInputRect(SDL_Rect refRect)
#define NULL
Definition: begin_code.h:164
#define SDL_SetTextInputRect
int h
Definition: SDL_rect.h:67
int y
Definition: SDL_rect.h:66
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

◆ keyboard_setTextInputRectNegative()

int keyboard_setTextInputRectNegative ( void arg)

Check call to SDL_SetTextInputRect with invalid data.

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

Definition at line 479 of file testautomation_keyboard.c.

References NULL, SDL_ClearError, SDL_GetError, SDL_SetTextInputRect, SDL_strcmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.

480 {
481  /* Some platforms set also an error message; prepare for checking it */
482 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
483  const char *expectedError = "Parameter 'rect' is invalid";
484  const char *error;
485 
486  SDL_ClearError();
487  SDLTest_AssertPass("Call to SDL_ClearError()");
488 #endif
489 
490  /* NULL refRect */
492  SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)");
493 
494  /* Some platforms set also an error message; so check it */
495 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
496  error = SDL_GetError();
497  SDLTest_AssertPass("Call to SDL_GetError()");
498  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
499  if (error != NULL) {
500  SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
501  "Validate error message, expected: '%s', got: '%s'", expectedError, error);
502  }
503 
504  SDL_ClearError();
505  SDLTest_AssertPass("Call to SDL_ClearError()");
506 #endif
507 
508  return TEST_COMPLETED;
509 }
#define SDL_ClearError
#define SDL_GetError
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 NULL
Definition: begin_code.h:164
#define SDL_SetTextInputRect
#define SDL_strcmp

◆ keyboard_startStopTextInput()

int keyboard_startStopTextInput ( void arg)

Check call to SDL_StartTextInput and SDL_StopTextInput.

See also
http://wiki.libsdl.org/moin.cgi/SDL_StartTextInput
http://wiki.libsdl.org/moin.cgi/SDL_StopTextInput

Definition at line 353 of file testautomation_keyboard.c.

References SDL_StartTextInput, SDL_StopTextInput, SDLTest_AssertPass(), and TEST_COMPLETED.

354 {
355  /* Start-Stop */
357  SDLTest_AssertPass("Call to SDL_StartTextInput()");
359  SDLTest_AssertPass("Call to SDL_StopTextInput()");
360 
361  /* Stop-Start */
363  SDLTest_AssertPass("Call to SDL_StartTextInput()");
364 
365  /* Start-Start */
367  SDLTest_AssertPass("Call to SDL_StartTextInput()");
368 
369  /* Stop-Stop */
371  SDLTest_AssertPass("Call to SDL_StopTextInput()");
373  SDLTest_AssertPass("Call to SDL_StopTextInput()");
374 
375  return TEST_COMPLETED;
376 }
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.
#define SDL_StopTextInput
#define TEST_COMPLETED
#define SDL_StartTextInput

Variable Documentation

◆ keyboardTest1

const SDLTest_TestCaseReference keyboardTest1
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getKeyboardState, "keyboard_getKeyboardState", "Check call to SDL_GetKeyboardState with and without numkeys reference", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
int keyboard_getKeyboardState(void *arg)
Check call to SDL_GetKeyboardState with and without numkeys reference.
#define TEST_ENABLED

Definition at line 658 of file testautomation_keyboard.c.

◆ keyboardTest10

const SDLTest_TestCaseReference keyboardTest10
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getScancodeFromKey, "keyboard_getScancodeFromKey", "Check call to SDL_GetScancodeFromKey", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
int keyboard_getScancodeFromKey(void *arg)
Check call to SDL_GetScancodeFromKey.
#define TEST_ENABLED

Definition at line 685 of file testautomation_keyboard.c.

◆ keyboardTest11

const SDLTest_TestCaseReference keyboardTest11
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getScancodeFromName, "keyboard_getScancodeFromName", "Check call to SDL_GetScancodeFromName", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
int keyboard_getScancodeFromName(void *arg)
Check call to SDL_GetScancodeFromName.
#define TEST_ENABLED

Definition at line 688 of file testautomation_keyboard.c.

◆ keyboardTest12

const SDLTest_TestCaseReference keyboardTest12
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getScancodeFromNameNegative, "keyboard_getScancodeFromNameNegative", "Check call to SDL_GetScancodeFromName with invalid data", TEST_ENABLED }
int keyboard_getScancodeFromNameNegative(void *arg)
Check call to SDL_GetScancodeFromName with invalid data.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 691 of file testautomation_keyboard.c.

◆ keyboardTest13

const SDLTest_TestCaseReference keyboardTest13
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getKeyNameNegative, "keyboard_getKeyNameNegative", "Check call to SDL_GetKeyName with invalid data", TEST_ENABLED }
int keyboard_getKeyNameNegative(void *arg)
SDL_GetKeyName negative cases.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 694 of file testautomation_keyboard.c.

◆ keyboardTest14

const SDLTest_TestCaseReference keyboardTest14
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getScancodeNameNegative, "keyboard_getScancodeNameNegative", "Check call to SDL_GetScancodeName with invalid data", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
int keyboard_getScancodeNameNegative(void *arg)
SDL_GetScancodeName negative cases.
#define TEST_ENABLED

Definition at line 697 of file testautomation_keyboard.c.

◆ keyboardTest2

const SDLTest_TestCaseReference keyboardTest2
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getKeyboardFocus, "keyboard_getKeyboardFocus", "Check call to SDL_GetKeyboardFocus", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
int keyboard_getKeyboardFocus(void *arg)
Check call to SDL_GetKeyboardFocus.
#define TEST_ENABLED

Definition at line 661 of file testautomation_keyboard.c.

◆ keyboardTest3

const SDLTest_TestCaseReference keyboardTest3
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getKeyFromName, "keyboard_getKeyFromName", "Check call to SDL_GetKeyFromName for known, unknown and invalid name", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int keyboard_getKeyFromName(void *arg)
Check call to SDL_GetKeyFromName for known, unknown and invalid name.

Definition at line 664 of file testautomation_keyboard.c.

◆ keyboardTest4

const SDLTest_TestCaseReference keyboardTest4
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getKeyFromScancode, "keyboard_getKeyFromScancode", "Check call to SDL_GetKeyFromScancode", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
int keyboard_getKeyFromScancode(void *arg)
Check call to SDL_GetKeyFromScancode.
#define TEST_ENABLED

Definition at line 667 of file testautomation_keyboard.c.

◆ keyboardTest5

const SDLTest_TestCaseReference keyboardTest5
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getKeyName, "keyboard_getKeyName", "Check call to SDL_GetKeyName", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int keyboard_getKeyName(void *arg)
Check call to SDL_GetKeyName.

Definition at line 670 of file testautomation_keyboard.c.

◆ keyboardTest6

const SDLTest_TestCaseReference keyboardTest6
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_getSetModState, "keyboard_getSetModState", "Check call to SDL_GetModState and SDL_SetModState", TEST_ENABLED }
int keyboard_getSetModState(void *arg)
Check call to SDL_GetModState and SDL_SetModState.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 673 of file testautomation_keyboard.c.

◆ keyboardTest7

const SDLTest_TestCaseReference keyboardTest7
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_startStopTextInput, "keyboard_startStopTextInput", "Check call to SDL_StartTextInput and SDL_StopTextInput", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int keyboard_startStopTextInput(void *arg)
Check call to SDL_StartTextInput and SDL_StopTextInput.

Definition at line 676 of file testautomation_keyboard.c.

◆ keyboardTest8

const SDLTest_TestCaseReference keyboardTest8
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_setTextInputRect, "keyboard_setTextInputRect", "Check call to SDL_SetTextInputRect", TEST_ENABLED }
int keyboard_setTextInputRect(void *arg)
Check call to SDL_SetTextInputRect.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 679 of file testautomation_keyboard.c.

◆ keyboardTest9

const SDLTest_TestCaseReference keyboardTest9
static
Initial value:
=
{ (SDLTest_TestCaseFp)keyboard_setTextInputRectNegative, "keyboard_setTextInputRectNegative", "Check call to SDL_SetTextInputRect with invalid data", TEST_ENABLED }
int keyboard_setTextInputRectNegative(void *arg)
Check call to SDL_SetTextInputRect with invalid data.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 682 of file testautomation_keyboard.c.

◆ keyboardTests

const SDLTest_TestCaseReference* keyboardTests[]
static
Initial value:
= {
}
static const SDLTest_TestCaseReference keyboardTest1
static const SDLTest_TestCaseReference keyboardTest8
static const SDLTest_TestCaseReference keyboardTest9
static const SDLTest_TestCaseReference keyboardTest14
static const SDLTest_TestCaseReference keyboardTest7
static const SDLTest_TestCaseReference keyboardTest4
static const SDLTest_TestCaseReference keyboardTest11
static const SDLTest_TestCaseReference keyboardTest12
static const SDLTest_TestCaseReference keyboardTest13
#define NULL
Definition: begin_code.h:164
static const SDLTest_TestCaseReference keyboardTest3
static const SDLTest_TestCaseReference keyboardTest10
static const SDLTest_TestCaseReference keyboardTest2
static const SDLTest_TestCaseReference keyboardTest6
static const SDLTest_TestCaseReference keyboardTest5

Definition at line 701 of file testautomation_keyboard.c.

◆ keyboardTestSuite

SDLTest_TestSuiteReference keyboardTestSuite
Initial value:
= {
"Keyboard",
}
#define NULL
Definition: begin_code.h:164
static const SDLTest_TestCaseReference * keyboardTests[]

Definition at line 708 of file testautomation_keyboard.c.