libsdl-org / sdl2-compat

An SDL2 compatibility layer that uses SDL3 behind the scenes.
zlib License
73 stars 17 forks source link

testautomation test closes prematurely #213

Closed madebr closed 1 week ago

madebr commented 2 weeks ago

The testautomation stops in subsystems_referenceCount, but has still 3 tests to do.

https://github.com/libsdl-org/sdl2-compat/actions/runs/10650456036/job/29521852563#step:14:6499

13: INFO:  09/01/24 00:18:25: ===== Test Suite 23: 'Subsystems' started
13: INFO:  09/01/24 00:18:25: ----- Test Case 23.1: 'subsystems_referenceCount' started
13: INFO:  09/01/24 00:18:25: Test Description: 'Makes sure that subsystem stays until number of quits matches inits.'
13: INFO:  09/01/24 00:18:25: Test Iteration 1: execKey 7538134344330723016
madebr commented 1 week ago

It turns out logging after SDL_Quit stops working. After SDL_Quit, the verbosity is reset to the default SDL_LOG_PRIORITY_ERROR.

The following patch "fixes" the issue.

--- a/test/testautomation_subsystems.c
+++ b/test/testautomation_subsystems.c
@@ -27,6 +27,7 @@ static void subsystemsTearDown(void *arg)
 {
     /* Reset each one of the SDL subsystems */
     SDL_Quit();
+    SDL_LogSetPriority(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO);

     SDLTest_AssertPass("Cleanup of subsystems test completed");
 }
slouken commented 1 week ago

Looks great!

madebr commented 1 week ago

Looks great!

Is it? SDL2 does not have this behavior. This would diverge the SDL2 and SDL2-compat tests.

slouken commented 1 week ago

sdl2-compat resets the logging level to default after SDL_Quit(), this is fine.

slouken commented 1 week ago

Wait, this is sdl2-compat. It should be doing that, can you look and see why that's not working?