Improve a test about splitting OGG pages.

Check for #529.
This commit is contained in:
Tsuda Kageyu 2015-08-07 16:45:44 +09:00
parent 80441ff754
commit eff92fed98

View 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;
}