From d76ee9d51e92b96341e1735277394a76f3689ffa Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 19 Aug 2010 06:12:15 +0000 Subject: add unit test for CRC32 --- tests/tests.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/tests.cpp') diff --git a/tests/tests.cpp b/tests/tests.cpp index c9868ad0..22c3eeba 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -51,6 +51,15 @@ void TestUtils::testHmac() QCOMPARE(hmac, QByteArray::fromHex("56be34521d144c88dbb8c733f0e8b3f6")); } +void TestUtils::testCrc32() +{ + quint32 crc = generateCrc32(QByteArray()); + QCOMPARE(crc, 0u); + + crc = generateCrc32(QByteArray("Hi There")); + QCOMPARE(crc, 0xDB143BBEu); +} + template static void parsePacket(T &packet, const QByteArray &xml) { -- cgit v1.2.3