37 SDLTest_AssertCheck(numkeys >= 0,
"Validate that value of numkeys is >= 0, got: %i", numkeys);
113 const char *expectedError =
"Parameter 'scancode' is invalid";
120 "Validate error message, expected: '%s', got: '%s'", expectedError, error);
205 expected =
"BrightnessUp";
212 expected =
"Keypad MemStore";
315 SDLTest_AssertCheck( result <= allStates,
"Verify result from call is valid, expected: 0 <= result <= %i, got: %i", allStates, result);
324 SDLTest_AssertCheck(result == newState,
"Verify result from call is valid, expected: %i, got: %i", newState, result);
331 SDLTest_AssertCheck(result == 0,
"Verify result from call is valid, expected: 0, got: %i", result);
334 if (currentState != 0) {
339 SDLTest_AssertCheck(result == currentState,
"Verify result from call is valid, expected: %i, got: %i", currentState, result);
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);
482 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA 483 const char *expectedError =
"Parameter 'rect' is invalid";
495 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA 501 "Validate error message, expected: '%s', got: '%s'", expectedError, error);
530 SDLTest_AssertCheck(scancode == 0,
"Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %i", scancode);
595 const char *expectedError =
"Parameter 'name' is invalid";
602 "Validate error message, expected: '%s', got: '%s'", expectedError, error);
static const SDLTest_TestCaseReference keyboardTest1
static const SDLTest_TestCaseReference keyboardTest8
int keyboard_getScancodeFromNameNegative(void *arg)
Check call to SDL_GetScancodeFromName with invalid data.
int keyboard_setTextInputRect(void *arg)
Check call to SDL_SetTextInputRect.
static const SDLTest_TestCaseReference keyboardTest9
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
#define SDL_GetKeyFromScancode
int keyboard_setTextInputRectNegative(void *arg)
Check call to SDL_SetTextInputRect with invalid data.
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.
static const SDLTest_TestCaseReference keyboardTest14
#define SDL_GetKeyboardFocus
int keyboard_getSetModState(void *arg)
Check call to SDL_GetModState and SDL_SetModState.
Sint32 SDL_Keycode
The SDL virtual key representation.
int keyboard_getKeyNameNegative(void *arg)
SDL_GetKeyName negative cases.
GLuint const GLchar * name
SDLTest_TestSuiteReference keyboardTestSuite
#define SDL_GetScancodeFromName
void _checkInvalidNameError()
int(* SDLTest_TestCaseFp)(void *arg)
#define SDL_GetScancodeFromKey
char * SDLTest_RandomAsciiStringOfSize(int size)
#define SDL_StopTextInput
int keyboard_getScancodeNameNegative(void *arg)
SDL_GetScancodeName negative cases.
int keyboard_getScancodeFromKey(void *arg)
Check call to SDL_GetScancodeFromKey.
static const SDLTest_TestCaseReference keyboardTest7
#define SDL_GetKeyboardState
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...
int keyboard_getKeyboardState(void *arg)
Check call to SDL_GetKeyboardState with and without numkeys reference.
static const SDLTest_TestCaseReference keyboardTest4
static const SDLTest_TestCaseReference keyboardTest11
int keyboard_getKeyFromScancode(void *arg)
Check call to SDL_GetKeyFromScancode.
int keyboard_getScancodeFromName(void *arg)
Check call to SDL_GetScancodeFromName.
int keyboard_getKeyboardFocus(void *arg)
Check call to SDL_GetKeyboardFocus.
#define SDL_StartTextInput
SDL_Keymod
Enumeration of valid key mods (possibly OR'd together).
int keyboard_getKeyFromName(void *arg)
Check call to SDL_GetKeyFromName for known, unknown and invalid name.
static const SDLTest_TestCaseReference keyboardTest12
static const SDLTest_TestCaseReference keyboardTest13
void _testSetTextInputRect(SDL_Rect refRect)
#define SDL_GetScancodeName
#define SDL_SetTextInputRect
static const SDLTest_TestCaseReference * keyboardTests[]
EGLSurface EGLNativeWindowType * window
static const SDLTest_TestCaseReference keyboardTest3
int keyboard_startStopTextInput(void *arg)
Check call to SDL_StartTextInput and SDL_StopTextInput.
The type used to identify a window.
#define SDL_GetKeyFromName
static const SDLTest_TestCaseReference keyboardTest10
int keyboard_getKeyName(void *arg)
Check call to SDL_GetKeyName.
static const SDLTest_TestCaseReference keyboardTest2
SDL_Scancode
The SDL keyboard scancode representation.
A rectangle, with the origin at the upper left.
static const SDLTest_TestCaseReference keyboardTest6
static const SDLTest_TestCaseReference keyboardTest5