Add a test case for the return value of setProperties()

This commit is contained in:
Michael Helmling 2012-12-10 19:55:23 +01:00
parent 4140c5f2eb
commit 9eb0f2941f

View File

@ -24,6 +24,7 @@ class TestFLAC : public CppUnit::TestFixture
CPPUNIT_TEST(testRepeatedSave);
CPPUNIT_TEST(testSaveMultipleValues);
CPPUNIT_TEST(testDict);
CPPUNIT_TEST(testInvalid);
CPPUNIT_TEST_SUITE_END();
public:
@ -231,6 +232,17 @@ public:
CPPUNIT_ASSERT_EQUAL(String("artöst 2"), dict["ARTIST"][1]);
}
void testInvalid()
{
ScopedFileCopy copy("silence-44-s", ".flac");
PropertyMap map;
map["HÄÖ"] = String("bla");
FLAC::File f(copy.fileName().c_str());
PropertyMap invalid = f.setProperties(map);
CPPUNIT_ASSERT_EQUAL(uint(1), invalid.size());
CPPUNIT_ASSERT_EQUAL(uint(0), f.properties().size());
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestFLAC);