diff --git a/tests/data/id3v1_neq_v2.mp3 b/tests/data/id3v1_neq_v2.mp3 new file mode 100644 index 00000000..984cb1d4 Binary files /dev/null and b/tests/data/id3v1_neq_v2.mp3 differ diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp index 48faf306..f2a420a8 100644 --- a/tests/test_id3v2.cpp +++ b/tests/test_id3v2.cpp @@ -75,6 +75,7 @@ class TestID3v2 : public CppUnit::TestFixture CPPUNIT_TEST(testW000); CPPUNIT_TEST(testPropertyInterface); CPPUNIT_TEST(testPropertyInterface2); + CPPUNIT_TEST(testBothID3Versions); CPPUNIT_TEST(testDeleteFrame); CPPUNIT_TEST(testSaveAndStripID3v1ShouldNotAddFrameFromID3v1ToId3v2); CPPUNIT_TEST_SUITE_END(); @@ -696,6 +697,22 @@ public: CPPUNIT_ASSERT_EQUAL(frame6, ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://musicbrainz.org")); } +void testBothID3Versions() + { + ScopedFileCopy copy("id3v1_neq_v2", ".mp3"); + string newname = copy.fileName(); + MPEG::File f(newname.c_str()); + PropertyMap dict = f.properties(); + CPPUNIT_ASSERT(!dict.contains("ALBUM")); + CPPUNIT_ASSERT(dict.contains("ARTIST")); + + f.save(); + MPEG::File f2(newname.c_str()); + PropertyMap dict2 = f.properties(); + CPPUNIT_ASSERT(!dict2.contains("ALBUM")); + CPPUNIT_ASSERT(dict2.contains("ARTIST")); + } + void testDeleteFrame() { ScopedFileCopy copy("rare_frames", ".mp3");