diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 54ce74d8e3..9055a0dd67 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,8 @@ +2009-05-17 Joel Sherrill + + * psxrwlock01/psxrwlock01.scn, psxrwlock01/test.c: Add test case for + NULL attribute pointer on init. + 2009-05-17 Joel Sherrill * psxsem01/Makefile.am, psxsem01/init.c, psxsem01/psxsem01.scn, diff --git a/testsuites/psxtests/psxrwlock01/psxrwlock01.scn b/testsuites/psxtests/psxrwlock01/psxrwlock01.scn index 981020f0ca..5155dcbbb1 100644 --- a/testsuites/psxtests/psxrwlock01/psxrwlock01.scn +++ b/testsuites/psxtests/psxrwlock01/psxrwlock01.scn @@ -39,6 +39,8 @@ pthread_rwlockattr_init( &attr ) -- OK pthread_rwlock_init( &rwlock, &attr ) -- OK pthread_rwlock_init( &rwlock, &attr ) -- EAGAIN pthread_rwlock_destroy( &rwlock ) -- OK +pthread_rwlock_init( &rwlock, NULL ) -- OK +pthread_rwlock_destroy( &rwlock ) -- OK pthread_rwlock_init( &RWLock, &attr ) -- OK pthread_rwlock_tryrdlock(RWLock) -- OK Init: pthread_create - thread 1 OK diff --git a/testsuites/psxtests/psxrwlock01/test.c b/testsuites/psxtests/psxrwlock01/test.c index 270e512a55..a03e032235 100644 --- a/testsuites/psxtests/psxrwlock01/test.c +++ b/testsuites/psxtests/psxrwlock01/test.c @@ -274,6 +274,15 @@ int main( status = pthread_rwlock_destroy( &rwlock ); assert( status == 0 ); + /********* CREATE RWLOCK WITH DEFAULT ATTRIBUTES AND DESTROY IT *********/ + puts( "pthread_rwlock_init( &rwlock, NULL ) -- OK" ); + status = pthread_rwlock_init( &rwlock, NULL ); + assert( status == 0 ); + + puts( "pthread_rwlock_destroy( &rwlock ) -- OK" ); + status = pthread_rwlock_destroy( &rwlock ); + assert( status == 0 ); + /*************** CREATE THREADS AND LET THEM OBTAIN READLOCK ***************/ puts( "pthread_rwlock_init( &RWLock, &attr ) -- OK" ); status = pthread_rwlock_init( &RWLock, &attr );