From e5c2232b10e0b34642ce11bd318f93335042c8b6 Mon Sep 17 00:00:00 2001 From: "Stephen F. Booth" Date: Sat, 5 Oct 2013 14:03:19 -0400 Subject: [PATCH] Added tag setting test --- tests/test_dsf.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_dsf.cpp b/tests/test_dsf.cpp index f6c33ff3..8759ce39 100644 --- a/tests/test_dsf.cpp +++ b/tests/test_dsf.cpp @@ -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);