From 06134db0038580fd77e73d66ed1b8bd20900f57f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 2 Jul 2005 15:35:02 +0000 Subject: exit according to how many tests failed --- test/malloc/malloc.c | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) (limited to 'test') diff --git a/test/malloc/malloc.c b/test/malloc/malloc.c index 1cea31986..d63856845 100644 --- a/test/malloc/malloc.c +++ b/test/malloc/malloc.c @@ -11,61 +11,71 @@ #define random_size() (random()%MAX_SIZE) #define random_ptr() (random()%N_PTRS) -void test1(void); -void test2(void); +int test1(void); +int test2(void); -int main(int argc,char *argv[]) +int main(int argc, char *argv[]) { - test1(); - test2(); - return 0; + return test1() + test2(); } -void test1(void) +int test1(void) { void **ptrs; int i,j; int size; + int ret = 0; srandom(0x19730929); ptrs = malloc(N_PTRS*sizeof(void *)); - for(i=0;i