forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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>
|
2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* sp28/init.c: Add test code for task variables to improve coverage.
|
* sp28/init.c: Add test code for task variables to improve coverage.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* Output parameters: NONE
|
* Output parameters: NONE
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-2007.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -116,6 +116,11 @@ rtems_task Init(
|
|||||||
|
|
||||||
buffered_io_flush();
|
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 );
|
status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 );
|
||||||
directive_failed( status, "task_set_node of TA1" );
|
directive_failed( status, "task_set_node of TA1" );
|
||||||
printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
|
printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ TASK_START - TA2 - started
|
|||||||
TASK_START - TA3 - started
|
TASK_START - TA3 - started
|
||||||
TASK_START - TA4 - started
|
TASK_START - TA4 - started
|
||||||
TASK_RESTART - TA3 - restarted
|
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 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
|
INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 to TA2's priority: 04
|
||||||
<pause>
|
<pause>
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ rtems_task Task_1(
|
|||||||
rtems_status_code status;
|
rtems_status_code status;
|
||||||
rtems_task_priority the_priority;
|
rtems_task_priority the_priority;
|
||||||
rtems_task_priority previous_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();
|
rtems_test_pause();
|
||||||
|
|
||||||
@@ -42,7 +46,7 @@ rtems_task Task_1(
|
|||||||
);
|
);
|
||||||
|
|
||||||
while( FOREVER ) {
|
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" );
|
directive_failed( status, "rtems_task_get_note" );
|
||||||
printf(
|
printf(
|
||||||
"TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: %02d\n",
|
"TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: %02d\n",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Output parameters: NONE
|
* Output parameters: NONE
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-2007.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
void Screen2()
|
void Screen2()
|
||||||
{
|
{
|
||||||
rtems_time_of_day time;
|
rtems_time_of_day time;
|
||||||
|
rtems_interval interval;
|
||||||
|
struct timeval tv;
|
||||||
rtems_status_code status;
|
rtems_status_code status;
|
||||||
|
|
||||||
/* errors before clock is set */
|
/* errors before clock is set */
|
||||||
@@ -34,11 +36,48 @@ void Screen2()
|
|||||||
fatal_directive_status(
|
fatal_directive_status(
|
||||||
status,
|
status,
|
||||||
RTEMS_NOT_DEFINED,
|
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 );
|
status = rtems_task_wake_when( &time );
|
||||||
if ( status == RTEMS_SUCCESSFUL ) {
|
if ( status == RTEMS_SUCCESSFUL ) {
|
||||||
puts(
|
puts(
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ void Screen4()
|
|||||||
{
|
{
|
||||||
rtems_event_set event_out;
|
rtems_event_set event_out;
|
||||||
rtems_time_of_day time;
|
rtems_time_of_day time;
|
||||||
|
struct timeval tv;
|
||||||
|
time_t seconds;
|
||||||
rtems_status_code status;
|
rtems_status_code status;
|
||||||
|
|
||||||
status = rtems_event_receive(
|
status = rtems_event_receive(
|
||||||
@@ -81,4 +83,11 @@ void Screen4()
|
|||||||
status = rtems_clock_set( &time );
|
status = rtems_clock_set( &time );
|
||||||
directive_failed( status, "rtems_clock_set" );
|
directive_failed( status, "rtems_clock_set" );
|
||||||
puts( " - RTEMS_SUCCESSFUL" );
|
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) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ TA1 - rtems_task_start - RTEMS_INVALID_ID
|
|||||||
TA1 - rtems_task_start - RTEMS_INCORRECT_STATE
|
TA1 - rtems_task_start - RTEMS_INCORRECT_STATE
|
||||||
TA1 - rtems_task_suspend - RTEMS_INVALID_ID
|
TA1 - rtems_task_suspend - RTEMS_INVALID_ID
|
||||||
<pause - screen 2>
|
<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_task_wake_when - RTEMS_NOT_DEFINED
|
||||||
TA1 - rtems_timer_fire_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
|
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_event_send - RTEMS_INVALID_ID
|
||||||
TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL
|
TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL
|
||||||
TA1 - rtems_clock_set - 08:30:45 02/05/1988 - 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>
|
<pause - screen 5>
|
||||||
TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME
|
TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME
|
||||||
TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL
|
TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL
|
||||||
|
|||||||
Reference in New Issue
Block a user