From 3f664faf8f2ea2a3ae86f8554d151adc5909f369 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Wed, 24 Apr 2002 11:44:27 +0000 Subject: [PATCH] Add test for stupid malloc etc args. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@129 --- tests/Makefile.am | 5 ++++- tests/malloc3.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/malloc3.c diff --git a/tests/Makefile.am b/tests/Makefile.am index d122548585..0f144e7ea2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,4 +23,7 @@ EXTRA_DIST = \ signal3.c smc1.c \ suppfree.c tronical.c \ tronical.s twoparams.c \ - twoparams.s \ No newline at end of file + twoparams.s \ + pth_cvsimple.c pth_simple_threads.c pth_simple_mutex.c \ + bt_everything.c bt_literal.c \ + pth_threadpool.c pth_specific.c pth_mutexspeed.c malloc3.c diff --git a/tests/malloc3.c b/tests/malloc3.c new file mode 100644 index 0000000000..896645c3eb --- /dev/null +++ b/tests/malloc3.c @@ -0,0 +1,32 @@ + +/* test of plausible behaviour with malloc and stupid args */ + +#include +#include + +int main ( void ) +{ + char* p; + + p = malloc(0); + printf("malloc(0) = %p\n", p); + free(p); + + p = malloc(-1); + printf("malloc(-1) = %p\n", p); + free(p); + + p = calloc(0,1); + printf("calloc(0,1) = %p\n", p); + free(p); + + p = calloc(0,-1); + printf("calloc(0,-1) = %p\n", p); + free(p); + + p = calloc(-1,-1); + printf("calloc(-1,-1) = %p\n", p); + free(p); + + return 0; +} -- 2.47.3