summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/core/test-core-secure.cpp3
-rw-r--r--tests/unit/core/test-core-string.cpp3
-rw-r--r--tests/unit/core/test-core.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-secure.cpp b/tests/unit/core/test-core-secure.cpp
index 2fe178b44..1ae802fe9 100644
--- a/tests/unit/core/test-core-secure.cpp
+++ b/tests/unit/core/test-core-secure.cpp
@@ -120,6 +120,9 @@ TEST(CoreSecure, Hash)
WEE_CHECK_HASH_BIN(NULL, "test", 0, 0);
WEE_CHECK_HASH_HEX(NULL, "test", 0, 0);
+ WEE_CHECK_HASH_BIN(DATA_HASH_CRC32, data, length, GCRY_MD_CRC32);
+ WEE_CHECK_HASH_HEX(DATA_HASH_CRC32, data, length, GCRY_MD_CRC32);
+
WEE_CHECK_HASH_BIN(DATA_HASH_MD5, data, length, GCRY_MD_MD5);
WEE_CHECK_HASH_HEX(DATA_HASH_MD5, data, length, GCRY_MD_MD5);
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index 0c39e5204..b6d148dbb 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -1978,6 +1978,9 @@ TEST(CoreString, Hash)
WEE_CHECK_HASH_BIN(NULL, DATA_HASH, length, "not_an_algo");
WEE_CHECK_HASH_HEX(NULL, DATA_HASH, length, "not_an_algo");
+ WEE_CHECK_HASH_BIN(DATA_HASH_CRC32, data, length, "crc32");
+ WEE_CHECK_HASH_HEX(DATA_HASH_CRC32, data, length, "crc32");
+
WEE_CHECK_HASH_BIN(DATA_HASH_MD5, data, length, "md5");
WEE_CHECK_HASH_HEX(DATA_HASH_MD5, data, length, "md5");
diff --git a/tests/unit/core/test-core.h b/tests/unit/core/test-core.h
index ace1e55aa..edf5bc35f 100644
--- a/tests/unit/core/test-core.h
+++ b/tests/unit/core/test-core.h
@@ -21,6 +21,7 @@
#define WEECHAT_TEST_UNIT_CORE_H
#define DATA_HASH "this is a test of hash function"
+#define DATA_HASH_CRC32 "ef26fe3e"
#define DATA_HASH_MD5 "1197d121af621ac6a63cb8ef6b5dfa30"
#define DATA_HASH_SHA1 "799d818061175b400dc5aaeb14b8d32cdef32ff0"
#define DATA_HASH_SHA224 "637d21f3ba3f4e9fa9fb889dc990b31a658cb37b4aefb5144" \