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

2020-06-06 Thread Joel Sherrill
Thanks for the patch.  Sorry this slipped through for so long without
such simple feedback.

First, there is a ticket for this: https://devel.rtems.org/ticket/3889 which
should be referenced.

Second, although the ticket just mentions timer_create, the capabilities
(e.g. user use case)
not exercised is that the created timer works correctly and is actually
based on
CLOCK_MONOTONIC. There are existing tests for CLOCK_REALTIME which should be
a good basis for what positive functionality is expected of a timer based
on
CLOCK_MONOTONIC.

--joel

On Sun, Apr 19, 2020 at 1:30 PM Eshan dhawan 
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 
> ---
>  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, , 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,  );
> -  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,  );
> @@ -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,  );
> +  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
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2020-04-28 Thread Eshan Dhawan
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 
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 
> ---
>  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, , 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,  );
> -  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,  );
> @@ -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,  );
> +  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
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2020-04-19 Thread Eshan dhawan
>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 
---
 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, , 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,  );
-  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,  );
@@ -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,  );
+  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

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel