|
|
|
@ -45,29 +45,34 @@ class WavImporterTest: public TestSuite::Tester { |
|
|
|
void wrongSignature(); |
|
|
|
void wrongSignature(); |
|
|
|
void unsupportedFormat(); |
|
|
|
void unsupportedFormat(); |
|
|
|
void unsupportedChannelCount(); |
|
|
|
void unsupportedChannelCount(); |
|
|
|
|
|
|
|
|
|
|
|
void invalidPadding(); |
|
|
|
void invalidPadding(); |
|
|
|
void invalidLength(); |
|
|
|
void invalidLength(); |
|
|
|
void invalidDataChunk(); |
|
|
|
void invalidDataChunk(); |
|
|
|
void invalidFactChunk(); |
|
|
|
void invalidFactChunk(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void mono4(); |
|
|
|
void mono8(); |
|
|
|
void mono8(); |
|
|
|
void mono8junk(); |
|
|
|
void mono8junk(); |
|
|
|
void mono8ALaw(); |
|
|
|
void mono8ALaw(); |
|
|
|
void mono8MuLaw(); |
|
|
|
void mono8MuLaw(); |
|
|
|
void mono16(); |
|
|
|
void mono16(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void stereo4(); |
|
|
|
void stereo8(); |
|
|
|
void stereo8(); |
|
|
|
void stereo8ALaw(); |
|
|
|
void stereo8ALaw(); |
|
|
|
void stereo8MuLaw(); |
|
|
|
void stereo8MuLaw(); |
|
|
|
void stereo12(); |
|
|
|
void stereo12(); |
|
|
|
void stereo16(); |
|
|
|
void stereo16(); |
|
|
|
void stereo24(); |
|
|
|
void stereo24(); |
|
|
|
|
|
|
|
void stereo32(); |
|
|
|
|
|
|
|
|
|
|
|
void mono32f(); |
|
|
|
void mono32f(); |
|
|
|
void stereo32f(); |
|
|
|
void stereo32f(); |
|
|
|
void stereo64f(); |
|
|
|
void stereo64f(); |
|
|
|
|
|
|
|
|
|
|
|
void surround51Channel16(); |
|
|
|
void surround51Channel16(); |
|
|
|
|
|
|
|
void surround71Channel24(); |
|
|
|
|
|
|
|
|
|
|
|
void debugAudioFormat(); |
|
|
|
void debugAudioFormat(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
@ -77,28 +82,34 @@ WavImporterTest::WavImporterTest() { |
|
|
|
&WavImporterTest::wrongSignature, |
|
|
|
&WavImporterTest::wrongSignature, |
|
|
|
&WavImporterTest::unsupportedFormat, |
|
|
|
&WavImporterTest::unsupportedFormat, |
|
|
|
&WavImporterTest::unsupportedChannelCount, |
|
|
|
&WavImporterTest::unsupportedChannelCount, |
|
|
|
|
|
|
|
|
|
|
|
&WavImporterTest::invalidPadding, |
|
|
|
&WavImporterTest::invalidPadding, |
|
|
|
&WavImporterTest::invalidLength, |
|
|
|
&WavImporterTest::invalidLength, |
|
|
|
&WavImporterTest::invalidDataChunk, |
|
|
|
&WavImporterTest::invalidDataChunk, |
|
|
|
&WavImporterTest::invalidFactChunk, |
|
|
|
&WavImporterTest::invalidFactChunk, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&WavImporterTest::mono4, |
|
|
|
&WavImporterTest::mono8, |
|
|
|
&WavImporterTest::mono8, |
|
|
|
&WavImporterTest::mono8junk, |
|
|
|
&WavImporterTest::mono8junk, |
|
|
|
&WavImporterTest::mono8ALaw, |
|
|
|
&WavImporterTest::mono8ALaw, |
|
|
|
&WavImporterTest::mono8MuLaw, |
|
|
|
&WavImporterTest::mono8MuLaw, |
|
|
|
&WavImporterTest::mono16, |
|
|
|
&WavImporterTest::mono16, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&WavImporterTest::stereo4, |
|
|
|
&WavImporterTest::stereo8, |
|
|
|
&WavImporterTest::stereo8, |
|
|
|
&WavImporterTest::stereo8ALaw, |
|
|
|
&WavImporterTest::stereo8ALaw, |
|
|
|
&WavImporterTest::stereo8MuLaw, |
|
|
|
&WavImporterTest::stereo8MuLaw, |
|
|
|
&WavImporterTest::stereo12, |
|
|
|
&WavImporterTest::stereo12, |
|
|
|
&WavImporterTest::stereo16, |
|
|
|
&WavImporterTest::stereo16, |
|
|
|
&WavImporterTest::stereo24, |
|
|
|
&WavImporterTest::stereo24, |
|
|
|
|
|
|
|
&WavImporterTest::stereo32, |
|
|
|
|
|
|
|
|
|
|
|
&WavImporterTest::mono32f, |
|
|
|
&WavImporterTest::mono32f, |
|
|
|
&WavImporterTest::stereo32f, |
|
|
|
&WavImporterTest::stereo32f, |
|
|
|
&WavImporterTest::stereo64f, |
|
|
|
&WavImporterTest::stereo64f, |
|
|
|
|
|
|
|
|
|
|
|
&WavImporterTest::surround51Channel16, |
|
|
|
&WavImporterTest::surround51Channel16, |
|
|
|
|
|
|
|
&WavImporterTest::surround71Channel24, |
|
|
|
|
|
|
|
|
|
|
|
&WavImporterTest::debugAudioFormat}); |
|
|
|
&WavImporterTest::debugAudioFormat}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -178,6 +189,15 @@ void WavImporterTest::invalidFactChunk() { |
|
|
|
TestSuite::Compare::Container); |
|
|
|
TestSuite::Compare::Container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::mono4() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WavImporter importer; |
|
|
|
|
|
|
|
CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono4.wav"))); |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported format Audio::WavAudioFormat(0x2)\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::mono8() { |
|
|
|
void WavImporterTest::mono8() { |
|
|
|
WavImporter importer; |
|
|
|
WavImporter importer; |
|
|
|
CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono8.wav"))); |
|
|
|
CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono8.wav"))); |
|
|
|
@ -238,6 +258,15 @@ void WavImporterTest::mono16() { |
|
|
|
TestSuite::Compare::Container); |
|
|
|
TestSuite::Compare::Container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::stereo4() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WavImporter importer; |
|
|
|
|
|
|
|
CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "stereo4.wav"))); |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported format Audio::WavAudioFormat(0x2)\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::stereo8() { |
|
|
|
void WavImporterTest::stereo8() { |
|
|
|
WavImporter importer; |
|
|
|
WavImporter importer; |
|
|
|
CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "stereo8.wav"))); |
|
|
|
CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "stereo8.wav"))); |
|
|
|
@ -306,6 +335,16 @@ void WavImporterTest::stereo24() { |
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): PCM with unsupported channel count 2 with 24 bits per sample\n"); |
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): PCM with unsupported channel count 2 with 24 bits per sample\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::stereo32() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WavImporter importer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "stereo32.wav"))); |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): PCM with unsupported channel count 2 with 32 bits per sample\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::mono32f() { |
|
|
|
void WavImporterTest::mono32f() { |
|
|
|
WavImporter importer; |
|
|
|
WavImporter importer; |
|
|
|
CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono32f.wav"))); |
|
|
|
CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono32f.wav"))); |
|
|
|
@ -359,6 +398,16 @@ void WavImporterTest::surround51Channel16() { |
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported format Audio::WavAudioFormat::Extensible\n"); |
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported format Audio::WavAudioFormat::Extensible\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::surround71Channel24() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WavImporter importer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "surround71Channel24.wav"))); |
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported format Audio::WavAudioFormat::Extensible\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WavImporterTest::debugAudioFormat() { |
|
|
|
void WavImporterTest::debugAudioFormat() { |
|
|
|
std::ostringstream out; |
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
|
|
|
|
|