]> granicus.if.org Git - taglib/commitdiff
Improve a test about splitting OGG pages.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 7 Aug 2015 07:45:44 +0000 (16:45 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 7 Aug 2015 07:47:13 +0000 (16:47 +0900)
Check for #529.

tests/test_ogg.cpp

index f5f27bbcaa7747c14074181e144b555e4d1b2dc0..72f51942c23dd7258a809582fa9ff470e6f03b9f 100644 (file)
@@ -45,13 +45,18 @@ public:
     ScopedFileCopy copy("empty", ".ogg");
     string newname = copy.fileName();
 
+    String longText(std::string(128 * 1024, ' ').c_str());
+    for(size_t i = 0; i < longText.length(); ++i)
+      longText[i] = static_cast<wchar>(L'A' + (i % 26));
+
     Vorbis::File *f = new Vorbis::File(newname.c_str());
-    f->tag()->addField("test", ByteVector(128 * 1024, 'x') + ByteVector(1, '\0'));
+    f->tag()->setTitle(longText);
     f->save();
     delete f;
 
     f = new Vorbis::File(newname.c_str());
     CPPUNIT_ASSERT_EQUAL(19, f->lastPageHeader()->pageSequenceNumber());
+    CPPUNIT_ASSERT_EQUAL(longText, f->tag()->title());
     delete f;
   }