From 300fe1c6e05818e988e3b995985e0b411c3d9406 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 11 Jun 2011 19:26:41 +0000 Subject: 2011-06-11 Joel Sherrill * sp01/init.c, sp01/sp01.doc, sp01/system.h, sp01/task1.c, sp02/init.c, sp02/preempt.c, sp02/sp02.doc, sp02/system.h, sp02/task1.c, sp02/task2.c, sp02/task3.c, sp03/init.c, sp03/sp03.doc, sp03/system.h, sp03/task1.c, sp03/task2.c: Clean up. Update. --- testsuites/sptests/ChangeLog | 7 ++++ testsuites/sptests/sp01/init.c | 71 ++++++++++++++-------------------- testsuites/sptests/sp01/sp01.doc | 44 ++++++++++----------- testsuites/sptests/sp01/system.h | 11 +----- testsuites/sptests/sp01/task1.c | 25 ++++-------- testsuites/sptests/sp02/init.c | 81 ++++++++++++++++----------------------- testsuites/sptests/sp02/preempt.c | 12 +----- testsuites/sptests/sp02/sp02.doc | 37 +++++++++--------- testsuites/sptests/sp02/system.h | 11 +----- testsuites/sptests/sp02/task1.c | 23 +++++------ testsuites/sptests/sp02/task2.c | 14 +------ testsuites/sptests/sp02/task3.c | 13 +------ testsuites/sptests/sp03/init.c | 52 +++++++++---------------- testsuites/sptests/sp03/sp03.doc | 18 ++++++--- testsuites/sptests/sp03/system.h | 12 +----- testsuites/sptests/sp03/task1.c | 23 +++++------ testsuites/sptests/sp03/task2.c | 19 ++++----- 17 files changed, 184 insertions(+), 289 deletions(-) (limited to 'testsuites') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index b91babaebc..6c0d89fb17 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,10 @@ +2011-06-11 Joel Sherrill + + * sp01/init.c, sp01/sp01.doc, sp01/system.h, sp01/task1.c, sp02/init.c, + sp02/preempt.c, sp02/sp02.doc, sp02/system.h, sp02/task1.c, + sp02/task2.c, sp02/task3.c, sp03/init.c, sp03/sp03.doc, + sp03/system.h, sp03/task1.c, sp03/task2.c: Clean up. Update. + 2011-06-11 Joel Sherrill * sp09/screen02.c, sp09/screen13.c, sp09/sp09.scn, sp29/init.c, diff --git a/testsuites/sptests/sp01/init.c b/testsuites/sptests/sp01/init.c index dacf510b71..55908dbfc4 100644 --- a/testsuites/sptests/sp01/init.c +++ b/testsuites/sptests/sp01/init.c @@ -1,17 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -34,6 +22,7 @@ rtems_task Init( { rtems_time_of_day time; rtems_status_code status; + rtems_id id; puts( "\n\n*** TEST 1 ***" ); @@ -41,47 +30,43 @@ rtems_task Init( status = rtems_clock_set( &time ); directive_failed( status, "rtems_clock_set" ); - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); - Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_INTERRUPT_LEVEL(31), - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] + rtems_build_name( 'T', 'A', '1', ' ' ), + 1, + RTEMS_MINIMUM_STACK_SIZE * 2, + RTEMS_INTERRUPT_LEVEL(31), + RTEMS_DEFAULT_ATTRIBUTES, + &id ); directive_failed( status, "rtems_task_create of TA1" ); + status = rtems_task_start( id, Task_1_through_3, 1 ); + directive_failed( status, "rtems_task_start of TA1" ); + status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] + rtems_build_name( 'T', 'A', '2', ' ' ), + 1, + RTEMS_MINIMUM_STACK_SIZE * 2, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id ); directive_failed( status, "rtems_task_create of TA2" ); + status = rtems_task_start( id, Task_1_through_3, 2 ); + directive_failed( status, "rtems_task_start of TA2" ); + status = rtems_task_create( - Task_name[ 3 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 3, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] + rtems_build_name( 'T', 'A', '3', ' ' ), + 1, + RTEMS_MINIMUM_STACK_SIZE * 3, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id ); directive_failed( status, "rtems_task_create of TA3" ); - status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - - status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 ); + status = rtems_task_start( id, Task_1_through_3, 3 ); directive_failed( status, "rtems_task_start of TA3" ); status = rtems_task_delete( RTEMS_SELF ); diff --git a/testsuites/sptests/sp01/sp01.doc b/testsuites/sptests/sp01/sp01.doc index 0944fe8235..0bba7275bd 100644 --- a/testsuites/sptests/sp01/sp01.doc +++ b/testsuites/sptests/sp01/sp01.doc @@ -1,7 +1,7 @@ # # $Id$ # -# COPYRIGHT (c) 1989-1999. +# COPYRIGHT (c) 1989-2011. # On-Line Applications Research Corporation (OAR). # # The license and distribution terms for this file may be @@ -9,37 +9,33 @@ # http://www.rtems.com/license/LICENSE. # -This file describes the directives and concepts tested by this test set. - -test set name: test1 +test name: sp01 directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, - tm_set, tm_get, tm_wkafter + rtems_task_create + rtems_task_start + rtems_task_wake_after + rtems_clock_set + rtems_clock_get + rtems_clock_tick + rtems_task_self + rtems_object_get_classic_name concepts: - a. Verifies system can create and start both the executive's system - initialization and idle task. - - b. Verifies executive can swap between three application tasks at the - same priority and the executive's internal idle task. - - c. Verifies can print strings to the CRT on port 2 of the mvme136 board - using Print and Println in the board support package. ++ Verifies executive initialization performed correctly. - d. Verifies interrupt handler can handle a task switch from an interrupt - as specified with the i_return directive. ++ Verifies system can create and start both the executive's system + initialization and idle task. - e. Verifies executive initialization performed correctly. ++ Verifies executive can swap between three application tasks at the + same priority and the executive's internal idle task. - f. Verifies the executive trap handler except for the halt function. ++ Verifies can print strings using stdio and BSP console support. - g. Verifies that a task can get the task identification number of itself. ++ Verifies interrupt support can handle a task switch from an interrupt. - h. Verifies implementation of SuperCore TOD_MILLISECONDS_TO_TICKS. Normal - computation in applications is via a macro at the Classic API level. ++ Verifies that a task can get the task identification number of itself. -output: - "TA1" is printed once every 5 seconds. "TA2" is printed once - every 10 seconds. "TA3" is printed once every 15 seconds. ++ Verifies implementation of SuperCore TOD_MILLISECONDS_TO_TICKS. Normal + computation in applications is via a macro at the Classic API level. diff --git a/testsuites/sptests/sp01/system.h b/testsuites/sptests/sp01/system.h index 601e68abef..b4c0dc6b86 100644 --- a/testsuites/sptests/sp01/system.h +++ b/testsuites/sptests/sp01/system.h @@ -1,9 +1,5 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -39,7 +35,4 @@ rtems_task Task_1_through_3( /* global variables */ -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - /* end of include file */ diff --git a/testsuites/sptests/sp01/task1.c b/testsuites/sptests/sp01/task1.c index 90fd2965e8..def9d6389b 100644 --- a/testsuites/sptests/sp01/task1.c +++ b/testsuites/sptests/sp01/task1.c @@ -1,14 +1,5 @@ -/* Task_1_through_3 - * - * This routine serves as a test task. It verifies the basic task - * switching capabilities of the executive. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -25,23 +16,23 @@ #include "system.h" rtems_task Task_1_through_3( - rtems_task_argument argument + rtems_task_argument index ) { - rtems_id tid; rtems_time_of_day time; rtems_status_code status; rtems_interval ticks; + rtems_name name; - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); - directive_failed( status, "rtems_task_ident" ); + status = rtems_object_get_classic_name( rtems_task_self(), &name ); + directive_failed( status, "rtems_object_get_classic_name" ); /* * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to * test C implementation in SuperCore -- not macro version used * everywhere else. */ - ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 ); + ticks = TOD_MILLISECONDS_TO_TICKS( index * 5 * 1000 ); while( FOREVER ) { status = rtems_clock_get_tod( &time ); @@ -52,7 +43,7 @@ rtems_task Task_1_through_3( rtems_test_exit( 0 ); } - put_name( Task_name[ task_number( tid ) ], FALSE ); + put_name( name, FALSE ); print_time( " - rtems_clock_get_tod - ", &time, "\n" ); status = rtems_task_wake_after( ticks ); diff --git a/testsuites/sptests/sp02/init.c b/testsuites/sptests/sp02/init.c index e7260c9edd..eb57807414 100644 --- a/testsuites/sptests/sp02/init.c +++ b/testsuites/sptests/sp02/init.c @@ -1,17 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -33,22 +21,21 @@ rtems_task Init( ) { rtems_status_code status; + rtems_id preempt_task_id; puts( "\n\n*** TEST 2 ***" ); - Preempt_task_name = rtems_build_name( 'P', 'R', 'M', 'T' ); - status = rtems_task_create( - Preempt_task_name, - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Preempt_task_id + rtems_build_name( 'P', 'R', 'M', 'T' ), + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &preempt_task_id ); directive_failed( status, "rtems_task_create of RTEMS_PREEMPT" ); - status = rtems_task_start( Preempt_task_id, Preempt_task, 0 ); + status = rtems_task_start( preempt_task_id, Preempt_task, 0 ); directive_failed( status, "rtems_task_start of RTEMS_PREEMPT" ); puts( "INIT - rtems_task_wake_after - yielding processor" ); @@ -112,41 +99,41 @@ rtems_task Init( directive_failed( status, "rtems_task_delete of TA3" ); status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] + Task_name[ 1 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] ); directive_failed( status, "rtems_task_create of TA1" ); + status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); + directive_failed( status, "rtems_task_start of TA1" ); + status = rtems_task_create( - Task_name[ 2 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] + Task_name[ 2 ], + 3, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 2 ] ); directive_failed( status, "rtems_task_create of TA2" ); + status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); + directive_failed( status, "rtems_task_start of TA2" ); + status = rtems_task_create( - Task_name[ 3 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] + Task_name[ 3 ], + 3, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 3 ] ); directive_failed( status, "rtems_task_create of TA3" ); - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - status = rtems_task_start( Task_id[ 3 ], Task_3, 0 ); directive_failed( status, "rtems_task_start of TA3" ); diff --git a/testsuites/sptests/sp02/preempt.c b/testsuites/sptests/sp02/preempt.c index 0d0d1aebad..52e6f5e1d0 100644 --- a/testsuites/sptests/sp02/preempt.c +++ b/testsuites/sptests/sp02/preempt.c @@ -1,13 +1,5 @@ -/* Preempt_task - * - * This routine serves as a test task. It verifies the task manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/sptests/sp02/sp02.doc b/testsuites/sptests/sp02/sp02.doc index 496f0e3e79..f5334bb944 100644 --- a/testsuites/sptests/sp02/sp02.doc +++ b/testsuites/sptests/sp02/sp02.doc @@ -1,7 +1,7 @@ # # $Id$ # -# COPYRIGHT (c) 1989-2009. +# COPYRIGHT (c) 1989-2011. # On-Line Applications Research Corporation (OAR). # # The license and distribution terms for this file may be @@ -9,31 +9,30 @@ # http://www.rtems.com/license/LICENSE. # - -This file describes the directives and concepts tested by this test set. - -test set name: test2 +test set name: sp02 directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, - t_delete, tm_wkafter, t_setpri, t_suspend + rtems_task_create + rtems_task_start + rtems_task_wake_after + rtems_clock_set + rtems_clock_get + rtems_clock_tick + rtems_task_set_priority + rtems_object_get_classic_name + rtems_task_suspend concepts: - a. Verifies that a task can delete another task and also delete itself. - - b. Verifies that memory is freed back to the heap correctly. - - c. Verifies that TCBs are freed back to the inactive chain correctly. ++ Verifies that a task can delete another task and also delete itself. - d. Verifies that a task can get the task identification number of - another task. ++ Verifies that memory is freed back to the heap correctly. - e. Verifies the _Set_state routine where the task is not READY. ++ Verifies that TCBs are freed back to the inactive chain correctly. - f. Verifies the break statement in the _Block_activate routine. ++ Verifies that a task can get the task ID of another task. - g. Verifies the while loop in the _Prev_tcb routine. ++ Verifies the blocking routine where the task is not READY. - h. Verify behavior when the IDLE task's stack is configured for - less than the minimum stack size. ++ Verifies behavior when the IDLE task's stack is configured for + more than the minimum stack size. diff --git a/testsuites/sptests/sp02/system.h b/testsuites/sptests/sp02/system.h index 56cb28887c..4a588d283f 100644 --- a/testsuites/sptests/sp02/system.h +++ b/testsuites/sptests/sp02/system.h @@ -1,9 +1,5 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-2009. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -58,7 +54,4 @@ rtems_task Task_3( TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ -TEST_EXTERN rtems_id Preempt_task_id; /* preempt task id */ -TEST_EXTERN rtems_name Preempt_task_name; /* preempt task name */ - /* end of include file */ diff --git a/testsuites/sptests/sp02/task1.c b/testsuites/sptests/sp02/task1.c index 07f2e5e062..4a73bca9c5 100644 --- a/testsuites/sptests/sp02/task1.c +++ b/testsuites/sptests/sp02/task1.c @@ -1,13 +1,5 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the task manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -40,7 +32,9 @@ rtems_task Task_1( status = rtems_task_ident( Task_name[ 2 ], RTEMS_SEARCH_ALL_NODES, &tid2 ); directive_failed( status, "rtems_task_ident of TA2" ); - printf( "TA1 - rtems_task_ident - tid of TA2 (0x%.8" PRIxrtems_id ")\n", tid2 ); + printf( + "TA1 - rtems_task_ident - tid of TA2 (0x%.8" PRIxrtems_id ")\n", tid2 + ); status = rtems_object_get_classic_name( tid2, &tid2_name ); directive_failed( status, "rtems_object_get_classic_name of TA2" ); @@ -50,14 +44,15 @@ rtems_task Task_1( status = rtems_task_ident( Task_name[ 3 ], RTEMS_SEARCH_ALL_NODES, &tid3 ); directive_failed( status, "rtems_task_ident of TA3" ); - printf( "TA1 - rtems_task_ident - tid of TA3 (0x%.8" PRIxrtems_id ")\n", tid3 ); + printf( + "TA1 - rtems_task_ident - tid of TA3 (0x%.8" PRIxrtems_id ")\n", tid3 + ); status = rtems_task_set_priority( tid3, 2, &previous_priority ); directive_failed( status, "rtems_task_set_priority" ); puts( "TA1 - rtems_task_set_priority - set TA3's priority to 2" ); - puts( "TA1 - rtems_task_suspend - suspend TA2" ); status = rtems_task_suspend( tid2 ); directive_failed( status, "rtems_task_suspend of TA2" ); @@ -67,7 +62,7 @@ rtems_task Task_1( directive_failed( status, "rtems_task_delete of TA2" ); puts( "TA1 - rtems_task_wake_after - sleep for 5 seconds" ); - status = rtems_task_wake_after( 5*rtems_clock_get_ticks_per_second() ); + status = rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() ); directive_failed( status, "rtems_task_wake_after" ); puts( "*** END OF TEST 2 ***" ); diff --git a/testsuites/sptests/sp02/task2.c b/testsuites/sptests/sp02/task2.c index ed39079dbd..b1a02ccf60 100644 --- a/testsuites/sptests/sp02/task2.c +++ b/testsuites/sptests/sp02/task2.c @@ -1,15 +1,5 @@ -/* Task_2 - * - * This routine serves as a test task. It sleeps for 1 minute but - * does not expect to wake up. Task 1 should suspend then delete it - * so that it appears to never wake up. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/sptests/sp02/task3.c b/testsuites/sptests/sp02/task3.c index 654a7570e3..1b675ff896 100644 --- a/testsuites/sptests/sp02/task3.c +++ b/testsuites/sptests/sp02/task3.c @@ -1,14 +1,5 @@ -/* Task_3 - * - * This routine serves as a test task. It simply sleeps for 5 seconds - * and then deletes itself. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/sptests/sp03/init.c b/testsuites/sptests/sp03/init.c index 745327bd60..289012e4dc 100644 --- a/testsuites/sptests/sp03/init.c +++ b/testsuites/sptests/sp03/init.c @@ -1,17 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -33,36 +21,34 @@ rtems_task Init( ) { rtems_status_code status; + rtems_id id; puts( "\n\n*** TEST 3 ***" ); - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] + rtems_build_name( 'T', 'A', '1', ' ' ), + 1, + RTEMS_MINIMUM_STACK_SIZE * 2, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id ); directive_failed( status, "rtems_task_create of TA1" ); + status = rtems_task_start( id, Task_1, 0 ); + directive_failed( status, "rtems_task_start of TA1" ); + status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] + rtems_build_name( 'T', 'A', '2', ' ' ), + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id ); directive_failed( status, "rtems_task_create of TA2" ); - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); + status = rtems_task_start( id, Task_2, 0 ); directive_failed( status, "rtems_task_start of TA2" ); status = rtems_task_delete( RTEMS_SELF ); diff --git a/testsuites/sptests/sp03/sp03.doc b/testsuites/sptests/sp03/sp03.doc index c6e2de29ba..7adce71342 100644 --- a/testsuites/sptests/sp03/sp03.doc +++ b/testsuites/sptests/sp03/sp03.doc @@ -1,7 +1,7 @@ # # $Id$ # -# COPYRIGHT (c) 1989-1999. +# COPYRIGHT (c) 1989-2011. # On-Line Applications Research Corporation (OAR). # # The license and distribution terms for this file may be @@ -12,12 +12,20 @@ This file describes the directives and concepts tested by this test set. -test set name: test3 +test set name: sp03 directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, tm_wkafter, - tm_wkwhen, tm_set, tm_get + rtems_task_create + rtems_task_start + rtems_task_wake_after + rtems_task_wake_when + rtems_clock_set + rtems_clock_get + rtems_task_self + rtems_object_get_classic_name concepts: - a. Verifies conversion routines - _Utd_to_etd and _Etd_to_utd ++ Verifies delay by interval. + ++ Verifies delay by absolute time. diff --git a/testsuites/sptests/sp03/system.h b/testsuites/sptests/sp03/system.h index ad746787b2..b54b549fac 100644 --- a/testsuites/sptests/sp03/system.h +++ b/testsuites/sptests/sp03/system.h @@ -1,9 +1,5 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -39,12 +35,8 @@ rtems_task Task_2( #define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) #define CONFIGURE_MAXIMUM_TASKS 3 - #include /* global variables */ -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - /* end of include file */ diff --git a/testsuites/sptests/sp03/task1.c b/testsuites/sptests/sp03/task1.c index d09141d2dd..3d038b5783 100644 --- a/testsuites/sptests/sp03/task1.c +++ b/testsuites/sptests/sp03/task1.c @@ -1,14 +1,5 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the capability to - * set and read the executives calender and clock. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -30,20 +21,24 @@ rtems_task Task_1( { rtems_status_code status; rtems_time_of_day time; + rtems_name name; + + status = rtems_object_get_classic_name( rtems_task_self(), &name ); + directive_failed( status, "rtems_object_get_classic_name" ); build_time( &time, 12, 31, 1988, 9, 15, 0, 0 ); status = rtems_clock_set( &time ); directive_failed( status, "rtems_clock_set" ); - put_name( Task_name[ 1 ], FALSE ); + put_name( name, FALSE ); print_time( " sets clock: ", &time, "\n" ); while( FOREVER ) { status = rtems_clock_get_tod( &time ); directive_failed( status, "rtems_clock_get_tod" ); - put_name( Task_name[ 1 ], FALSE ); + put_name( name, FALSE ); print_time( " going to sleep: ", &time, "\n" ); time.second += 5; @@ -56,7 +51,7 @@ rtems_task Task_1( status = rtems_task_wake_when( &time ); directive_failed( status, "rtems_task_wake_when" ); - put_name( Task_name[ 1 ], FALSE ); + put_name( name, FALSE ); print_time( " awakened: ", &time, "\n" ); } } diff --git a/testsuites/sptests/sp03/task2.c b/testsuites/sptests/sp03/task2.c index 257c6604f2..7ee0b66516 100644 --- a/testsuites/sptests/sp03/task2.c +++ b/testsuites/sptests/sp03/task2.c @@ -1,14 +1,5 @@ -/* Task_2 - * - * This routine serves as a test task. It repeatedly gets the system time - * and date, converts it to printable form, and print it. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. +/* + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -30,6 +21,10 @@ rtems_task Task_2( { rtems_status_code status; rtems_time_of_day time; + rtems_name name; + + status = rtems_object_get_classic_name( rtems_task_self(), &name ); + directive_failed( status, "rtems_object_get_classic_name" ); while( FOREVER ) { status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); @@ -43,7 +38,7 @@ rtems_task Task_2( rtems_test_exit( 0 ); } - put_name( Task_name[ 2 ], FALSE ); + put_name( name, FALSE ); print_time( " ", &time, "\n" ); } } -- cgit v1.2.3