]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/test/run-count.c
tal: make tal_len/tal_count(NULL) return 0.
[ccan] / ccan / tal / test / run-count.c
index 91b020dcc8de13138d2e15c6683db1fce4c5c7e0..33049b9f78d3e2edc9e675ed2afc7450d9b9597d 100644 (file)
@@ -43,7 +43,11 @@ int main(void)
 
        tal_set_backend(my_alloc, my_realloc, my_free, NULL);
 
 
        tal_set_backend(my_alloc, my_realloc, my_free, NULL);
 
-       plan_tests(19 * 3);
+       plan_tests(2 + 19 * 3);
+
+       p1 = NULL;
+       ok1(tal_len(p1) == 0);
+       ok1(tal_count(p1) == 0);
 
        for (i = 0; i < 3; i++) {
                move = i;
 
        for (i = 0; i < 3; i++) {
                move = i;
@@ -82,5 +86,7 @@ int main(void)
                tal_free(p2);
                tal_free(p1);
        }
                tal_free(p2);
                tal_free(p1);
        }
+
+       tal_cleanup();
        return exit_status();
 }
        return exit_status();
 }