Read-only support for FLAC picture blocks

CCBUG:218696


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1154376 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský
2010-07-25 11:06:36 +00:00
parent 0f979667be
commit dcef0fbad2
10 changed files with 434 additions and 4 deletions

Binary file not shown.

View File

@ -15,6 +15,7 @@ class TestFLAC : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE(TestFLAC);
CPPUNIT_TEST(testSignature);
CPPUNIT_TEST(testMultipleCommentBlocks);
CPPUNIT_TEST(testPicture);
CPPUNIT_TEST_SUITE_END();
public:
@ -41,6 +42,26 @@ public:
delete f;
}
void testPicture()
{
ScopedFileCopy copy("silence-44-s", ".flac");
string newname = copy.fileName();
FLAC::File *f = new FLAC::File(newname.c_str());
List<FLAC::Picture *> lst = f->pictureList();
CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
FLAC::Picture *pic = lst.front();
CPPUNIT_ASSERT_EQUAL(3, int(pic->type()));
CPPUNIT_ASSERT_EQUAL(1, pic->width());
CPPUNIT_ASSERT_EQUAL(1, pic->height());
CPPUNIT_ASSERT_EQUAL(24, pic->colorDepth());
CPPUNIT_ASSERT_EQUAL(0, pic->numColors());
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType());
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description());
CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic->data().size());
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestFLAC);