summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxrwlock01/test.c
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/test.c
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/test.c')
-rw-r--r--testsuites/psxtests/psxrwlock01/test.c14
1 files changed, 14 insertions, 0 deletions
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 ***" );