Add a test for duplicate ID3v2 tags.

This commit is contained in:
Tsuda Kageyu 2014-10-21 00:16:43 +09:00
parent 71acf3b6f7
commit 269e78f1a0
2 changed files with 14 additions and 0 deletions

Binary file not shown.

View File

@ -16,6 +16,7 @@ class TestMPEG : public CppUnit::TestFixture
CPPUNIT_TEST(testSaveID3v24);
CPPUNIT_TEST(testSaveID3v24WrongParam);
CPPUNIT_TEST(testSaveID3v23);
CPPUNIT_TEST(testDuplicateID3v2);
CPPUNIT_TEST_SUITE_END();
public:
@ -92,6 +93,19 @@ public:
}
}
void testDuplicateID3v2()
{
ScopedFileCopy copy("duplicate_id3v2", ".mp3");
string newname = copy.fileName();
MPEG::File f(newname.c_str());
// duplicate_id3v2.mp3 has duplicate ID3v2 tags.
// Sample rate will be 32000 if can't skip the second tag.
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestMPEG);