From ddc1c7e98fd8da5b8a17eaae92b707d943309710 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 30 Apr 2018 08:24:31 +0200 Subject: [PATCH] Update to display checksum correctly. --- bench/udb2/test-mlib.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/bench/udb2/test-mlib.c b/bench/udb2/test-mlib.c index 615ec470..73eac87a 100644 --- a/bench/udb2/test-mlib.c +++ b/bench/udb2/test-mlib.c @@ -1,18 +1,3 @@ -/* Makefile: - -all:run-test - -run-test:test.c ../common.c mlib - $(CC) -std=gnu99 -O2 -Wall -Imlib $< -o $@ - -mlib: - git clone https://github.com/P-p-H-d/mlib.git - -clean: - rm -f run-test* *~ - rm -rf mlib -*/ - #include "../common.c" #include "m-dict.h" @@ -38,8 +23,8 @@ void test_int(uint32_t n, uint32_t x0) x = hash32(x); unsigned int key = get_key(n, x); unsigned int *ptr = dict_oa_uint_get(h, key); - if (ptr) (*ptr)++; - else dict_oa_uint_set_at(h, key, 1); + if (ptr) { (*ptr)++; z+= *ptr; } + else { dict_oa_uint_set_at(h, key, 1); z+=1; } } fprintf(stderr, "# unique keys: %d; checksum: %u\n", (int) dict_oa_uint_size(h), z); dict_oa_uint_clear(h);