diff options
author | rpj <rpj> | 1999-02-22 02:54:12 +0000 |
---|---|---|
committer | rpj <rpj> | 1999-02-22 02:54:12 +0000 |
commit | 2ef097640758653a0e9d63e90a4aac329cd86368 (patch) | |
tree | 71751f699b0aedba3227446ac228d30f2a127173 /tests/exit3.c | |
parent | 943bc9bb02212649a83ec32152299d50d34226e6 (diff) |
1999-02-23 Ross Johnson <rpj@ise.canberra.edu.au>
* Makefile: Some refinement.
* *.c: More exhaustive checking through assertions; clean up;
add some more tests.
Diffstat (limited to 'tests/exit3.c')
-rw-r--r-- | tests/exit3.c | 12 |
1 files changed, 4 insertions, 8 deletions
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 <pthread.h> -#include <stdio.h> +#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; |