Fix saving MP4 files.

This fixes the issue reported at #619.
This commit is contained in:
Tsuda Kageyu
2015-11-24 23:41:10 +09:00
parent fa4289e044
commit 94b7828990
4 changed files with 20 additions and 18 deletions

View File

@ -30,6 +30,7 @@ class TestMP4 : public CppUnit::TestFixture
CPPUNIT_TEST(testCovrRead2);
CPPUNIT_TEST(testProperties);
CPPUNIT_TEST(testFuzzedFile);
CPPUNIT_TEST(testRepeatedSave);
CPPUNIT_TEST_SUITE_END();
public:
@ -344,6 +345,17 @@ public:
CPPUNIT_ASSERT(f.isValid());
}
void testRepeatedSave()
{
ScopedFileCopy copy("no-tags", ".m4a");
MP4::File f(copy.fileName().c_str());
f.tag()->setTitle("0123456789");
f.save();
f.save();
CPPUNIT_ASSERT_EQUAL(2862L, f.find("0123456789"));
CPPUNIT_ASSERT_EQUAL(-1L, f.find("0123456789", 2863));
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestMP4);