diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
commit | 7988979a722b4cdf287b2093956a76a3f19b9897 (patch) | |
tree | d35e251d0472ceca55a2eef61cff261c8ee68fab /test/malloc/tst-asprintf.c |
add uClibc-ng test directory
Diffstat (limited to 'test/malloc/tst-asprintf.c')
-rw-r--r-- | test/malloc/tst-asprintf.c | 27 |
1 files changed, 27 insertions, 0 deletions
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 <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <malloc.h> + +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; +} |