From 3ccfd361cb4ff081f7696e5fbc4174f5d4aa1ca1 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Tue, 21 Mar 2023 12:11:57 +0100
Subject: [PATCH] Fix video_getSetWindowPosition() that fail when checking
events, because testautomation_events.c() didn't finish to poll all events
before
---
test/testautomation_events.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/testautomation_events.c b/test/testautomation_events.c
index 99da3ba5ee93..a2732990bb42 100644
--- a/test/testautomation_events.c
+++ b/test/testautomation_events.c
@@ -66,6 +66,10 @@ static int events_pushPumpAndPollUserevent(void *arg)
SDLTest_AssertPass("Call to SDL_PollEvent()");
SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result);
+ /* Need to finish getting all events and sentinel, otherwise other tests that rely on event are in bad state */
+ while (SDL_PollEvent(&event2)) {
+ }
+
return TEST_COMPLETED;
}