From fda395f82481595d0a1aac47e8dc70cabe17dd7e Mon Sep 17 00:00:00 2001 From: Marco S Hyman Date: Sat, 3 Nov 2001 04:33:49 +0000 Subject: Fix pthread_mutex regression test... undefined behavior does not mean != EPERM in one test, minor changes to recursive mutex test. remove printf in signal test signal handler, run test long enough to ensure signal hander is called at least twice, reduce output. Note: running these tests over a remote console may indicate bogus falures due to console output latency. Any test that takes longer than 5 seconds to complete may be flagged as a failure. --- regress/lib/libpthread/pthread_mutex/pthread_mutex.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'regress/lib/libpthread/pthread_mutex') diff --git a/regress/lib/libpthread/pthread_mutex/pthread_mutex.c b/regress/lib/libpthread/pthread_mutex/pthread_mutex.c index 3dd62129035..311688d0259 100644 --- a/regress/lib/libpthread/pthread_mutex/pthread_mutex.c +++ b/regress/lib/libpthread/pthread_mutex/pthread_mutex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread_mutex.c,v 1.2 2001/09/20 16:43:15 todd Exp $ */ +/* $OpenBSD: pthread_mutex.c,v 1.3 2001/11/03 04:33:48 marc Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -109,7 +109,7 @@ test_debug_double_unlock(mutex) CHECKr(pthread_mutex_lock(mutex)); CHECKr(pthread_mutex_unlock(mutex)); /* Posix D10 says undefined behaviour? */ - ASSERTe(pthread_mutex_unlock(mutex), != EPERM); + ASSERTe(pthread_mutex_unlock(mutex), != 0); } void @@ -167,6 +167,7 @@ test_mutex_recursive() pthread_mutexattr_t mutex_recursive_attr; pthread_mutex_t mutex_recursive; int i; + int j = 9; printf("test_mutex_recursive()\n"); CHECKr(pthread_mutexattr_init(&mutex_recursive_attr)); @@ -175,13 +176,14 @@ test_mutex_recursive() CHECKr(pthread_mutex_init(&mutex_recursive, &mutex_recursive_attr)); CHECKr(pthread_mutex_lock(&mutex_recursive)); - for (i = 0; i < 9; i++) + for (i = 0; i < j; i++) CHECKr(pthread_mutex_lock(&mutex_recursive)); - for (i = 0; i < 9; i++) + for (i = 0; i < j; i++) CHECKr(pthread_mutex_unlock(&mutex_recursive)); CHECKr(pthread_mutex_unlock(&mutex_recursive)); /* Posix D10 says undefined behaviour? */ ASSERTe(pthread_mutex_unlock(&mutex_recursive), != 0); + CHECKr(pthread_mutex_destroy(&mutex_recursive)); } int -- cgit v1.2.3