mirror of
https://github.com/SFML/SFML.git
synced 2025-02-14 20:38:01 +08:00
Test opening sound files with non-ASCII filenames
This commit is contained in:
parent
fd93e848f7
commit
a45c4ecbcd
@ -164,7 +164,21 @@ TEST_CASE("[Audio] sf::InputSoundFile")
|
||||
{
|
||||
SECTION("flac")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/ding.flac"));
|
||||
SECTION("ASCII filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/ding.flac"));
|
||||
}
|
||||
|
||||
SECTION("Polish filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/ding-\u0144.flac"));
|
||||
}
|
||||
|
||||
SECTION("Emoji filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/ding-\U0001F40C.flac"));
|
||||
}
|
||||
|
||||
CHECK(inputSoundFile.getSampleCount() == 87'798);
|
||||
CHECK(inputSoundFile.getChannelCount() == 1);
|
||||
CHECK(inputSoundFile.getSampleRate() == 44'100);
|
||||
@ -175,7 +189,21 @@ TEST_CASE("[Audio] sf::InputSoundFile")
|
||||
|
||||
SECTION("mp3")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/ding.mp3"));
|
||||
SECTION("ASCII filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/ding.mp3"));
|
||||
}
|
||||
|
||||
SECTION("Polish filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/ding-\u0144.mp3"));
|
||||
}
|
||||
|
||||
SECTION("Emoji filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/ding-\U0001F40C.mp3"));
|
||||
}
|
||||
|
||||
CHECK(inputSoundFile.getSampleCount() == 87'798);
|
||||
CHECK(inputSoundFile.getChannelCount() == 1);
|
||||
CHECK(inputSoundFile.getSampleRate() == 44'100);
|
||||
@ -186,7 +214,21 @@ TEST_CASE("[Audio] sf::InputSoundFile")
|
||||
|
||||
SECTION("ogg")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/doodle_pop.ogg"));
|
||||
SECTION("ASCII filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/doodle_pop.ogg"));
|
||||
}
|
||||
|
||||
SECTION("Polish filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/doodle_pop-\u0144.ogg"));
|
||||
}
|
||||
|
||||
SECTION("Emoji filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/doodle_pop-\U0001F40C.ogg"));
|
||||
}
|
||||
|
||||
CHECK(inputSoundFile.getSampleCount() == 2'116'992);
|
||||
CHECK(inputSoundFile.getChannelCount() == 2);
|
||||
CHECK(inputSoundFile.getSampleRate() == 44'100);
|
||||
@ -197,7 +239,21 @@ TEST_CASE("[Audio] sf::InputSoundFile")
|
||||
|
||||
SECTION("wav")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/killdeer.wav"));
|
||||
SECTION("ASCII filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile("Audio/killdeer.wav"));
|
||||
}
|
||||
|
||||
SECTION("Polish filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/killdeer-\u0144.wav"));
|
||||
}
|
||||
|
||||
SECTION("Emoji filename")
|
||||
{
|
||||
REQUIRE(inputSoundFile.openFromFile(U"Audio/killdeer-\U0001F40C.wav"));
|
||||
}
|
||||
|
||||
CHECK(inputSoundFile.getSampleCount() == 112'941);
|
||||
CHECK(inputSoundFile.getChannelCount() == 1);
|
||||
CHECK(inputSoundFile.getSampleRate() == 22'050);
|
||||
|
BIN
test/Audio/ding-ń.flac
Normal file
BIN
test/Audio/ding-ń.flac
Normal file
Binary file not shown.
BIN
test/Audio/ding-ń.mp3
Normal file
BIN
test/Audio/ding-ń.mp3
Normal file
Binary file not shown.
BIN
test/Audio/ding-🐌.flac
Normal file
BIN
test/Audio/ding-🐌.flac
Normal file
Binary file not shown.
BIN
test/Audio/ding-🐌.mp3
Normal file
BIN
test/Audio/ding-🐌.mp3
Normal file
Binary file not shown.
BIN
test/Audio/doodle_pop-ń.ogg
Normal file
BIN
test/Audio/doodle_pop-ń.ogg
Normal file
Binary file not shown.
BIN
test/Audio/doodle_pop-🐌.ogg
Normal file
BIN
test/Audio/doodle_pop-🐌.ogg
Normal file
Binary file not shown.
BIN
test/Audio/killdeer-ń.wav
Normal file
BIN
test/Audio/killdeer-ń.wav
Normal file
Binary file not shown.
BIN
test/Audio/killdeer-🐌.wav
Normal file
BIN
test/Audio/killdeer-🐌.wav
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user