From 52ef7c9955e30ca29ea8d80cb98fcffabd51e9ad Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 1 Feb 2025 21:25:15 -0700 Subject: [PATCH] Test loading `sf::SoundBuffer` with non-ASCII filenames --- test/Audio/SoundBuffer.test.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/Audio/SoundBuffer.test.cpp b/test/Audio/SoundBuffer.test.cpp index 270a36c28..3d24f1601 100644 --- a/test/Audio/SoundBuffer.test.cpp +++ b/test/Audio/SoundBuffer.test.cpp @@ -122,7 +122,21 @@ TEST_CASE("[Audio] sf::SoundBuffer", runAudioDeviceTests()) SECTION("Valid file") { - REQUIRE(soundBuffer.loadFromFile("Audio/ding.flac")); + SECTION("ASCII filename") + { + REQUIRE(soundBuffer.loadFromFile("Audio/ding.flac")); + } + + SECTION("Polish filename") + { + REQUIRE(soundBuffer.loadFromFile(U"Audio/ding-\u0144.flac")); + } + + SECTION("Emoji filename") + { + REQUIRE(soundBuffer.loadFromFile(U"Audio/ding-\U0001F40C.flac")); + } + CHECK(soundBuffer.getSamples() != nullptr); CHECK(soundBuffer.getSampleCount() == 87798); CHECK(soundBuffer.getSampleRate() == 44100);