[rtems commit] psxrwlock01: Use an initilized lock for tests

Joel Sherrill joel.sherrill at gmail.com
Fri Oct 7 13:36:31 UTC 2022


I think the ticket was targeting 5 as the milestone. You should push this
to 5 also if it applies.

On Fri, Oct 7, 2022, 12:15 AM Sebastian Huber <sebh at rtems.org> wrote:

> Module:    rtems
> Branch:    master
> Commit:    46f08961a22ff7ffc6196971c0ff04006689ded1
> Changeset:
> http://git.rtems.org/rtems/commit/?id=46f08961a22ff7ffc6196971c0ff04006689ded1
>
> Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
> Date:      Fri Oct  7 07:14:02 2022 +0200
>
> psxrwlock01: Use an initilized lock for tests
>
> Close #4738.
>
> ---
>
>  testsuites/psxtests/psxrwlock01/test.c | 28 ++++++++++++++++++++--------
>  1 file 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" );
>
> _______________________________________________
> vc mailing list
> vc at rtems.org
> http://lists.rtems.org/mailman/listinfo/vc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20221007/b7f261fe/attachment.htm>


More information about the devel mailing list