void WavImporterTest::unsupportedChannelCount() { std::ostringstream out; Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "unsupportedChannelCount.wav"))); CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported channel count 6 with 8 bits per sample\n"); }
void WavImporterTest::unsupportedFormat() { std::ostringstream out; Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "unsupportedFormat.wav"))); CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported audio format 2\n"); }
void WavImporterTest::wrongSignature() { std::ostringstream out; Error redirectError{&out}; WavImporter importer; CORRADE_VERIFY(!importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "wrongSignature.wav"))); CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): the file signature is invalid\n"); }
void WavImporterTest::mono16() { WavImporter importer; CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono16.wav"))); CORRADE_COMPARE(importer.format(), Buffer::Format::Mono16); CORRADE_COMPARE(importer.frequency(), 44000); CORRADE_COMPARE_AS(importer.data(), Containers::Array<char>::from('\x1d', '\x10', '\x71', '\xc5'), TestSuite::Compare::Container); }
void WavImporterTest::stereo8() { WavImporter importer; CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "stereo8.wav"))); CORRADE_COMPARE(importer.format(), Buffer::Format::Stereo8); CORRADE_COMPARE(importer.frequency(), 96000); CORRADE_COMPARE_AS(importer.data(), Containers::Array<char>::from('\xde', '\xfe', '\xca', '\x7e'), TestSuite::Compare::Container); }
void WavImporterTest::mono16() { WavImporter importer; CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "mono16.wav"))); CORRADE_COMPARE(importer.format(), Buffer::Format::Mono16); CORRADE_COMPARE(importer.frequency(), 44000); Containers::Array<unsigned char> data = importer.data(); CORRADE_COMPARE(data.size(), 4); CORRADE_COMPARE(data[0], 0x1d); CORRADE_COMPARE(data[1], 0x10); CORRADE_COMPARE(data[2], 0x71); CORRADE_COMPARE(data[3], 0xC5); }
void WavImporterTest::stereo8() { WavImporter importer; CORRADE_VERIFY(importer.openFile(Utility::Directory::join(WAVAUDIOIMPORTER_TEST_DIR, "stereo8.wav"))); CORRADE_COMPARE(importer.format(), Buffer::Format::Stereo8); CORRADE_COMPARE(importer.frequency(), 96000); Containers::Array<unsigned char> data = importer.data(); CORRADE_COMPARE(data.size(), 4); CORRADE_COMPARE(data[0], 0xde); CORRADE_COMPARE(data[1], 0xfe); CORRADE_COMPARE(data[2], 0xca); CORRADE_COMPARE(data[3], 0x7e); }