diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp index 1076fd43f..c1b4e094f 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp +++ b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp @@ -38,6 +38,8 @@ struct AnyImporterTest: TestSuite::Tester { void wav(); + void uppercase(); + void unknown(); /* Explicitly forbid system-wide plugin dependencies */ @@ -46,7 +48,7 @@ struct AnyImporterTest: TestSuite::Tester { AnyImporterTest::AnyImporterTest() { addTests({&AnyImporterTest::wav, - + &AnyImporterTest::uppercase, &AnyImporterTest::unknown}); /* Load the plugin directly from the build tree. Otherwise it's static and @@ -72,6 +74,18 @@ void AnyImporterTest::wav() { CORRADE_COMPARE(importer->frequency(), 96000); } +void AnyImporterTest::uppercase() { + if(!(_manager.loadState("WavAudioImporter") & PluginManager::LoadState::Loaded)) + CORRADE_SKIP("WavAudioImporter plugin not enabled, cannot test"); + + Containers::Pointer importer = _manager.instantiate("AnyAudioImporter"); + CORRADE_VERIFY(importer->openFile(UPPERCASE_WAV_FILE)); + + /* Check only parameters, as it is good enough proof that it is working */ + CORRADE_COMPARE(importer->format(), BufferFormat::Stereo8); + CORRADE_COMPARE(importer->frequency(), 96000); +} + void AnyImporterTest::unknown() { std::ostringstream output; Error redirectError{&output}; diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt b/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt index 696ee79f9..bf4f4c7b8 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt @@ -25,8 +25,10 @@ if(CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID) set(WAV_FILE stereo8.wav) + set(UPPERCASE_WAV_FILE uppercase.wav) else() set(WAV_FILE ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/WavAudioImporter/Test/stereo8.wav) + set(UPPERCASE_WAV_FILE ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/WavAudioImporter/Test/uppercase.WAV) endif() # CMake before 3.8 has broken $ expressions for iOS (see @@ -52,7 +54,8 @@ endif() corrade_add_test(AnyAudioImporterTest AnyAudioImporterTest.cpp LIBRARIES MagnumAudio FILES - ../../WavAudioImporter/Test/stereo8.wav) + ../../WavAudioImporter/Test/stereo8.wav + ../../WavAudioImporter/Test/uppercase.WAV) if(NOT BUILD_PLUGINS_STATIC) target_include_directories(AnyAudioImporterTest PRIVATE $) else() diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/configure.h.cmake b/src/MagnumPlugins/AnyAudioImporter/Test/configure.h.cmake index 0ab7554db..81a49c59d 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/configure.h.cmake +++ b/src/MagnumPlugins/AnyAudioImporter/Test/configure.h.cmake @@ -26,3 +26,4 @@ #cmakedefine ANYAUDIOIMPORTER_PLUGIN_FILENAME "${ANYAUDIOIMPORTER_PLUGIN_FILENAME}" #cmakedefine WAVAUDIOIMPORTER_PLUGIN_FILENAME "${WAVAUDIOIMPORTER_PLUGIN_FILENAME}" #define WAV_FILE "${WAV_FILE}" +#define UPPERCASE_WAV_FILE "${UPPERCASE_WAV_FILE}" diff --git a/src/MagnumPlugins/WavAudioImporter/Test/uppercase.WAV b/src/MagnumPlugins/WavAudioImporter/Test/uppercase.WAV new file mode 100644 index 000000000..02298ef3b Binary files /dev/null and b/src/MagnumPlugins/WavAudioImporter/Test/uppercase.WAV differ