diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-10-07 07:14:02 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-10-07 07:14:51 +0200 |
commit | 46f08961a22ff7ffc6196971c0ff04006689ded1 (patch) | |
tree | eb35e0de8c9655be3bd7ed29bb07c95de91361f6 /testsuites/psxtests | |
parent | config: CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE (diff) | |
download | rtems-46f08961a22ff7ffc6196971c0ff04006689ded1.tar.bz2 |
psxrwlock01: Use an initilized lock for tests
Close #4738.
Diffstat (limited to 'testsuites/psxtests')
-rw-r--r-- | testsuites/psxtests/psxrwlock01/test.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/testsuites/psxtests/psxrwlock01/test.c b/testsuites/psxtests/psxrwlock01/test.c index 5767aa7c07..f6954007c0 100644 --- a/testsuites/psxtests/psxrwlock01/test.c +++ b/testsuites/psxtests/psxrwlock01/test.c @@ -454,10 +454,6 @@ int main( status = pthread_rwlock_timedrdlock( NULL, &abstime); rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_timedrdlock( &rwlock, NULL) -- EINVAL" ); - status = pthread_rwlock_timedrdlock( &rwlock, NULL); - rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_tryrdlock(NULL) -- EINVAL" ); status = pthread_rwlock_tryrdlock(NULL); rtems_test_assert( status == EINVAL ); @@ -470,10 +466,6 @@ int main( status = pthread_rwlock_timedwrlock( NULL, &abstime ); rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_timedwrlock( &rwlock, NULL) -- EINVAL" ); - status = pthread_rwlock_timedwrlock( &rwlock, NULL); - rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_trywrlock(NULL) -- EINVAL" ); status = pthread_rwlock_trywrlock(NULL); rtems_test_assert( status == EINVAL ); @@ -482,6 +474,26 @@ int main( status = pthread_rwlock_unlock(NULL); rtems_test_assert( status == EINVAL ); + status = pthread_rwlock_init( &rwlock, NULL ); + rtems_test_assert( status == 0 ); + + status = pthread_rwlock_wrlock( &rwlock ); + rtems_test_assert( status == 0 ); + + puts( "pthread_rwlock_timedrdlock( &rwlock, NULL) -- EINVAL" ); + status = pthread_rwlock_timedrdlock( &rwlock, NULL); + rtems_test_assert( status == EINVAL ); + + puts( "pthread_rwlock_timedwrlock( &rwlock, NULL) -- EINVAL" ); + status = pthread_rwlock_timedwrlock( &rwlock, NULL); + rtems_test_assert( status == EINVAL ); + + status = pthread_rwlock_unlock( &rwlock ); + rtems_test_assert( status == 0 ); + + status = pthread_rwlock_destroy( &rwlock ); + rtems_test_assert( status == 0 ); + /*************** BAD ID CHECK *****************/ /* make a valid abstime */ puts( "clock_gettime(CLOCK_REALTIME, &abstime) -- OK" ); |