Skip to content

Commit

Permalink
Add a test to show a problem with properties() and duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Helmling committed Dec 10, 2012
1 parent c0ca5c9 commit 6e3391a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Binary file added tests/data/id3v1_neq_v2.mp3
Binary file not shown.
17 changes: 17 additions & 0 deletions tests/test_id3v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -696,6 +697,22 @@ class TestID3v2 : public CppUnit::TestFixture
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");
Expand Down

0 comments on commit 6e3391a

Please sign in to comment.