diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-13 21:45:23 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-13 21:45:23 +0000 |
commit | 9c691efcf40135d1b875515b25108f8cf4ed8ee7 (patch) | |
tree | 1551d8e41fcf872916d2452681fc384128e299d3 /testsuites/sptests | |
parent | 2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-9c691efcf40135d1b875515b25108f8cf4ed8ee7.tar.bz2 |
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp07/init.c, sp07/sp07.scn, sp07/task1.c: Add tests for
using notepad with the current task's ID or SELF
* sp09/screen02.c, sp09/screen04.c, sp09/sp09.scn: Add
test missing test cases for clock_get.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r-- | testsuites/sptests/ChangeLog | 7 | ||||
-rw-r--r-- | testsuites/sptests/sp07/init.c | 7 | ||||
-rw-r--r-- | testsuites/sptests/sp07/sp07.scn | 9 | ||||
-rw-r--r-- | testsuites/sptests/sp07/task1.c | 6 | ||||
-rw-r--r-- | testsuites/sptests/sp09/screen02.c | 45 | ||||
-rw-r--r-- | testsuites/sptests/sp09/screen04.c | 9 | ||||
-rw-r--r-- | testsuites/sptests/sp09/sp09.scn | 6 |
7 files changed, 79 insertions, 10 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index d532c7a10c..1f0cf8bcfc 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,10 @@ +2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> + + * sp07/init.c, sp07/sp07.scn, sp07/task1.c: Add tests for + using notepad with the current task's ID or SELF + * sp09/screen02.c, sp09/screen04.c, sp09/sp09.scn: Add + test missing test cases for clock_get. + 2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com> * sp28/init.c: Add test code for task variables to improve coverage. diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c index 4913d07558..5339a196fe 100644 --- a/testsuites/sptests/sp07/init.c +++ b/testsuites/sptests/sp07/init.c @@ -11,7 +11,7 @@ * * Output parameters: NONE * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -116,6 +116,11 @@ rtems_task Init( buffered_io_flush(); + status = rtems_task_set_note( RTEMS_SELF, RTEMS_NOTEPAD_4, 32 ); + directive_failed( status, "task_set_node of Self" ); + printf( "INIT - rtems_task_set_note - set my RTEMS_NOTEPAD_4 " ); + puts ( "to TA1's priority: 04" ); + status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 ); directive_failed( status, "task_set_node of TA1" ); printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " ); diff --git a/testsuites/sptests/sp07/sp07.scn b/testsuites/sptests/sp07/sp07.scn index 015f72cbb6..1b6ec9e3b6 100644 --- a/testsuites/sptests/sp07/sp07.scn +++ b/testsuites/sptests/sp07/sp07.scn @@ -8,6 +8,7 @@ TASK_START - TA2 - started TASK_START - TA3 - started TASK_START - TA4 - started TASK_RESTART - TA3 - restarted +INIT - rtems_task_set_note - set my RTEMS_NOTEPAD_4 to TA1's priority: 04 INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 to TA1's priority: 04 INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 to TA2's priority: 04 <pause> @@ -24,9 +25,9 @@ TA1 - rtems_task_set_priority - set TA2's priority: 01 TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 01 TA2 - rtems_task_suspend - suspend TA1 TA2 - rtems_task_set_priority - set priority of TA1 ( blocked ) -TASK_DELETE - TA2 TASK_DELETEdeleting - TA1 -TASK_DELETE - TA2 TASK_DELETEdeleting - TA3 -TASK_DELETE - TA2 TASK_DELETEdeleting - TA2 +TASK_DELETE - TA2 TASK_DELETEdeleting - TA1 +TASK_DELETE - TA2 TASK_DELETEdeleting - TA3 +TASK_DELETE - TA2 TASK_DELETEdeleting - TA2 TA4 - exitting task -RTEMS_TASK_EXITTED - extension invoked for TA4 +RTEMS_TASK_EXITTED - extension invoked for TA4 *** END OF TEST 7 *** diff --git a/testsuites/sptests/sp07/task1.c b/testsuites/sptests/sp07/task1.c index e5c0a950dd..651e63b4e0 100644 --- a/testsuites/sptests/sp07/task1.c +++ b/testsuites/sptests/sp07/task1.c @@ -27,6 +27,10 @@ rtems_task Task_1( rtems_status_code status; rtems_task_priority the_priority; rtems_task_priority previous_priority; + rtems_id my_id; + + /* XXX really need a Classic API service for this */ + my_id = _Thread_Executing->Object.id; rtems_test_pause(); @@ -42,7 +46,7 @@ rtems_task Task_1( ); while( FOREVER ) { - status = rtems_task_get_note( _Thread_Executing->Object.id, RTEMS_NOTEPAD_8, &the_priority ); + status = rtems_task_get_note( my_id, RTEMS_NOTEPAD_8, &the_priority ); directive_failed( status, "rtems_task_get_note" ); printf( "TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: %02d\n", diff --git a/testsuites/sptests/sp09/screen02.c b/testsuites/sptests/sp09/screen02.c index a7d0dcd029..648007b4e2 100644 --- a/testsuites/sptests/sp09/screen02.c +++ b/testsuites/sptests/sp09/screen02.c @@ -6,7 +6,7 @@ * * Output parameters: NONE * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +21,8 @@ void Screen2() { rtems_time_of_day time; + rtems_interval interval; + struct timeval tv; rtems_status_code status; /* errors before clock is set */ @@ -34,11 +36,48 @@ void Screen2() fatal_directive_status( status, RTEMS_NOT_DEFINED, - "rtems_clock_get before clock is set" + "rtems_clock_get before clock is set #1" ); - puts( "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED" ); + puts( "TA1 - rtems_clock_get - TOD - RTEMS_NOT_DEFINED" ); } + status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &interval ); + if ( status == RTEMS_SUCCESSFUL ) { + puts( + "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?" + ); + } else { + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_clock_get before clock is set #2" + ); + puts( "TA1 - rtems_clock_get - SECONDS SINCE EPOCH - RTEMS_NOT_DEFINED" ); + } + + status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &tv ); + if ( status == RTEMS_SUCCESSFUL ) { + puts( + "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?" + ); + } else { + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_clock_get before clock is set #3" + ); + puts( "TA1 - rtems_clock_get - TIME VALUE - RTEMS_NOT_DEFINED" ); + } + + /* arbitrary bad value for switch */ + status = rtems_clock_get( 0x100, &tv ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_clock_get bad case" + ); + puts( "TA1 - rtems_clock_get - RTEMS_INVALID_NUMBER" ); + status = rtems_task_wake_when( &time ); if ( status == RTEMS_SUCCESSFUL ) { puts( diff --git a/testsuites/sptests/sp09/screen04.c b/testsuites/sptests/sp09/screen04.c index f9021b55ce..ac9bca0a7e 100644 --- a/testsuites/sptests/sp09/screen04.c +++ b/testsuites/sptests/sp09/screen04.c @@ -22,6 +22,8 @@ void Screen4() { rtems_event_set event_out; rtems_time_of_day time; + struct timeval tv; + time_t seconds; rtems_status_code status; status = rtems_event_receive( @@ -81,4 +83,11 @@ void Screen4() status = rtems_clock_set( &time ); directive_failed( status, "rtems_clock_set" ); puts( " - RTEMS_SUCCESSFUL" ); + + status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &tv ); + directive_failed( status, "clock_get time value OK" ); + + seconds = tv.tv_sec; + printf( "TA1 - current time - %s\n", ctime(&seconds) ); + } diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn index 15d1946f26..74a2a1c542 100644 --- a/testsuites/sptests/sp09/sp09.scn +++ b/testsuites/sptests/sp09/sp09.scn @@ -21,7 +21,10 @@ TA1 - rtems_task_start - RTEMS_INVALID_ID TA1 - rtems_task_start - RTEMS_INCORRECT_STATE TA1 - rtems_task_suspend - RTEMS_INVALID_ID <pause - screen 2> -TA1 - rtems_clock_get - RTEMS_NOT_DEFINED +TA1 - rtems_clock_get - TOD - RTEMS_NOT_DEFINED +TA1 - rtems_clock_get - SECONDS SINCE EPOCH - RTEMS_NOT_DEFINED +TA1 - rtems_clock_get - TIME VALUE - RTEMS_NOT_DEFINED +TA1 - rtems_clock_get - RTEMS_INVALID_NUMBER TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED TA1 - rtems_clock_set - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK @@ -63,6 +66,7 @@ TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT TA1 - rtems_event_send - RTEMS_INVALID_ID TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL +TA1 - current time - Fri Feb 5 08:30:45 1988 <pause - screen 5> TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL |