From 0a790f0017638ccc51fc02a36dbb282c1bd43de5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Wed, 8 Jun 2011 19:03:43 +0200 Subject: [PATCH] Add a (failing) test for reading ALAC audio properties --- tests/data/empty_alac.m4a | Bin 0 -> 2289 bytes tests/test_mp4.cpp | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 tests/data/empty_alac.m4a diff --git a/tests/data/empty_alac.m4a b/tests/data/empty_alac.m4a new file mode 100644 index 0000000000000000000000000000000000000000..35b0950c05d2e7e2afee0fcbf6f48c24c73349ff GIT binary patch literal 2289 zcmeH}F>BjE6vv;G222UAp$P`amNFjrV4&Aa8x^(E!Aw!mI9UI7yA>jU>9C512kPo1Te}3=YJ>9!|x|2ji zvkkM;dA;<~BXX&wBL%8NRA|IOKs0%%q%ad3;0XKTEh>+G$J)M)yvcI$zF0G{*hc4u*-moavpLhzkT)Yqim^OtWE$qDMxvc_C0hcf zr{ws$j$V#u!J0vDPxjMGbX)NQ9W>o;i2nrO=~;27tVYPB0MN?MHu~(E)Qs|MNY9bU{uvzR9U4C;CVX7<@8v}P~?rsrfB=QS1 zv)8|l^0YCUy%6qwia@q8X3>W(BX2ej=SrDIUs~`A{BvNS%~k}>!fj?1bihaO4V+#N zfoq%^!1|m6@D-c@Y%tdYScTgJ`(OZmgG+3%GVp-}d*BHC0vAMgX2Ayxu^&iO&d=vlx literal 0 HcmV?d00001 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")); -- 2.40.0