Exemplo n.º 1
0
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");
}
Exemplo n.º 2
0
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");
}
Exemplo n.º 3
0
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");
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 5
0
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);
}
Exemplo n.º 6
0
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);
}
Exemplo n.º 7
0
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);
}