Added FLAC::Properties::signature()

BUG:160172


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1148630 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský
2010-07-11 10:26:35 +00:00
parent 1d10bde500
commit 7426a64d2b
7 changed files with 53 additions and 0 deletions

View File

@ -37,6 +37,7 @@ class TestByteVector : public CppUnit::TestFixture
CPPUNIT_TEST(testFind2);
CPPUNIT_TEST(testRfind1);
CPPUNIT_TEST(testRfind2);
CPPUNIT_TEST(testToHex);
CPPUNIT_TEST_SUITE_END();
public:
@ -173,6 +174,13 @@ public:
CPPUNIT_ASSERT_EQUAL(10, r4.rfind("OggS", 12));
}
void testToHex()
{
ByteVector v("\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f", 16);
CPPUNIT_ASSERT_EQUAL(ByteVector("f0e1d2c3b4a5968778695a4b3c2d1e0f"), v.toHex());
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestByteVector);

View File

@ -13,11 +13,18 @@ using namespace TagLib;
class TestFLAC : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestFLAC);
CPPUNIT_TEST(testSignature);
CPPUNIT_TEST(testMultipleCommentBlocks);
CPPUNIT_TEST_SUITE_END();
public:
void testSignature()
{
FLAC::File f("data/no-tags.flac");
CPPUNIT_ASSERT_EQUAL(ByteVector("a1b141f766e9849ac3db1030a20a3c77"), f.audioProperties()->signature().toHex());
}
void testMultipleCommentBlocks()
{
ScopedFileCopy copy("multiple-vc", ".flac");