aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukáš Lalinský <lalinsky@gmail.com>2011-06-08 19:03:43 +0200
committerLukáš Lalinský <lalinsky@gmail.com>2011-06-08 19:03:43 +0200
commit0a790f0017638ccc51fc02a36dbb282c1bd43de5 (patch)
tree114f47b3d5258e209940fdde656f8c1619de499c
parentdc062a0844d9d5050724302478f2d1c0cf0c813e (diff)
Add a (failing) test for reading ALAC audio properties
-rw-r--r--tests/data/empty_alac.m4abin0 -> 2289 bytes
-rw-r--r--tests/test_mp4.cpp15
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/data/empty_alac.m4a b/tests/data/empty_alac.m4a
new file mode 100644
index 00000000..35b0950c
--- /dev/null
+++ b/tests/data/empty_alac.m4a
Binary files differ
diff --git a/tests/test_mp4.cpp b/tests/test_mp4.cpp
index 1e7f8f5a..bedf43ef 100644
--- a/tests/test_mp4.cpp
+++ b/tests/test_mp4.cpp
@@ -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"));