aboutsummaryrefslogtreecommitdiff
path: root/tests/tests.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-19 06:12:15 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-19 06:12:15 +0000
commitd76ee9d51e92b96341e1735277394a76f3689ffa (patch)
tree2ce2d8a05a4642c7fb54967a95a11511c1c15ee8 /tests/tests.cpp
parent1a83328273b65a9e17a37bb844dce511244d6274 (diff)
downloadqxmpp-d76ee9d51e92b96341e1735277394a76f3689ffa.tar.gz
add unit test for CRC32
Diffstat (limited to 'tests/tests.cpp')
-rw-r--r--tests/tests.cpp9
1 files changed, 9 insertions, 0 deletions
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 <class T>
static void parsePacket(T &packet, const QByteArray &xml)
{