diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tests.cpp | 9 | ||||
| -rw-r--r-- | tests/tests.h | 1 |
2 files changed, 10 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) { diff --git a/tests/tests.h b/tests/tests.h index a9b7fa1d..6fa076b6 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -28,6 +28,7 @@ class TestUtils : public QObject Q_OBJECT private slots: + void testCrc32(); void testHmac(); }; |
