X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Ftest%2Frun-take.c;h=4a7f0c7495374fa72696dce45e6111ca024fec09;hp=d93304e206bdf4207cb33bc7bd5eaf12333eb982;hb=9d2d2c49f053018724bcc6e37029da10b7c3d60d;hpb=d3d2242ba8d975f8d7ddaa0348953dfd6f45ffce diff --git a/ccan/tal/test/run-take.c b/ccan/tal/test/run-take.c index d93304e2..4a7f0c74 100644 --- a/ccan/tal/test/run-take.c +++ b/ccan/tal/test/run-take.c @@ -6,7 +6,7 @@ int main(void) { char *parent, *c; - plan_tests(21); + plan_tests(22); /* We can take NULL. */ ok1(take(NULL) == NULL); @@ -44,6 +44,12 @@ int main(void) tal_free(c); ok1(tal_first(parent) == NULL); + /* tal_resize should return a taken pointer. */ + c = take(tal_arr(parent, char, 5)); + tal_resize(&c, 100); + ok1(taken(c)); + tal_free(c); + tal_free(parent); ok1(!taken_any());