Changeset 46f08961 in rtems


Ignore:
Timestamp:
10/07/22 05:14:02 (2 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
40eb58f
Parents:
0a9ba963
git-author:
Sebastian Huber <sebastian.huber@…> (10/07/22 05:14:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/07/22 05:14:51)
Message:

psxrwlock01: Use an initilized lock for tests

Close #4738.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxrwlock01/test.c

    r0a9ba963 r46f08961  
    455455  rtems_test_assert( status == EINVAL );
    456456
     457  puts( "pthread_rwlock_tryrdlock(NULL) -- EINVAL" );
     458  status = pthread_rwlock_tryrdlock(NULL);
     459  rtems_test_assert( status == EINVAL );
     460
     461  puts( "pthread_rwlock_wrlock(NULL) -- EINVAL" );
     462  status = pthread_rwlock_wrlock(NULL);
     463  rtems_test_assert( status == EINVAL );
     464
     465  puts( "pthread_rwlock_timedwrlock( NULL, &abstime) -- EINVAL" );
     466  status = pthread_rwlock_timedwrlock( NULL, &abstime );
     467  rtems_test_assert( status == EINVAL );
     468
     469  puts( "pthread_rwlock_trywrlock(NULL) -- EINVAL" );
     470  status = pthread_rwlock_trywrlock(NULL);
     471  rtems_test_assert( status == EINVAL );
     472
     473  puts( "pthread_rwlock_unlock(NULL) -- EINVAL" );
     474  status = pthread_rwlock_unlock(NULL);
     475  rtems_test_assert( status == EINVAL );
     476
     477  status = pthread_rwlock_init( &rwlock, NULL );
     478  rtems_test_assert( status == 0 );
     479
     480  status = pthread_rwlock_wrlock( &rwlock );
     481  rtems_test_assert( status == 0 );
     482
    457483  puts( "pthread_rwlock_timedrdlock( &rwlock, NULL) -- EINVAL" );
    458484  status = pthread_rwlock_timedrdlock( &rwlock, NULL);
    459485  rtems_test_assert( status == EINVAL );
    460486
    461   puts( "pthread_rwlock_tryrdlock(NULL) -- EINVAL" );
    462   status = pthread_rwlock_tryrdlock(NULL);
    463   rtems_test_assert( status == EINVAL );
    464 
    465   puts( "pthread_rwlock_wrlock(NULL) -- EINVAL" );
    466   status = pthread_rwlock_wrlock(NULL);
    467   rtems_test_assert( status == EINVAL );
    468 
    469   puts( "pthread_rwlock_timedwrlock( NULL, &abstime) -- EINVAL" );
    470   status = pthread_rwlock_timedwrlock( NULL, &abstime );
    471   rtems_test_assert( status == EINVAL );
    472 
    473487  puts( "pthread_rwlock_timedwrlock( &rwlock, NULL) -- EINVAL" );
    474488  status = pthread_rwlock_timedwrlock( &rwlock, NULL);
    475489  rtems_test_assert( status == EINVAL );
    476490
    477   puts( "pthread_rwlock_trywrlock(NULL) -- EINVAL" );
    478   status = pthread_rwlock_trywrlock(NULL);
    479   rtems_test_assert( status == EINVAL );
    480 
    481   puts( "pthread_rwlock_unlock(NULL) -- EINVAL" );
    482   status = pthread_rwlock_unlock(NULL);
    483   rtems_test_assert( status == EINVAL );
     491  status = pthread_rwlock_unlock( &rwlock );
     492  rtems_test_assert( status == 0 );
     493
     494  status = pthread_rwlock_destroy( &rwlock );
     495  rtems_test_assert( status == 0 );
    484496
    485497  /*************** BAD ID CHECK *****************/
Note: See TracChangeset for help on using the changeset viewer.