Added tag setting test

This commit is contained in:
Stephen F. Booth
2013-10-05 14:03:19 -04:00
parent 8fc110dfd0
commit e5c2232b10

View File

@ -13,6 +13,7 @@ class TestDSF : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestDSF);
CPPUNIT_TEST(testBasic);
CPPUNIT_TEST(testTags);
CPPUNIT_TEST_SUITE_END();
public:
@ -26,6 +27,22 @@ public:
CPPUNIT_ASSERT_EQUAL(1, props->bitsPerSample());
}
void testTags()
{
ScopedFileCopy copy("empty", ".dsf");
string newname = copy.fileName();
DSF::File *f = new DSF::File(newname.c_str());
CPPUNIT_ASSERT_EQUAL(String(""), f->tag()->artist());
f->tag()->setArtist("The Artist");
f->save();
delete f;
f = new DSF::File(newname.c_str());
CPPUNIT_ASSERT_EQUAL(String("The Artist"), f->tag()->artist());
delete f;
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestDSF);