Skip to content

Three tests fail with the shift to SDL3 #285

@mcepl

Description

@mcepl

What doesn't work?
When packaging the 0.9.17 package (tarball from PyPI) for openSUSE/Factory we have encountered these three tests from the package’s test suite to fail:

[   64s] =================================== FAILURES ===================================
[   64s] _______________________________ test_SDL_SetHint _______________________________
[   64s] 
[   64s] with_sdl = None
[   64s] 
[   64s]     def test_SDL_SetHint(with_sdl):
[   64s]         assert sdl2.SDL_SetHint(b"TEST", b"32") == 1
[   64s]         assert sdl2.SDL_GetHint(b"TEST") == b"32"
[   64s]         assert sdl2.SDL_SetHint(b"TEST", b"abcdef") == 1
[   64s]         assert sdl2.SDL_GetHint(b"TEST") == b"abcdef"
[   64s] >       assert sdl2.SDL_SetHint(b"", b"hi") == 1
[   64s] E       AssertionError: assert 0 == 1
[   64s] E        +  where 0 = <_FuncPtr object at 0x7ff28e010120>(b'', b'hi')
[   64s] E        +    where <_FuncPtr object at 0x7ff28e010120> = sdl2.SDL_SetHint
[   64s] 
[   64s] sdl2/test/hints_test.py:35: AssertionError
[   64s] ________________________ test_SDL_SetWindowDisplayMode _________________________
[   64s] 
[   64s] window = <sdl2.video.LP_SDL_Window object at 0x7ff28a69f800>
[   64s] 
[   64s]     def test_SDL_SetWindowDisplayMode(window):
[   64s]         # NOTE: Sets the fullscreen mode of the window, so can't easily test
[   64s]         # NOTE: If set mode not supported, will change to closest supported res
[   64s]         dindex = sdl2.SDL_GetWindowDisplayIndex(window)
[   64s]         dmode = sdl2.SDL_DisplayMode()
[   64s]         ret = sdl2.SDL_GetCurrentDisplayMode(dindex, byref(dmode))
[   64s]         assert ret == 0
[   64s]         sdl2.SDL_SetWindowDisplayMode(window, dmode)
[   64s]         wmode = sdl2.SDL_DisplayMode()
[   64s]         ret = sdl2.SDL_GetWindowDisplayMode(window, byref(wmode))
[   64s]         assert ret == 0, _check_error_msg()
[   64s] >       assert dmode == wmode
[   64s] E       assert SDL_DisplayMode(1024x768 @ 0Hz) == SDL_DisplayMode(1024x768 @ 60Hz)
[   64s] 
[   64s] sdl2/test/video_test.py:391: AssertionError
[   64s] _________________________ test_SDL_SetWindowFullscreen _________________________
[   64s] 
[   64s] with_sdl = None
[   64s] 
[   64s]     def test_SDL_SetWindowFullscreen(with_sdl):
[   64s]         # TODO: Add non-hidden test once annoying test toggle implemented
[   64s]         flags = (
[   64s]             sdl2.SDL_WINDOW_BORDERLESS | sdl2.SDL_WINDOW_HIDDEN,
[   64s]             sdl2.SDL_WINDOW_RESIZABLE | sdl2.SDL_WINDOW_HIDDEN,
[   64s]         )
[   64s]         is_fullscreen = sdl2.SDL_WINDOW_FULLSCREEN
[   64s]         for flag in flags:
[   64s]             window = sdl2.SDL_CreateWindow(b"Test", 0, 0, 1024, 768, flag)
[   64s]             sdl2.SDL_SetWindowFullscreen(window, True)
[   64s]             flags = sdl2.SDL_GetWindowFlags(window)
[   64s] >           assert flags & is_fullscreen == is_fullscreen
[   64s] E           assert (24 & 1) == 1
[   64s] 
[   64s] sdl2/test/video_test.py:648: AssertionError

How To Reproduce

Complete build log with all packages used and all steps taken to reproduce.

Platform (if relevant):

  • OS: openSUSE/Tumblweed
  • Python Version: various versions (3.11, 3.12, and 3.13), this one is from 3.11.12
  • SDL2 Version:
[    6s] [476/489] cumulate libSDL3-0-3.2.10-1.1
[    6s] [478/489] cumulate libSDL2-2_0-0-2.32.54-1.1
[    6s] [480/489] cumulate libSDL2_gfx-1_0-0-1.0.4-3.1
[    6s] [481/489] cumulate libSDL2_ttf-2_0-0-2.24.0-2.1
[    6s] [483/489] cumulate libSDL2_mixer-2_0-0-2.8.1-1.2
[    6s] [484/489] cumulate libSDL2_image-2_0-0-2.8.8-2.1
[    6s] [485/489] cumulate SDL3-devel-3.2.10-1.1
[    6s] [486/489] cumulate SDL2_ttf-devel-2.24.0-2.1
[    6s] [487/489] cumulate libSDL2_gfx-devel-1.0.4-3.1
[    6s] [488/489] cumulate SDL2_mixer-devel-2.8.1-1.2
[    6s] [489/489] cumulate SDL2_image-devel-2.8.8-2.1
  • Using pysdl2-dll: most likely not, because I don’t know what it is

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions