forked from Imagelibrary/rtems
@@ -54,17 +54,51 @@ static void *POSIX_Init (
|
||||
timer_t timer;
|
||||
|
||||
/*
|
||||
* If these are not filled in correctly, we don't pass its error checking.
|
||||
* If these are not filled in correctly, we do not execute pass the
|
||||
* error checking for a NULL event pointer.
|
||||
*/
|
||||
event.sigev_notify = SIGEV_SIGNAL;
|
||||
event.sigev_signo = SIGUSR1;
|
||||
|
||||
TEST_BEGIN();
|
||||
|
||||
/*
|
||||
* When FACE timer behavior is configured, creating a POSIX timer
|
||||
* using CLOCK_REALTIME is not allowed.
|
||||
*/
|
||||
puts( "timer_create - CLOCK_REALTIME forbidden - EPERM" );
|
||||
status = timer_create( CLOCK_REALTIME, &event, &timer );
|
||||
fatal_posix_service_status_errno( status, EPERM, "not allowed" );
|
||||
|
||||
/*
|
||||
* When FACE timer behavior is configured, creating a POSIX timer
|
||||
* on a value other than CLOCK_REALTIME or CLOCK_MONOTONIC is not allowed.
|
||||
*/
|
||||
puts( "timer_create - CLOCK_PROCESS_CPUTIME_ID not allowed - EINVAL" );
|
||||
status = timer_create( CLOCK_PROCESS_CPUTIME_ID, &event, &timer );
|
||||
fatal_posix_service_status_errno( status, EINVAL, "invalid clock" );
|
||||
|
||||
/*
|
||||
* When FACE timer behavior is configured, creating a POSIX timer
|
||||
* on CLOCK_MONOTONIC allowed.
|
||||
*/
|
||||
puts( "timer_create - OK" );
|
||||
status = timer_create( CLOCK_MONOTONIC, &event, &timer );
|
||||
posix_service_failed( status, "timer_create OK" );
|
||||
|
||||
/*
|
||||
* Delete the previously created timer.
|
||||
*/
|
||||
puts( "timer_delete - OK" );
|
||||
status = timer_delete( timer );
|
||||
posix_service_failed( status, "timer_delete ok" );
|
||||
|
||||
/*
|
||||
*/
|
||||
puts( "timer_create - CLOCK_MONOTONIC is allowed - OK" );
|
||||
status = timer_create( CLOCK_MONOTONIC, &event, &timer );
|
||||
posix_service_failed( status, "timer_create ok" );
|
||||
|
||||
TEST_END();
|
||||
rtems_test_exit (0);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,14 @@ directives:
|
||||
concepts:
|
||||
|
||||
+ This test exercises the CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR configure
|
||||
option which alters the behavior of timer_create().
|
||||
option which alters the behavior of timer_create().
|
||||
|
||||
- With CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR defined, timer_create()
|
||||
returns EPERM to indicate this is not allowed.
|
||||
|
||||
- With CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR defined, timer_create()
|
||||
for CLOCK_MONOTONIC is allowed.
|
||||
|
||||
- With CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR defined, timer_create()
|
||||
for any other clock value is an error.
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
*** BEGIN OF TEST PSXTIMER 2 ***
|
||||
*** TEST VERSION: 6.0.0.1c6ac88f938f4b135f3bbffc4b19bbc540508c80
|
||||
*** END OF TEST PSXTIMER 2 ***
|
||||
|
||||
*** BEGIN OF TEST FACE 1 ***
|
||||
timer_create - CLOCK_REALTIME forbidden - EPERM
|
||||
timer_create - CLOCK_PROCESS_CPUTIME_ID not allowed - EINVAL
|
||||
timer_create - OK
|
||||
timer_delete - OK
|
||||
*** END OF TEST PSXTIMER FACE 1 ***
|
||||
|
||||
Reference in New Issue
Block a user