From: Jens Axboe Date: Sun, 28 Sep 2014 03:27:48 +0000 (-0600) Subject: crc/test: add fnv X-Git-Tag: fio-2.1.13~20 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=951984d8c1171b03718600a26e4666601d27bb91 crc/test: add fnv Signed-off-by: Jens Axboe --- diff --git a/crc/test.c b/crc/test.c index 6453a72b..bca46f24 100644 --- a/crc/test.c +++ b/crc/test.c @@ -18,6 +18,7 @@ #include "../crc/sha512.h" #include "../crc/xxhash.h" #include "../crc/murmur3.h" +#include "../crc/fnv.h" #include "../hash.h" #include "test.h" @@ -45,6 +46,7 @@ enum { T_XXHASH = 1U << 9, T_MURMUR3 = 1U << 10, T_JHASH = 1U << 11, + T_FNV = 1U << 12, }; static void t_md5(struct test_type *t, void *buf, size_t size) @@ -155,6 +157,14 @@ static void t_jhash(struct test_type *t, void *buf, size_t size) t->output += jhash(buf, size, 0x8989); } +static void t_fnv(struct test_type *t, void *buf, size_t size) +{ + int i; + + for (i = 0; i < NR_CHUNKS; i++) + t->output += fnv(buf, size, 0x8989); +} + static void t_xxhash(struct test_type *t, void *buf, size_t size) { void *state; @@ -229,6 +239,11 @@ static struct test_type t[] = { .mask = T_JHASH, .fn = t_jhash, }, + { + .name = "fnv", + .mask = T_FNV, + .fn = t_fnv, + }, { .name = NULL, },