SDL
2.0
|
#include <stdio.h>
#include <limits.h>
#include "SDL_config.h"
#include "SDL.h"
#include "SDL_test.h"
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_TestCaseReference * | keyboardTests [] |
SDLTest_TestSuiteReference | keyboardTestSuite |
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().
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().
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().
int keyboard_getKeyboardFocus | ( | void * | arg | ) |
Check call to SDL_GetKeyboardFocus.
Definition at line 48 of file testautomation_keyboard.c.
References SDL_GetKeyboardFocus, SDLTest_AssertPass(), and TEST_COMPLETED.
int keyboard_getKeyboardState | ( | void * | arg | ) |
Check call to SDL_GetKeyboardState with and without numkeys reference.
Keyboard test suite
Definition at line 22 of file testautomation_keyboard.c.
References NULL, SDL_GetKeyboardState, SDLTest_AssertCheck(), SDLTest_AssertPass(), state, and TEST_COMPLETED.
int keyboard_getKeyFromName | ( | void * | arg | ) |
Check call to SDL_GetKeyFromName for known, unknown and invalid name.
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.
int keyboard_getKeyFromScancode | ( | void * | arg | ) |
Check call to 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.
int keyboard_getKeyName | ( | void * | arg | ) |
Check call to 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.
int keyboard_getKeyNameNegative | ( | void * | arg | ) |
SDL_GetKeyName negative cases.
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.
int keyboard_getScancodeFromKey | ( | void * | arg | ) |
Check call to SDL_GetScancodeFromKey.
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.
int keyboard_getScancodeFromName | ( | void * | arg | ) |
Check call to SDL_GetScancodeFromName.
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.
int keyboard_getScancodeFromNameNegative | ( | void * | arg | ) |
Check call to SDL_GetScancodeFromName with invalid data.
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.
int keyboard_getScancodeNameNegative | ( | void * | arg | ) |
SDL_GetScancodeName negative cases.
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.
int keyboard_getSetModState | ( | void * | arg | ) |
Check call to SDL_GetModState and 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.
int keyboard_setTextInputRect | ( | void * | arg | ) |
Check call to 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.
int keyboard_setTextInputRectNegative | ( | void * | arg | ) |
Check call to SDL_SetTextInputRect with invalid data.
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.
int keyboard_startStopTextInput | ( | void * | arg | ) |
Check call to SDL_StartTextInput and SDL_StopTextInput.
Definition at line 353 of file testautomation_keyboard.c.
References SDL_StartTextInput, SDL_StopTextInput, SDLTest_AssertPass(), and TEST_COMPLETED.
|
static |
Definition at line 658 of file testautomation_keyboard.c.
|
static |
Definition at line 685 of file testautomation_keyboard.c.
|
static |
Definition at line 688 of file testautomation_keyboard.c.
|
static |
Definition at line 691 of file testautomation_keyboard.c.
|
static |
Definition at line 694 of file testautomation_keyboard.c.
|
static |
Definition at line 697 of file testautomation_keyboard.c.
|
static |
Definition at line 661 of file testautomation_keyboard.c.
|
static |
Definition at line 664 of file testautomation_keyboard.c.
|
static |
Definition at line 667 of file testautomation_keyboard.c.
|
static |
Definition at line 670 of file testautomation_keyboard.c.
|
static |
Definition at line 673 of file testautomation_keyboard.c.
|
static |
Definition at line 676 of file testautomation_keyboard.c.
|
static |
Definition at line 679 of file testautomation_keyboard.c.
|
static |
Definition at line 682 of file testautomation_keyboard.c.
|
static |
Definition at line 701 of file testautomation_keyboard.c.
SDLTest_TestSuiteReference keyboardTestSuite |
Definition at line 708 of file testautomation_keyboard.c.