diff options
author | Urs Fleisch <ufleisch@users.sourceforge.net> | 2019-05-17 13:15:48 +0200 |
---|---|---|
committer | Stephen F. Booth <me@sbooth.org> | 2019-05-17 15:45:48 +0430 |
commit | 79bb1428c0482966cdafd9b6e1127e98b4637fbf (patch) | |
tree | 46f45e6b3132005d5247beab184e5fe1bd2db6c1 /tests | |
parent | 7470f92a67375d00e53b3785a88fa7b26ad6f1da (diff) |
Support ID3v2 GRP1 frame introduced with iTunes 12.5.4.42, #903. (#904)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_id3v2.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp index 7d94af06..8c6f67dc 100644 --- a/tests/test_id3v2.cpp +++ b/tests/test_id3v2.cpp @@ -110,6 +110,7 @@ class TestID3v2 : public CppUnit::TestFixture CPPUNIT_TEST(testPropertyInterface); CPPUNIT_TEST(testPropertyInterface2); CPPUNIT_TEST(testPropertiesMovement); + CPPUNIT_TEST(testPropertyGrouping); CPPUNIT_TEST(testDeleteFrame); CPPUNIT_TEST(testSaveAndStripID3v1ShouldNotAddFrameFromID3v1ToId3v2); CPPUNIT_TEST(testParseChapterFrame); @@ -966,6 +967,33 @@ public: tag.addFrame(parsedFrameMvin); } + void testPropertyGrouping() + { + ID3v2::Tag tag; + ID3v2::TextIdentificationFrame *frameGrp1 = new ID3v2::TextIdentificationFrame("GRP1"); + frameGrp1->setText("Grouping"); + tag.addFrame(frameGrp1); + + PropertyMap properties = tag.properties(); + CPPUNIT_ASSERT(properties.contains("GROUPING")); + CPPUNIT_ASSERT_EQUAL(String("Grouping"), properties["GROUPING"].front()); + + ByteVector frameDataGrp1("GRP1" + "\x00\x00\x00\x09" + "\x00\x00" + "\x00" + "Grouping", 19); + CPPUNIT_ASSERT_EQUAL(frameDataGrp1, frameGrp1->render()); + + ID3v2::FrameFactory *factory = ID3v2::FrameFactory::instance(); + ID3v2::TextIdentificationFrame *parsedFrameGrp1 = + dynamic_cast<ID3v2::TextIdentificationFrame *>(factory->createFrame(frameDataGrp1)); + CPPUNIT_ASSERT(parsedFrameGrp1); + CPPUNIT_ASSERT_EQUAL(String("Grouping"), parsedFrameGrp1->toString()); + + tag.addFrame(parsedFrameGrp1); + } + void testDeleteFrame() { ScopedFileCopy copy("rare_frames", ".mp3"); |