Parcourir la source

Fix video_getSetWindowPosition() that fail when checking events,
because testautomation_events.c() didn't finish to poll all events before

(cherry picked from commit 3ccfd361cb4ff081f7696e5fbc4174f5d4aa1ca1)

Sylvain il y a 2 ans
Parent
commit
3d5679bb8e
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      test/testautomation_events.c

+ 4 - 0
test/testautomation_events.c

@@ -68,6 +68,10 @@ 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;
 }