From 594eb408cb1e2f6b1a506f24d2197c264ec4f8d3 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 1 Feb 2025 21:20:00 -0700 Subject: [PATCH] Test opening `sf::Music` with non-ASCII filenames --- test/Audio/Music.test.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/Audio/Music.test.cpp b/test/Audio/Music.test.cpp index d2a573916..aab05dfce 100644 --- a/test/Audio/Music.test.cpp +++ b/test/Audio/Music.test.cpp @@ -133,7 +133,21 @@ TEST_CASE("[Audio] sf::Music", runAudioDeviceTests()) SECTION("Valid file") { - REQUIRE(music.openFromFile("Audio/ding.mp3")); + SECTION("ASCII filename") + { + REQUIRE(music.openFromFile("Audio/ding.mp3")); + } + + SECTION("Polish filename") + { + REQUIRE(music.openFromFile(U"Audio/ding-\u0144.mp3")); + } + + SECTION("Emoji filename") + { + REQUIRE(music.openFromFile(U"Audio/ding-\U0001F40C.mp3")); + } + CHECK(music.getDuration() == sf::microseconds(1990884)); const auto [offset, length] = music.getLoopPoints(); CHECK(offset == sf::Time::Zero);