1 #include <ccan/htable/htable.h>
2 #include <ccan/htable/htable.c>
3 #include <ccan/tap/tap.h>
9 /* We use the number divided by two as the hash (for lots of
11 static size_t hash(const void *elem, void *unused UNNEEDED)
13 size_t h = *(uint64_t *)elem / 2;
20 uint64_t val[NUM_VALS];
23 plan_tests((NUM_VALS) * 2);
24 for (i = 0; i < NUM_VALS; i++)
27 htable_init(&ht, hash, NULL);
28 for (i = 0; i < NUM_VALS; i++) {
31 htable_add(&ht, hash(&val[i], NULL), &val[i]);