]> granicus.if.org Git - taglib/commitdiff
Improve a test about handling duplicate tags in WAV files.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 7 Aug 2015 04:36:35 +0000 (13:36 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 25 Aug 2015 02:03:00 +0000 (11:03 +0900)
tests/test_wav.cpp

index e2463790e2e5a31006c013b5602b76a89a87cf90..24bb02c5d39cafe14a27c101b0b4137eee87efba 100644 (file)
@@ -188,7 +188,10 @@ public:
 
   void testDuplicateTags()
   {
-    RIFF::WAV::File f(TEST_FILE_PATH_C("duplicate_tags.wav"));
+    ScopedFileCopy copy("duplicate_tags", ".wav");
+
+    RIFF::WAV::File f(copy.fileName().c_str());
+    CPPUNIT_ASSERT_EQUAL(17052L, f.length());
 
     // duplicate_tags.wav has duplicate ID3v2/INFO tags.
     // title() returns "Title2" if can't skip the second tag.
@@ -198,6 +201,10 @@ public:
 
     CPPUNIT_ASSERT(f.hasInfoTag());
     CPPUNIT_ASSERT_EQUAL(String("Title1"), f.InfoTag()->title());
+
+    f.save();
+    CPPUNIT_ASSERT_EQUAL(15898L, f.length());
+    CPPUNIT_ASSERT_EQUAL(-1L, f.find("Title2"));
   }
 
   void testFuzzedFile1()