mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Restore the previously initialized subsystems after the Init/Quit test
Fixes https://github.com/libsdl-org/SDL/issues/8796
This commit is contained in:
@@ -21,6 +21,7 @@ static int main_testInitQuitJoystickHaptic(void *arg)
|
||||
return TEST_SKIPPED;
|
||||
#else
|
||||
int enabled_subsystems;
|
||||
int previous_subsystems = SDL_WasInit(SDL_INIT_EVERYTHING);
|
||||
int initialized_subsystems = SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC;
|
||||
|
||||
SDLTest_AssertCheck(SDL_Init(initialized_subsystems) == 0, "SDL_Init multiple systems.");
|
||||
@@ -33,6 +34,8 @@ static int main_testInitQuitJoystickHaptic(void *arg)
|
||||
enabled_subsystems = SDL_WasInit(initialized_subsystems);
|
||||
SDLTest_AssertCheck(enabled_subsystems == 0, "SDL_Quit should shut down everything (%i)", enabled_subsystems);
|
||||
|
||||
SDL_Init(previous_subsystems);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user