From 7988979a722b4cdf287b2093956a76a3f19b9897 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 24 Oct 2016 20:22:12 +0200 Subject: add uClibc-ng test directory --- test/malloc/tst-asprintf.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/malloc/tst-asprintf.c (limited to 'test/malloc/tst-asprintf.c') diff --git a/test/malloc/tst-asprintf.c b/test/malloc/tst-asprintf.c new file mode 100644 index 0000000..d4c3f76 --- /dev/null +++ b/test/malloc/tst-asprintf.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include + +static void my_stats(void) +{ + malloc_stats(); + fprintf(stderr, "\n"); +} + +int main(int argc, char *argv[]) +{ + char *a, *b; + + my_stats(); + asprintf(&b, "asdsadasd %ssdf\n", "AAAA"); + my_stats(); + asprintf(&a, "asdsadasd %ssdf\n", "AAAA"); + my_stats(); + free(a); + free(b); + my_stats(); + + return 0; +} -- cgit v1.2.3