summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp01
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-11 19:26:41 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-11 19:26:41 +0000
commit300fe1c6e05818e988e3b995985e0b411c3d9406 (patch)
tree26c79276df67a6d3efa7746935d244583c8621ea /testsuites/sptests/sp01
parent2011-06-11 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-300fe1c6e05818e988e3b995985e0b411c3d9406.tar.bz2
2011-06-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* 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.
Diffstat (limited to 'testsuites/sptests/sp01')
-rw-r--r--testsuites/sptests/sp01/init.c71
-rw-r--r--testsuites/sptests/sp01/sp01.doc44
-rw-r--r--testsuites/sptests/sp01/system.h11
-rw-r--r--testsuites/sptests/sp01/task1.c25
4 files changed, 58 insertions, 93 deletions
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 );