mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Move a test to the proper place.
The test is actually for XiphComment, not Vorbis::File.
This commit is contained in:
@ -22,7 +22,6 @@ class TestOGG : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testDictInterface2);
|
||||
CPPUNIT_TEST(testAudioProperties);
|
||||
CPPUNIT_TEST(testPageChecksum);
|
||||
CPPUNIT_TEST(testPicture);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -173,39 +172,6 @@ public:
|
||||
|
||||
}
|
||||
|
||||
void testPicture()
|
||||
{
|
||||
ScopedFileCopy copy("empty", ".ogg");
|
||||
string newname = copy.fileName();
|
||||
|
||||
Vorbis::File *f = new Vorbis::File(newname.c_str());
|
||||
FLAC::Picture *newpic = new FLAC::Picture();
|
||||
newpic->setType(FLAC::Picture::BackCover);
|
||||
newpic->setWidth(5);
|
||||
newpic->setHeight(6);
|
||||
newpic->setColorDepth(16);
|
||||
newpic->setNumColors(7);
|
||||
newpic->setMimeType("image/jpeg");
|
||||
newpic->setDescription("new image");
|
||||
newpic->setData("JPEG data");
|
||||
f->tag()->addPicture(newpic);
|
||||
f->save();
|
||||
delete f;
|
||||
|
||||
f = new Vorbis::File(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f->tag()->pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(int(5), lst[0]->width());
|
||||
CPPUNIT_ASSERT_EQUAL(int(6), lst[0]->height());
|
||||
CPPUNIT_ASSERT_EQUAL(int(16), lst[0]->colorDepth());
|
||||
CPPUNIT_ASSERT_EQUAL(int(7), lst[0]->numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), lst[0]->mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("new image"), lst[0]->description());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("JPEG data"), lst[0]->data());
|
||||
|
||||
delete f;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestOGG);
|
||||
|
@ -20,6 +20,7 @@ class TestXiphComment : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testInvalidKeys);
|
||||
CPPUNIT_TEST(testClearComment);
|
||||
CPPUNIT_TEST(testRemoveFields);
|
||||
CPPUNIT_TEST(testPicture);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -119,6 +120,39 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(String("Xiph.Org libVorbis I 20050304"), f.tag()->vendorID());
|
||||
}
|
||||
|
||||
void testPicture()
|
||||
{
|
||||
ScopedFileCopy copy("empty", ".ogg");
|
||||
string newname = copy.fileName();
|
||||
|
||||
{
|
||||
Vorbis::File f(newname.c_str());
|
||||
FLAC::Picture *newpic = new FLAC::Picture();
|
||||
newpic->setType(FLAC::Picture::BackCover);
|
||||
newpic->setWidth(5);
|
||||
newpic->setHeight(6);
|
||||
newpic->setColorDepth(16);
|
||||
newpic->setNumColors(7);
|
||||
newpic->setMimeType("image/jpeg");
|
||||
newpic->setDescription("new image");
|
||||
newpic->setData("JPEG data");
|
||||
f.tag()->addPicture(newpic);
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
Vorbis::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.tag()->pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL((int)5, lst[0]->width());
|
||||
CPPUNIT_ASSERT_EQUAL((int)6, lst[0]->height());
|
||||
CPPUNIT_ASSERT_EQUAL((int)16, lst[0]->colorDepth());
|
||||
CPPUNIT_ASSERT_EQUAL((int)7, lst[0]->numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), lst[0]->mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("new image"), lst[0]->description());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("JPEG data"), lst[0]->data());
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestXiphComment);
|
||||
|
Reference in New Issue
Block a user