diff options
author | rpj <rpj> | 2002-06-04 15:15:11 +0000 |
---|---|---|
committer | rpj <rpj> | 2002-06-04 15:15:11 +0000 |
commit | 5c1bda8e72572064653230f4fcbdf0d5df627085 (patch) | |
tree | 5793cfcd057375e46c5d38c07f202232b2590bdc /tests/semaphore2.c | |
parent | 7e2e924362df5556ff55ee7e1b8738a05d067ec4 (diff) |
*** empty log message ***
Diffstat (limited to 'tests/semaphore2.c')
-rw-r--r-- | tests/semaphore2.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/semaphore2.c b/tests/semaphore2.c index 133443c..855662f 100644 --- a/tests/semaphore2.c +++ b/tests/semaphore2.c @@ -46,13 +46,13 @@ * - * * Cases Tested: - * - + * - * * Description: - * - + * - * * Environment: - * - + * - * * Input: * - None. @@ -62,7 +62,7 @@ * - No output on success. * * Assumptions: - * - + * - * * Pass Criteria: * - Process returns zero exit status. @@ -73,30 +73,33 @@ #include "test.h" -#define BIG_NUM 10000 +#define MAX_COUNT 100000 int main() { sem_t s; int value = 0; - int result; + int i; - assert(sem_init(&s, PTHREAD_PROCESS_PRIVATE, BIG_NUM) == 0); - assert((result = sem_getvalue(&s, &value)) == 0); - assert(value == BIG_NUM); + assert(sem_init(&s, PTHREAD_PROCESS_PRIVATE, MAX_COUNT) == 0); + assert(sem_getvalue(&s, &value) == 0); + assert(value == MAX_COUNT); +// printf("Value = %ld\n", value); - for (i = BIG_NUM - 1; i >= 0; i--) + for (i = MAX_COUNT - 1; i >= 0; i--) { assert(sem_wait(&s) == 0); - assert((result = sem_getvalue(&s, &value)) == 0); + assert(sem_getvalue(&s, &value) == 0); +// printf("Value = %ld\n", value); assert(value == i); } - for (i = 1; i <= BIG_NUM; i--) + for (i = 1; i <= MAX_COUNT; i++) { assert(sem_post(&s) == 0); - assert((result = sem_getvalue(&s, &value)) == 0); + assert(sem_getvalue(&s, &value) == 0); +// printf("Value = %ld\n", value); assert(value == i); } |