aboutsummaryrefslogtreecommitdiff
path: root/tests/test_mmhash.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2024-03-24 09:36:51 +0800
committerMistivia <i@mistivia.com>2024-03-24 09:36:51 +0800
commit1208bdd0fccc5f1e380053d8e0a7f4df6fe8f805 (patch)
treea4fddb7211a2782b3934cf02d80ef6d1734ec1c2 /tests/test_mmhash.c
git init
Diffstat (limited to 'tests/test_mmhash.c')
-rw-r--r--tests/test_mmhash.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_mmhash.c b/tests/test_mmhash.c
new file mode 100644
index 0000000..3a9895c
--- /dev/null
+++ b/tests/test_mmhash.c
@@ -0,0 +1,15 @@
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "mmhash.h"
+
+int main() {
+ printf("[TEST] hash\n");
+ char buf[] = "hello, world\n";
+ uint64_t hash0 = mmhash(buf, strlen(buf), 0);
+ uint64_t hash1 = mmhash(buf, 3, 0);
+ assert(hash0 != hash1);
+ printf("[PASS] hash\n");
+ return 0;
+}