mirror of
https://github.com/taglib/taglib.git
synced 2025-07-22 23:14:33 -04:00
Rewrote File, FileRef and FileStream to use smart pointers
This commit is contained in:
@ -37,6 +37,7 @@ public:
|
||||
string newname = copy.fileName();
|
||||
|
||||
FileRef *f = new FileRef(newname.c_str());
|
||||
CPPUNIT_ASSERT(f->isValid());
|
||||
CPPUNIT_ASSERT(!f->isNull());
|
||||
f->tag()->setArtist("test artist");
|
||||
f->tag()->setTitle("test title");
|
||||
@ -48,6 +49,7 @@ public:
|
||||
delete f;
|
||||
|
||||
f = new FileRef(newname.c_str());
|
||||
CPPUNIT_ASSERT(f->isValid());
|
||||
CPPUNIT_ASSERT(!f->isNull());
|
||||
CPPUNIT_ASSERT_EQUAL(f->tag()->artist(), String("test artist"));
|
||||
CPPUNIT_ASSERT_EQUAL(f->tag()->title(), String("test title"));
|
||||
@ -65,6 +67,7 @@ public:
|
||||
delete f;
|
||||
|
||||
f = new FileRef(newname.c_str());
|
||||
CPPUNIT_ASSERT(f->isValid());
|
||||
CPPUNIT_ASSERT(!f->isNull());
|
||||
CPPUNIT_ASSERT_EQUAL(f->tag()->artist(), String("ttest artist"));
|
||||
CPPUNIT_ASSERT_EQUAL(f->tag()->title(), String("ytest title"));
|
||||
@ -73,6 +76,27 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f->tag()->track(), TagLib::uint(7));
|
||||
CPPUNIT_ASSERT_EQUAL(f->tag()->year(), TagLib::uint(2080));
|
||||
delete f;
|
||||
|
||||
f = new FileRef(newname.c_str());
|
||||
CPPUNIT_ASSERT(f->isValid());
|
||||
CPPUNIT_ASSERT(!f->isNull());
|
||||
PropertyMap prop = f->properties();
|
||||
CPPUNIT_ASSERT_EQUAL(prop["ARTIST"].front(), String("ttest artist"));
|
||||
CPPUNIT_ASSERT_EQUAL(prop["TITLE" ].front(), String("ytest title"));
|
||||
prop["ARTIST"].front() = "a test artist";
|
||||
prop["TITLE" ].front() = "b test title";
|
||||
f->setProperties(prop);
|
||||
f->save();
|
||||
delete f;
|
||||
|
||||
f = new FileRef(newname.c_str());
|
||||
CPPUNIT_ASSERT(f->isValid());
|
||||
CPPUNIT_ASSERT(!f->isNull());
|
||||
prop = f->properties();
|
||||
CPPUNIT_ASSERT_EQUAL(prop["ARTIST"].front(), String("a test artist"));
|
||||
CPPUNIT_ASSERT_EQUAL(prop["TITLE" ].front(), String("b test title"));
|
||||
delete f;
|
||||
|
||||
}
|
||||
|
||||
void testMusepack()
|
||||
|
Reference in New Issue
Block a user