mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 20:20:11 +02:00
Update SDL to 2.0.18
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
/**
|
||||
* @brief Check call to SDL_GetKeyboardState with and without numkeys reference.
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyboardState
|
||||
* @sa http://wiki.libsdl.org/SDL_GetKeyboardState
|
||||
*/
|
||||
int
|
||||
keyboard_getKeyboardState(void *arg)
|
||||
@@ -42,15 +42,13 @@ keyboard_getKeyboardState(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_GetKeyboardFocus
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyboardFocus
|
||||
* @sa http://wiki.libsdl.org/SDL_GetKeyboardFocus
|
||||
*/
|
||||
int
|
||||
keyboard_getKeyboardFocus(void *arg)
|
||||
{
|
||||
SDL_Window* window;
|
||||
|
||||
/* Call, but ignore return value */
|
||||
window = SDL_GetKeyboardFocus();
|
||||
SDL_GetKeyboardFocus();
|
||||
SDLTest_AssertPass("Call to SDL_GetKeyboardFocus()");
|
||||
|
||||
return TEST_COMPLETED;
|
||||
@@ -59,7 +57,7 @@ keyboard_getKeyboardFocus(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_GetKeyFromName for known, unknown and invalid name.
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyFromName
|
||||
* @sa http://wiki.libsdl.org/SDL_GetKeyFromName
|
||||
*/
|
||||
int
|
||||
keyboard_getKeyFromName(void *arg)
|
||||
@@ -126,7 +124,7 @@ _checkInvalidScancodeError()
|
||||
/**
|
||||
* @brief Check call to SDL_GetKeyFromScancode
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyFromScancode
|
||||
* @sa http://wiki.libsdl.org/SDL_GetKeyFromScancode
|
||||
*/
|
||||
int
|
||||
keyboard_getKeyFromScancode(void *arg)
|
||||
@@ -165,13 +163,13 @@ keyboard_getKeyFromScancode(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_GetKeyName
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyName
|
||||
* @sa http://wiki.libsdl.org/SDL_GetKeyName
|
||||
*/
|
||||
int
|
||||
keyboard_getKeyName(void *arg)
|
||||
{
|
||||
char *result;
|
||||
char *expected;
|
||||
const char *result;
|
||||
const char *expected;
|
||||
|
||||
/* Case where key has a 1 character name */
|
||||
expected = "3";
|
||||
@@ -221,14 +219,14 @@ keyboard_getKeyName(void *arg)
|
||||
/**
|
||||
* @brief SDL_GetScancodeName negative cases
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeName
|
||||
* @sa http://wiki.libsdl.org/SDL_GetScancodeName
|
||||
*/
|
||||
int
|
||||
keyboard_getScancodeNameNegative(void *arg)
|
||||
{
|
||||
SDL_Scancode scancode;
|
||||
char *result;
|
||||
char *expected = "";
|
||||
const char *result;
|
||||
const char *expected = "";
|
||||
|
||||
/* Clear error message */
|
||||
SDL_ClearError();
|
||||
@@ -248,14 +246,14 @@ keyboard_getScancodeNameNegative(void *arg)
|
||||
/**
|
||||
* @brief SDL_GetKeyName negative cases
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyName
|
||||
* @sa http://wiki.libsdl.org/SDL_GetKeyName
|
||||
*/
|
||||
int
|
||||
keyboard_getKeyNameNegative(void *arg)
|
||||
{
|
||||
SDL_Keycode keycode;
|
||||
char *result;
|
||||
char *expected = "";
|
||||
const char *result;
|
||||
const char *expected = "";
|
||||
|
||||
/* Unknown keycode */
|
||||
keycode = SDLK_UNKNOWN;
|
||||
@@ -285,8 +283,8 @@ keyboard_getKeyNameNegative(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_GetModState and SDL_SetModState
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetModState
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_SetModState
|
||||
* @sa http://wiki.libsdl.org/SDL_GetModState
|
||||
* @sa http://wiki.libsdl.org/SDL_SetModState
|
||||
*/
|
||||
int
|
||||
keyboard_getSetModState(void *arg)
|
||||
@@ -307,7 +305,7 @@ keyboard_getSetModState(void *arg)
|
||||
KMOD_NUM |
|
||||
KMOD_CAPS |
|
||||
KMOD_MODE |
|
||||
KMOD_RESERVED;
|
||||
KMOD_SCROLL;
|
||||
|
||||
/* Get state, cache for later reset */
|
||||
result = SDL_GetModState();
|
||||
@@ -346,8 +344,8 @@ keyboard_getSetModState(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_StartTextInput and SDL_StopTextInput
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_StartTextInput
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_StopTextInput
|
||||
* @sa http://wiki.libsdl.org/SDL_StartTextInput
|
||||
* @sa http://wiki.libsdl.org/SDL_StopTextInput
|
||||
*/
|
||||
int
|
||||
keyboard_startStopTextInput(void *arg)
|
||||
@@ -393,7 +391,7 @@ void _testSetTextInputRect(SDL_Rect refRect)
|
||||
/**
|
||||
* @brief Check call to SDL_SetTextInputRect
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_SetTextInputRect
|
||||
* @sa http://wiki.libsdl.org/SDL_SetTextInputRect
|
||||
*/
|
||||
int
|
||||
keyboard_setTextInputRect(void *arg)
|
||||
@@ -473,7 +471,7 @@ keyboard_setTextInputRect(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_SetTextInputRect with invalid data
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_SetTextInputRect
|
||||
* @sa http://wiki.libsdl.org/SDL_SetTextInputRect
|
||||
*/
|
||||
int
|
||||
keyboard_setTextInputRectNegative(void *arg)
|
||||
@@ -511,8 +509,8 @@ keyboard_setTextInputRectNegative(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_GetScancodeFromKey
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromKey
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_Keycode
|
||||
* @sa http://wiki.libsdl.org/SDL_GetScancodeFromKey
|
||||
* @sa http://wiki.libsdl.org/SDL_Keycode
|
||||
*/
|
||||
int
|
||||
keyboard_getScancodeFromKey(void *arg)
|
||||
@@ -535,8 +533,8 @@ keyboard_getScancodeFromKey(void *arg)
|
||||
/**
|
||||
* @brief Check call to SDL_GetScancodeFromName
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromName
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_Keycode
|
||||
* @sa http://wiki.libsdl.org/SDL_GetScancodeFromName
|
||||
* @sa http://wiki.libsdl.org/SDL_Keycode
|
||||
*/
|
||||
int
|
||||
keyboard_getScancodeFromName(void *arg)
|
||||
@@ -608,13 +606,13 @@ _checkInvalidNameError()
|
||||
/**
|
||||
* @brief Check call to SDL_GetScancodeFromName with invalid data
|
||||
*
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromName
|
||||
* @sa http://wiki.libsdl.org/moin.cgi/SDL_Keycode
|
||||
* @sa http://wiki.libsdl.org/SDL_GetScancodeFromName
|
||||
* @sa http://wiki.libsdl.org/SDL_Keycode
|
||||
*/
|
||||
int
|
||||
keyboard_getScancodeFromNameNegative(void *arg)
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
SDL_Scancode scancode;
|
||||
|
||||
/* Clear error message */
|
||||
@@ -627,9 +625,9 @@ keyboard_getScancodeFromNameNegative(void *arg)
|
||||
if (name == NULL) {
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
scancode = SDL_GetScancodeFromName((const char *)name);
|
||||
scancode = SDL_GetScancodeFromName(name);
|
||||
SDLTest_AssertPass("Call to SDL_GetScancodeFromName('%s')", name);
|
||||
SDL_free(name);
|
||||
SDL_free((void *)name);
|
||||
SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode);
|
||||
_checkInvalidNameError();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user