summaryrefslogtreecommitdiff
path: root/Source/3rdParty/SDL2/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'Source/3rdParty/SDL2/src/test')
-rw-r--r--Source/3rdParty/SDL2/src/test/SDL_test_common.c45
-rw-r--r--Source/3rdParty/SDL2/src/test/SDL_test_harness.c3
2 files changed, 47 insertions, 1 deletions
diff --git a/Source/3rdParty/SDL2/src/test/SDL_test_common.c b/Source/3rdParty/SDL2/src/test/SDL_test_common.c
index b7e294a..81dd39e 100644
--- a/Source/3rdParty/SDL2/src/test/SDL_test_common.c
+++ b/Source/3rdParty/SDL2/src/test/SDL_test_common.c
@@ -1049,6 +1049,22 @@ SDLTest_CommonInit(SDLTest_CommonState * state)
}
static const char *
+DisplayOrientationName(int orientation)
+{
+ switch (orientation)
+ {
+#define CASE(X) case SDL_ORIENTATION_##X: return #X
+ CASE(UNKNOWN);
+ CASE(LANDSCAPE);
+ CASE(LANDSCAPE_FLIPPED);
+ CASE(PORTRAIT);
+ CASE(PORTRAIT_FLIPPED);
+#undef CASE
+default: return "???";
+ }
+}
+
+static const char *
ControllerAxisName(const SDL_GameControllerAxis axis)
{
switch (axis)
@@ -1102,6 +1118,17 @@ SDLTest_PrintEvent(SDL_Event * event)
}
switch (event->type) {
+ case SDL_DISPLAYEVENT:
+ switch (event->display.event) {
+ case SDL_DISPLAYEVENT_ORIENTATION:
+ SDL_Log("SDL EVENT: Display %d changed orientation to %s", event->display.display, DisplayOrientationName(event->display.data1));
+ break;
+ default:
+ SDL_Log("SDL EVENT: Display %d got unknown event 0x%4.4x",
+ event->display.display, event->display.event);
+ break;
+ }
+ break;
case SDL_WINDOWEVENT:
switch (event->window.event) {
case SDL_WINDOWEVENT_SHOWN:
@@ -1349,7 +1376,18 @@ SDLTest_PrintEvent(SDL_Event * event)
case SDL_APP_DIDENTERFOREGROUND:
SDL_Log("SDL EVENT: App entered the foreground");
break;
-
+ case SDL_DROPBEGIN:
+ SDL_Log("SDL EVENT: Drag and drop beginning");
+ break;
+ case SDL_DROPFILE:
+ SDL_Log("SDL EVENT: Drag and drop file: '%s'", event->drop.file);
+ break;
+ case SDL_DROPTEXT:
+ SDL_Log("SDL EVENT: Drag and drop text: '%s'", event->drop.file);
+ break;
+ case SDL_DROPCOMPLETE:
+ SDL_Log("SDL EVENT: Drag and drop ending");
+ break;
case SDL_QUIT:
SDL_Log("SDL EVENT: Quit requested");
break;
@@ -1744,6 +1782,11 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done)
case SDL_MOUSEMOTION:
lastEvent = event->motion;
break;
+
+ case SDL_DROPFILE:
+ case SDL_DROPTEXT:
+ SDL_free(event->drop.file);
+ break;
}
}
diff --git a/Source/3rdParty/SDL2/src/test/SDL_test_harness.c b/Source/3rdParty/SDL2/src/test/SDL_test_harness.c
index 15021c6..80b0794 100644
--- a/Source/3rdParty/SDL2/src/test/SDL_test_harness.c
+++ b/Source/3rdParty/SDL2/src/test/SDL_test_harness.c
@@ -206,6 +206,9 @@ SDLTest_SetTestTimeout(int timeout, void (*callback)())
/**
* \brief Timeout handler. Aborts test run and exits harness process.
*/
+#if defined(__WATCOMC__)
+#pragma aux SDLTest_BailOut aborts;
+#endif
static SDL_NORETURN void
SDLTest_BailOut()
{