]> git.ozlabs.org Git - ccan/blobdiff - ccan/htable/test/run-type.c
htable: reduce size of htable by calculating max every time.
[ccan] / ccan / htable / test / run-type.c
index a3616a5a37b8fb1f2588d9d8e369136c6436665e..f097acb69fdec375acb8472fdc0034a452cd05ca 100644 (file)
@@ -122,7 +122,7 @@ int main(void)
        dne = i;
 
        htable_obj_init(&ht);
-       ok1(ht.raw.max == 0);
+       ok1(ht_max(&ht.raw) == 0);
        ok1(ht.raw.bits == 0);
 
        /* We cannot find an entry which doesn't exist. */
@@ -131,7 +131,7 @@ int main(void)
        /* Fill it, it should increase in size. */
        add_vals(&ht, val, NUM_VALS);
        ok1(ht.raw.bits == NUM_BITS + 1);
-       ok1(ht.raw.max < (1 << ht.raw.bits));
+       ok1(ht_max(&ht.raw) < (1 << ht.raw.bits));
 
        /* Mask should be set. */
        ok1(ht.raw.common_mask != 0);