summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxrwlock01
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-04 20:26:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-04 20:26:18 +0000
commitc6dc6db0743f49b765ac2d67e2734a0e27efb5f4 (patch)
treee8c232faba1a9754e987328449d019b9ff3d13c5 /testsuites/psxtests/psxrwlock01
parent2009-07-04 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-c6dc6db0743f49b765ac2d67e2734a0e27efb5f4.tar.bz2
2009-07-04 Santosh G Vattam <vattam.santosh@gmail.com>
* psxrwlock01/psxrwlock01.scn, psxrwlock01/test.c: Add test case for obtaining an rwlock and then releasing it twice.
Diffstat (limited to 'testsuites/psxtests/psxrwlock01')
-rw-r--r--testsuites/psxtests/psxrwlock01/psxrwlock01.scn3
-rw-r--r--testsuites/psxtests/psxrwlock01/test.c14
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxrwlock01/psxrwlock01.scn b/testsuites/psxtests/psxrwlock01/psxrwlock01.scn
index 4a4c7d05a8..578c5f54c7 100644
--- a/testsuites/psxtests/psxrwlock01/psxrwlock01.scn
+++ b/testsuites/psxtests/psxrwlock01/psxrwlock01.scn
@@ -79,4 +79,7 @@ pthread_rwlock_timedwrlock( &RWLock, &abstime) -- ETIMEDOUT
pthread_rwlock_timedrdlock( &RWLock, &abstime) -- in past -- OK
pthread_rwlock_timedwrlock( &RWLock, &abstime) -- in past -- OK
pthread_rwlock_destroy( &RWLock ) -- OK
+pthread_rwlock_init( &rwlock, NULL ) -- OK
+pthread_rwlock_unlock ( &rwlock ) -- OK
+pthread_rwlock_unlock ( &rwlock ) -- OK
*** END OF POSIX RWLOCK TEST 01 ***
diff --git a/testsuites/psxtests/psxrwlock01/test.c b/testsuites/psxtests/psxrwlock01/test.c
index 404385e9a3..fa5a92bc1b 100644
--- a/testsuites/psxtests/psxrwlock01/test.c
+++ b/testsuites/psxtests/psxrwlock01/test.c
@@ -407,6 +407,20 @@ int main(
status = pthread_rwlock_destroy( &RWLock );
assert( status == 0 );
+ /*************** OBTAIN A LOCK AND THEN RELEASE IT TWICE ***************/
+
+ puts( "pthread_rwlock_init( &rwlock, NULL ) -- OK" );
+ status = pthread_rwlock_init( &rwlock, NULL );
+ assert( status == 0 );
+ assert( rwlock != 0 );
+
+ puts( "pthread_rwlock_unlock ( &rwlock ) -- OK" );
+ status = pthread_rwlock_unlock( &rwlock );
+ assert( status == 0 );
+
+ puts( "pthread_rwlock_unlock ( &rwlock ) -- OK" );
+ status = pthread_rwlock_unlock( &rwlock );
+ assert( status == 0 );
/*************** END OF TEST *****************/
puts( "*** END OF POSIX RWLOCK TEST 01 ***" );