summaryrefslogtreecommitdiff
path: root/testsuites/sptests/sp03
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/sp03
parent2be7dcfc2e34752413bae6fb94fd28337f2b9c37 (diff)
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/sp03')
-rw-r--r--testsuites/sptests/sp03/init.c52
-rw-r--r--testsuites/sptests/sp03/sp03.doc18
-rw-r--r--testsuites/sptests/sp03/system.h12
-rw-r--r--testsuites/sptests/sp03/task1.c23
-rw-r--r--testsuites/sptests/sp03/task2.c19
5 files changed, 50 insertions, 74 deletions
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 <rtems/confdefs.h>
/* 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" );
}
}