X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Ftest%2Frun-string.c;fp=ccan%2Ftal%2Ftest%2Frun-string.c;h=0000000000000000000000000000000000000000;hp=0155ecbe9212f3b997c39727c3b530bc822abeb0;hb=5582b011948769779b0d839d35873c2bc557f9cb;hpb=15ed4f453713f1a7bdeec22b53704819fa3d447f;ds=sidebyside diff --git a/ccan/tal/test/run-string.c b/ccan/tal/test/run-string.c deleted file mode 100644 index 0155ecbe..00000000 --- a/ccan/tal/test/run-string.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include - -int main(void) -{ - char *parent, *c; - - plan_tests(13); - - parent = tal(NULL, char); - ok1(parent); - - c = tal_strdup(parent, "hello"); - ok1(strcmp(c, "hello") == 0); - ok1(tal_parent(c) == parent); - - c = tal_strndup(parent, "hello", 3); - ok1(strcmp(c, "hel") == 0); - ok1(tal_parent(c) == parent); - - c = tal_typechk_(parent, char *); - c = tal_dup(parent, char, "hello", 6, 0); - ok1(strcmp(c, "hello") == 0); - ok1(strcmp(tal_name(c), "char[]") == 0); - ok1(tal_parent(c) == parent); - - /* Now with an extra byte. */ - c = tal_dup(parent, char, "hello", 6, 1); - ok1(strcmp(c, "hello") == 0); - ok1(strcmp(tal_name(c), "char[]") == 0); - ok1(tal_parent(c) == parent); - strcat(c, "x"); - - c = tal_asprintf(parent, "hello %s", "there"); - ok1(strcmp(c, "hello there") == 0); - ok1(tal_parent(c) == parent); - tal_free(parent); - - return exit_status(); -}