[PATCH v3] updates #3889, Added test for timer_create() using CLOCK_MONOTONIC

Eshan Dhawan eshandhawan51 at gmail.com
Tue Apr 28 17:02:22 UTC 2020


Hello everyone,

I sent this patch to add test for POSIX timer_create for
clock_id argument as CLOCK_MONOTONIC.
Other details are in the commit message.
If you all could review it.

thanks
-Eshan


On Mon, Apr 20, 2020 at 12:00 AM Eshan dhawan <eshandhawan51 at gmail.com>
wrote:

> >I will create a timer using timer_create() function,
> and passing CLOCK_MONOTONIC in clock_id argument.
>
> >The test will fail as there is no support for
> CLOCK_MONOTONIC in cpukit/posix/src/psxtimercreate.c.
>
> >The added code compiles successfully without any errors.
>
> Signed-off-by: Eshan dhawan <eshandhawan51 at gmail.com>
> ---
>  testsuites/psxtests/psxtimer02/psxtimer.c     | 8 ++++++--
>  testsuites/psxtests/psxtimer02/psxtimer02.scn | 3 ++-
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/testsuites/psxtests/psxtimer02/psxtimer.c
> b/testsuites/psxtests/psxtimer02/psxtimer.c
> index 9f79d33c42..e071f98857 100644
> --- a/testsuites/psxtests/psxtimer02/psxtimer.c
> +++ b/testsuites/psxtests/psxtimer02/psxtimer.c
> @@ -62,9 +62,9 @@ void *POSIX_Init (
>    status = timer_create( CLOCK_REALTIME, &event, NULL );
>    fatal_posix_service_status_errno( status, EINVAL, "bad timer id" );
>
> -  puts( "timer_create - OK" );
> +  puts( "timer_create (CLOCK_REALTIME) - OK" );
>    status = timer_create( CLOCK_REALTIME, NULL, &timer );
> -  posix_service_failed( status, "timer_create OK" );
> +  posix_service_failed( status, "timer_create (CLOCK_REALTIME)" );
>
>    puts( "timer_create - too many - EAGAIN" );
>    status = timer_create( CLOCK_REALTIME, NULL, &timer1 );
> @@ -127,6 +127,10 @@ void *POSIX_Init (
>    status = timer_delete( timer );
>    fatal_posix_service_status_errno( status, EINVAL, "bad id" );
>
> +  puts( "timer_create (CLOCK_MONOTONIC) - OK" );
> +  status = timer_create( CLOCK_MONOTONIC, NULL, &timer );
> +  posix_service_failed( status, "timer_create (CLOCK_MONOTONIC)" );
> +
>    TEST_END();
>    rtems_test_exit (0);
>  }
> diff --git a/testsuites/psxtests/psxtimer02/psxtimer02.scn
> b/testsuites/psxtests/psxtimer02/psxtimer02.scn
> index e78425a32e..7429bcf291 100644
> --- a/testsuites/psxtests/psxtimer02/psxtimer02.scn
> +++ b/testsuites/psxtests/psxtimer02/psxtimer02.scn
> @@ -1,7 +1,7 @@
>  *** POSIX Timers Test 02 ***
>  timer_create - bad clock id - EINVAL
>  timer_create - bad timer id pointer - EINVAL
> -timer_create - OK
> +timer_create (CLOCK_REALTIME) - OK
>  timer_create - too many - EAGAIN
>  timer_delete - bad id - EINVAL
>  timer_getoverrun - bad id - EINVAL
> @@ -13,4 +13,5 @@ timer_settime - bad itimer value - negative nanosecond -
> EINVAL
>  timer_settime - bad clock value - EINVAL
>  timer_delete - OK
>  timer_delete - bad id - EINVAL
> +timer_create (CLOCK_MONOTONIC) - OK
>  *** END OF POSIX Timers Test 02 ***
> --
> 2.17.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200428/dd3ad171/attachment.html>


More information about the devel mailing list