X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftal%2Fstr%2Ftest%2Frun-take.c;h=edf173f81462e346f4c759c5b7ce732de6295a42;hb=291237b4fed863be74051274ac5ad9920cb33cc3;hp=0cbab9e00eb41db6586876cb6088ce83dd0ded71;hpb=5582b011948769779b0d839d35873c2bc557f9cb;p=ccan diff --git a/ccan/tal/str/test/run-take.c b/ccan/tal/str/test/run-take.c index 0cbab9e0..edf173f8 100644 --- a/ccan/tal/str/test/run-take.c +++ b/ccan/tal/str/test/run-take.c @@ -1,6 +1,7 @@ #include #include #include +#include "helper.h" int main(void) { @@ -27,12 +28,12 @@ int main(void) tal_free(c); c = tal_strdup(parent, "hello %s"); - c = tal_asprintf(parent, take(c), "there"); + c = tal_fmt(parent, take(c), "there"); ok1(strcmp(c, "hello there") == 0); ok1(tal_parent(c) == parent); /* No leftover allocations. */ tal_free(c); - ok1(tal_first(parent) == NULL); + ok1(no_children(parent)); tal_free(parent); ok1(!taken_any()); @@ -41,7 +42,7 @@ int main(void) c = NULL; ok1(tal_strdup(NULL, take(c)) == NULL); ok1(tal_strndup(NULL, take(c), 5) == NULL); - ok1(tal_asprintf(NULL, take(c), 0) == NULL); + ok1(tal_fmt(NULL, take(c), 0) == NULL); return exit_status(); }