]> granicus.if.org Git - taglib/commitdiff
Add a test for APE files with an ID3v2 tag.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 12 Jun 2015 04:18:06 +0000 (13:18 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 18 Jun 2015 05:41:37 +0000 (14:41 +0900)
tests/data/mac-399-id3v2.ape [new file with mode: 0644]
tests/test_ape.cpp

diff --git a/tests/data/mac-399-id3v2.ape b/tests/data/mac-399-id3v2.ape
new file mode 100644 (file)
index 0000000..2ea97fc
Binary files /dev/null and b/tests/data/mac-399-id3v2.ape differ
index 1ac732555a2125a1c30abb70c60d7c3bdf9e3864..3ab3197b67d9090bb4211cbf0ef7cdadb8f0997c 100644 (file)
@@ -15,6 +15,7 @@ class TestAPE : public CppUnit::TestFixture
   CPPUNIT_TEST_SUITE(TestAPE);
   CPPUNIT_TEST(testProperties399);
   CPPUNIT_TEST(testProperties399Tagged);
+  CPPUNIT_TEST(testProperties399Id3v2);
   CPPUNIT_TEST(testProperties396);
   CPPUNIT_TEST(testProperties390);
   CPPUNIT_TEST(testFuzzedFile1);
@@ -53,6 +54,21 @@ public:
     CPPUNIT_ASSERT_EQUAL(3990, f.audioProperties()->version());
   }
 
+  void testProperties399Id3v2()
+  {
+    APE::File f(TEST_FILE_PATH_C("mac-399-id3v2.ape"));
+    CPPUNIT_ASSERT(f.audioProperties());
+    CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
+    CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
+    CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
+    CPPUNIT_ASSERT_EQUAL(192, f.audioProperties()->bitrate());
+    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
+    CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
+    CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
+    CPPUNIT_ASSERT_EQUAL(156556U, f.audioProperties()->sampleFrames());
+    CPPUNIT_ASSERT_EQUAL(3990, f.audioProperties()->version());
+  }
+
   void testProperties396()
   {
     APE::File f(TEST_FILE_PATH_C("mac-396.ape"));