/* We use the number divided by two as the hash (for lots of
collisions), plus set all the higher bits so we can detect if they
don't get masked out. */
-static size_t hash(const void *elem, void *unused)
+static size_t hash(const void *elem, void *unused UNNEEDED)
{
size_t h = *(uint64_t *)elem / 2;
h |= -1UL << NUM_BITS;
return true;
}
-int main(int argc, char *argv[])
+int main(void)
{
unsigned int i, weight;
uintptr_t perfect_bit;
void *p;
struct htable_iter iter;
- plan_tests(35);
+ plan_tests(36);
for (i = 0; i < NUM_VALS; i++)
val[i] = i;
dne = i;
i++;
ok1(i == NUM_VALS);
+ i = 0;
+ for (p = htable_prev(&ht, &iter); p; p = htable_prev(&ht, &iter))
+ i++;
+ ok1(i == NUM_VALS);
+
/* Delete all. */
del_vals(&ht, val, NUM_VALS);
ok1(!htable_get(&ht, hash(&val[0], NULL), objcmp, &val[0]));