]> git.ozlabs.org Git - ccan/blobdiff - ccan/alloc/test/run.c
tdb2: copy tdb1's changed expansion logic.
[ccan] / ccan / alloc / test / run.c
index e75eddbffe4fabe8b45cd3f6e7f85ef6bc2e17a5..7c8fce3d76fd0f2202d4a136b1ce89712993c4cb 100644 (file)
@@ -11,7 +11,7 @@
 
 static int addr_cmp(void **a, void **b)
 {
-       return (*a) - (*b);
+       return (char *)(*a) - (char *)(*b);
 }
 
 static bool unique(void *p[], unsigned int num)
@@ -160,11 +160,13 @@ static void test(unsigned int pool_size)
        ok1(alloc_size(mem, pool_size, p[0]) < pool_size);
        alloc_free(mem, pool_size, p[0]);
        ok1(alloc_check(mem, pool_size));
+
+       free(mem);
 }
 
 int main(int argc, char *argv[])
 {
-       plan_tests(480);
+       plan_tests(440);
 
        /* Large test. */
        test(MIN_USEFUL_SIZE * 2);