diff --git a/taglib/riff/wav/infotag.cpp b/taglib/riff/wav/infotag.cpp index d76bf769..6c43e1fc 100644 --- a/taglib/riff/wav/infotag.cpp +++ b/taglib/riff/wav/infotag.cpp @@ -204,7 +204,7 @@ PropertyMap RIFF::Info::Tag::properties() const props[key].append(val); } else { - props.addUnsupportedData(key); + props.addUnsupportedData(String(id, String::Latin1)); } } return props; diff --git a/tests/test_info.cpp b/tests/test_info.cpp index c5b91f97..c481c49e 100644 --- a/tests/test_info.cpp +++ b/tests/test_info.cpp @@ -27,6 +27,7 @@ #include #include "infotag.h" +#include "tpropertymap.h" #include #include "utils.h" @@ -38,6 +39,7 @@ class TestInfoTag : public CppUnit::TestFixture CPPUNIT_TEST_SUITE(TestInfoTag); CPPUNIT_TEST(testTitle); CPPUNIT_TEST(testNumericFields); + CPPUNIT_TEST(testUnsupportedProperties); CPPUNIT_TEST_SUITE_END(); public: @@ -70,6 +72,21 @@ public: CPPUNIT_ASSERT_EQUAL(static_cast(1234), tag.year()); CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("ICRD")); } + + void testUnsupportedProperties() + { + RIFF::Info::Tag tag; + tag.setFieldText("INAM", "Title"); + tag.setFieldText("ITRK", "7"); + + const PropertyMap props = tag.properties(); + CPPUNIT_ASSERT_EQUAL(StringList("ITRK"), props.unsupportedData()); + CPPUNIT_ASSERT_EQUAL(StringList("Title"), props["TITLE"]); + + tag.removeUnsupportedProperties(props.unsupportedData()); + CPPUNIT_ASSERT(!tag.fieldListMap().contains("ITRK")); + CPPUNIT_ASSERT_EQUAL(String("Title"), tag.fieldText("INAM")); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(TestInfoTag);