mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Fix handling of lowercase 'metadata_block_picture' fields in Vorbis comments.
Also refactored some redundant code for parsing pictures.
This commit is contained in:
BIN
tests/data/lowercase-fields.ogg
Normal file
BIN
tests/data/lowercase-fields.ogg
Normal file
Binary file not shown.
@ -47,6 +47,7 @@ class TestXiphComment : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testClearComment);
|
||||
CPPUNIT_TEST(testRemoveFields);
|
||||
CPPUNIT_TEST(testPicture);
|
||||
CPPUNIT_TEST(testLowercaseFields);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -192,6 +193,23 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void testLowercaseFields()
|
||||
{
|
||||
const ScopedFileCopy copy("lowercase-fields", ".ogg");
|
||||
{
|
||||
Vorbis::File f(copy.fileName().c_str());
|
||||
List<FLAC::Picture *> lst = f.tag()->pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL(String("TEST TITLE"), f.tag()->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String("TEST ARTIST"), f.tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
Vorbis::File f(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(f.find("METADATA_BLOCK_PICTURE") > 0);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestXiphComment);
|
||||
|
Reference in New Issue
Block a user