Skip to content

Remove test setting hint with empty string #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Mar 14, 2025

Setting a SDL hint with an empty name does not make sense.

This is also what upstream thinks:
libsdl-org/SDL#12538 (comment)

PR Description

Remove test case testing setting a hint with no name.

Merge Checklist

  • the PR has been reviewed and all comments are resolved
  • all CI checks pass
  • (if applicable): the PR description includes the phrase closes #<issue-number> to automatically close an issue
  • (if applicable): bug fixes, new features, or API changes are documented in news.rst

SDL2 allows a hint with an empty name, SDL3 does not.
Because of this, sdl2-compat has a different behavior.

Since a hint with no name does not make sense, remove the test.
@a-hurst
Copy link
Member

a-hurst commented Mar 20, 2025

Thanks for the patch, @madebr! I agree the test doesn't make sense (don't think I wrote it, I only took over PySDL2 maintenance in 2020).

Also, am I correct in reading the linked PR that pysdl2's tests are being used to help improve SDL2's automated test suite? That's really cool to see, glad any of my efforts here have been able to benefit the main project! Big thanks to you an the rest of the SDL team for your all your work 🙂

@a-hurst a-hurst merged commit a4fba93 into py-sdl:master Mar 20, 2025
33 checks passed
@madebr
Copy link
Contributor Author

madebr commented Mar 20, 2025

Also, am I correct in reading the linked PR that pysdl2's tests are being used to help improve SDL2's automated test suite? That's really cool to see, glad any of my efforts here have been able to benefit the main project! Big thanks to you an the rest of the SDL team for your all your work 🙂

Yes! We were noticed of pysdl2 test failures here.
There are a few remaining test failures that might need a change in the pysdl2 test suite. Most are related to features SDL3 dropped (e.g. brightness and gamma ramp).

We also have to thank you for the test suite! They make a nice addition to our own test suite, which is mostly functional.

@madebr madebr deleted the remove-empty-hint-name-test branch March 20, 2025 20:08
@a-hurst
Copy link
Member

a-hurst commented Mar 20, 2025

@madebr I'm happy to help any way I can! I should probably add a CI runner that tests against sdl2-compat as well to avoid breaking anything on my end going forward.

Are there going to be sdl2-compat equivalents for the ttf/image/mixer libraries as well, or are the APIs unchanged enough for those that they can be mostly used as-is?

@madebr
Copy link
Contributor Author

madebr commented Mar 20, 2025

@madebr I'm happy to help any way I can! I should probably add a CI runner that tests against sdl2-compat as well to avoid breaking anything on my end going forward.

Your tests are very useful, so more of those would always be useful. I noticed ~300 of them are currently skipped without implementation.
But moving forward, having a py-sdl3 would always be nice!

About python bindings, I dabbled a bit with this here. (If you know how to create quality json/xml/... from our headers, your contribution would be greatly appreciated)

Are there going to be sdl2-compat equivalents for the ttf/image/mixer libraries as well, or are the APIs unchanged enough for those that they can be mostly used as-is?

No, only the main SDL library gets the compat treatment. Those libraries will remain working on top of sdl2-compat.
Hell, sdl12-compat will work on top of sdl2-compat on top of SDL3.

@penguinpee
Copy link

Yes! We were noticed of pysdl2 test failures here.

What goes around comes around... 😉

On the subject of adding sdl2-compat to CI, I would very much appreciate that. As of (soon to be released) Fedora 42, the SDL2 package has been dropped and all depending packages have moved to sdl2-compat.

Thank you both for your work and for fixing the tests in different places. I just tried building with the latest release of sdl2-compat (2.32.54) and it's down to three tests failing. I'll go through recent PRs and check if any of those apply, starting with this one, in the course of the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants