Add a (failing) test for reading ALAC audio properties

This commit is contained in:
Lukáš Lalinský 2011-06-08 19:03:43 +02:00
parent dc062a0844
commit 0a790f0017
2 changed files with 13 additions and 2 deletions

BIN
tests/data/empty_alac.m4a Normal file

Binary file not shown.

View File

@ -14,7 +14,8 @@ using namespace TagLib;
class TestMP4 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestMP4);
CPPUNIT_TEST(testProperties);
CPPUNIT_TEST(testPropertiesAAC);
CPPUNIT_TEST(testPropertiesALAC);
CPPUNIT_TEST(testFreeForm);
CPPUNIT_TEST(testCheckValid);
CPPUNIT_TEST(testUpdateStco);
@ -28,7 +29,7 @@ class TestMP4 : public CppUnit::TestFixture
public:
void testProperties()
void testPropertiesAAC()
{
MP4::File f(TEST_FILE_PATH_C("has-tags.m4a"));
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
@ -38,6 +39,16 @@ public:
CPPUNIT_ASSERT_EQUAL(16, ((MP4::Properties *)f.audioProperties())->bitsPerSample());
}
void testPropertiesALAC()
{
MP4::File f(TEST_FILE_PATH_C("empty_alac.m4a"));
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(16, ((MP4::Properties *)f.audioProperties())->bitsPerSample());
}
void testCheckValid()
{
MP4::File f(TEST_FILE_PATH_C("empty.aiff"));