mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
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:
BIN
tests/data/silence-44-s.flac
Normal file
BIN
tests/data/silence-44-s.flac
Normal file
Binary file not shown.
@ -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);
|
||||
|
Reference in New Issue
Block a user