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/create1.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/create1.c')
-rw-r--r-- | tests/create1.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/create1.c b/tests/create1.c index 2741401..192e52d 100644 --- a/tests/create1.c +++ b/tests/create1.c @@ -1,9 +1,19 @@ -#include <pthread.h> -#include <stdio.h> -#include <windows.h> +/* + * create1.c + * + * Description: + * Create a thread and check that it ran. + * + * Depends on API functions: None. + */ + +#include "test.h" + +static int washere = 0; void * func(void * arg) { + washere = 1; return 0; } @@ -11,14 +21,14 @@ int main() { pthread_t t; - if (pthread_create(&t, NULL, func, NULL) != 0) - { - return 1; - } + + assert(pthread_create(&t, NULL, func, NULL) == 0); /* A dirty hack, but we cannot rely on pthread_join in this primitive test. */ - Sleep(5000); + Sleep(2000); + + assert(washere == 1); return 0; } |