From 2ef097640758653a0e9d63e90a4aac329cd86368 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 22 Feb 1999 02:54:12 +0000 Subject: 1999-02-23 Ross Johnson * Makefile: Some refinement. * *.c: More exhaustive checking through assertions; clean up; add some more tests. --- tests/exit3.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'tests/exit3.c') diff --git a/tests/exit3.c b/tests/exit3.c index f15b39d..b666624 100644 --- a/tests/exit3.c +++ b/tests/exit3.c @@ -4,8 +4,7 @@ * Depends on API functions: pthread_create(). */ -#include -#include +#include "test.h" void * func(void * arg) @@ -13,7 +12,7 @@ func(void * arg) pthread_exit(arg); /* Never reached. */ - return 0; + exit(1); } int @@ -25,11 +24,8 @@ main(int argc, char * argv[]) /* Create a few threads and then exit. */ for (i = 0; i < 4; i++) { - if (pthread_create(&id[i], NULL, func, (void *) i) != 0) - { - return 1; - } - } + assert(pthread_create(&id[i], NULL, func, (void *) i) == 0); + } /* Success. */ return 0; -- cgit v1.2.3