mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 05:24:25 -04:00
Add support for AIFF-C files.
This commit is contained in:
BIN
tests/data/alaw.aifc
Normal file
BIN
tests/data/alaw.aifc
Normal file
Binary file not shown.
BIN
tests/data/segfault.aif
Normal file
BIN
tests/data/segfault.aif
Normal file
Binary file not shown.
@ -13,6 +13,8 @@ class TestAIFF : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestAIFF);
|
||||
CPPUNIT_TEST(testReading);
|
||||
CPPUNIT_TEST(testAiffCProperties);
|
||||
CPPUNIT_TEST(testReading);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -27,6 +29,24 @@ public:
|
||||
delete f;
|
||||
}
|
||||
|
||||
void testAiffCProperties()
|
||||
{
|
||||
ScopedFileCopy copy("alaw", ".aifc");
|
||||
string filename = copy.fileName();
|
||||
|
||||
RIFF::AIFF::File *f = new RIFF::AIFF::File(filename.c_str());
|
||||
CPPUNIT_ASSERT(f->audioProperties()->isAiffC());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("ALAW"), f->audioProperties()->compressionType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("SGI CCITT G.711 A-law"), f->audioProperties()->compressionName());
|
||||
delete f;
|
||||
}
|
||||
|
||||
void testFuzzedFiles()
|
||||
{
|
||||
RIFF::AIFF::File f(TEST_FILE_PATH_C("segfault.aif"));
|
||||
CPPUNIT_ASSERT(!f.isValid());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestAIFF);
|
||||
|
Reference in New Issue
Block a user