summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp03
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-05-11 17:39:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-05-11 17:39:37 +0000
commitac7d5ef06a6d6e8d84abbd1f0b82162725f98326 (patch)
tree9304cf759a73f2a1c6fd3191948f00e870af3787 /testsuites/sptests/sp03
downloadrtems-ac7d5ef06a6d6e8d84abbd1f0b82162725f98326.tar.bz2
Initial revision
Diffstat (limited to 'testsuites/sptests/sp03')
-rw-r--r--testsuites/sptests/sp03/init.c70
-rw-r--r--testsuites/sptests/sp03/sp03.doc24
-rw-r--r--testsuites/sptests/sp03/sp03.scn26
-rw-r--r--testsuites/sptests/sp03/system.h30
-rw-r--r--testsuites/sptests/sp03/task1.c59
-rw-r--r--testsuites/sptests/sp03/task2.c46
6 files changed, 255 insertions, 0 deletions
diff --git a/testsuites/sptests/sp03/init.c b/testsuites/sptests/sp03/init.c
new file mode 100644
index 0000000000..962d434284
--- /dev/null
+++ b/testsuites/sptests/sp03/init.c
@@ -0,0 +1,70 @@
+/* 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, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ 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,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ 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 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp03/sp03.doc b/testsuites/sptests/sp03/sp03.doc
new file mode 100644
index 0000000000..96d6d41d94
--- /dev/null
+++ b/testsuites/sptests/sp03/sp03.doc
@@ -0,0 +1,24 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test3
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, tm_wkafter,
+ tm_wkwhen, tm_set, tm_get
+
+concepts:
+
+ a. Verifies conversion routines - _Utd_to_etd and _Etd_to_utd
diff --git a/testsuites/sptests/sp03/sp03.scn b/testsuites/sptests/sp03/sp03.scn
new file mode 100644
index 0000000000..496982e86f
--- /dev/null
+++ b/testsuites/sptests/sp03/sp03.scn
@@ -0,0 +1,26 @@
+*** TEST 3 ***
+TA1 sets clock: 09:15:00 12/31/1988
+TA1 going to sleep: 09:15:00 12/31/1988
+TA2 09:15:01 12/31/1988
+TA2 09:15:02 12/31/1988
+TA2 09:15:03 12/31/1988
+TA2 09:15:04 12/31/1988
+TA1 awakened: 09:15:05 12/31/1988
+TA1 going to sleep: 09:15:05 12/31/1988
+TA2 09:15:05 12/31/1988
+TA2 09:15:06 12/31/1988
+TA2 09:15:07 12/31/1988
+TA2 09:15:08 12/31/1988
+TA2 09:15:09 12/31/1988
+TA1 awakened: 09:15:10 12/31/1988
+TA1 going to sleep: 09:15:10 12/31/1988
+TA2 09:15:10 12/31/1988
+TA2 09:15:11 12/31/1988
+TA2 09:15:12 12/31/1988
+TA2 09:15:13 12/31/1988
+TA2 09:15:14 12/31/1988
+TA1 awakened: 09:15:15 12/31/1988
+TA1 going to sleep: 09:15:15 12/31/1988
+TA2 09:15:15 12/31/1988
+TA2 09:15:16 12/31/1988
+*** END OF TEST 3 ***
diff --git a/testsuites/sptests/sp03/system.h b/testsuites/sptests/sp03/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp03/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp03/task1.c b/testsuites/sptests/sp03/task1.c
new file mode 100644
index 0000000000..e59fad45cf
--- /dev/null
+++ b/testsuites/sptests/sp03/task1.c
@@ -0,0 +1,59 @@
+/* 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, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ 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 );
+ print_time( " sets clock: ", &time, "\n" );
+
+ while( FOREVER ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ put_name( Task_name[ 1 ], FALSE );
+ print_time( " going to sleep: ", &time, "\n" );
+
+ time.second += 5;
+ time.minute += ( time.second / 60 );
+ time.second %= 60;
+ time.hour += ( time.minute / 60 );
+ time.minute %= 60;
+ time.hour %= 24;
+
+ status = rtems_task_wake_when( &time );
+ directive_failed( status, "rtems_task_wake_when" );
+
+ put_name( Task_name[ 1 ], FALSE );
+ print_time( " awakened: ", &time, "\n" );
+ }
+}
diff --git a/testsuites/sptests/sp03/task2.c b/testsuites/sptests/sp03/task2.c
new file mode 100644
index 0000000000..8838c1db67
--- /dev/null
+++ b/testsuites/sptests/sp03/task2.c
@@ -0,0 +1,46 @@
+/* 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, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ while( FOREVER ) {
+ status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ if ( time.second >= 17 ) {
+ puts( "*** END OF TEST 3 *** " );
+ exit( 0 );
+ }
+
+ put_name( Task_name[ 2 ], FALSE );
+ print_time( " ", &time, "\n" );
+ }
+}