From eedaf13effc5a7dc3c1698ed792cc8d023b47a42 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 27 Dec 2025 07:10:09 +0100 Subject: [PATCH] fnv1a assert tests --- fnv1a.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fnv1a.c b/fnv1a.c index 8156a91..11646ee 100644 --- a/fnv1a.c +++ b/fnv1a.c @@ -2,6 +2,7 @@ * Check wikipedia for details and pseudocode. */ +#include #include #include #include @@ -46,4 +47,14 @@ int main(void) { printf("FNV1a64 of \"Hello\": %lX\n", h64_2); printf("FNV1a32 of \"Hello\": %X\n", h32_2); + + fflush(stdin); + + assert(h64 == 0xA430D84680AABD0B); + assert(h32 == 0x4F9F2CAB); + + assert(h64_2 == 0x63F0BFACF2C00F6B); + assert(h32_2 == 0xF55C314B); + + printf("All tests passed!\n"); }