summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp15
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/sp15
downloadrtems-ac7d5ef06a6d6e8d84abbd1f0b82162725f98326.tar.bz2
Initial revision
Diffstat (limited to 'testsuites/sptests/sp15')
-rw-r--r--testsuites/sptests/sp15/init.c81
-rw-r--r--testsuites/sptests/sp15/sp15.doc24
-rw-r--r--testsuites/sptests/sp15/sp15.scn16
-rw-r--r--testsuites/sptests/sp15/system.h30
-rw-r--r--testsuites/sptests/sp15/task1.c129
5 files changed, 280 insertions, 0 deletions
diff --git a/testsuites/sptests/sp15/init.c b/testsuites/sptests/sp15/init.c
new file mode 100644
index 0000000000..4bee311714
--- /dev/null
+++ b/testsuites/sptests/sp15/init.c
@@ -0,0 +1,81 @@
+/* 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 15 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+
+ Partition_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' );
+ Partition_name[ 2 ] = rtems_build_name( 'P', 'T', '2', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 4,
+ 2048,
+ 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" );
+
+ puts("INIT - rtems_partition_create - partition 1");
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Area_1,
+ 4096,
+ 512,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Partition_id[ 1 ]
+ );
+ directive_failed( status, "rtems_partition_create of PT1" );
+
+ puts("INIT - rtems_partition_create - partition 2");
+ status = rtems_partition_create(
+ Partition_name[ 2 ],
+ Area_2,
+ 274,
+ 128,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Partition_id[ 2 ]
+ );
+ directive_failed( status, "rtems_partition_create of PT2" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp15/sp15.doc b/testsuites/sptests/sp15/sp15.doc
new file mode 100644
index 0000000000..3ec20ae92b
--- /dev/null
+++ b/testsuites/sptests/sp15/sp15.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: test15
+
+directives:
+ ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return,
+ pt_create, pt_ident, pt_getbuf, pt_retbuf, pt_delete
+
+concepts:
+
+ a. This test checks out the partition manager.
diff --git a/testsuites/sptests/sp15/sp15.scn b/testsuites/sptests/sp15/sp15.scn
new file mode 100644
index 0000000000..acddd5b5e9
--- /dev/null
+++ b/testsuites/sptests/sp15/sp15.scn
@@ -0,0 +1,16 @@
+*** TEST 15 ***
+INIT - rtems_partition_create - partition 1
+INIT - rtems_partition_create - partition 2
+TA1 - rtems_partition_ident - partition 1 id = 00010001
+TA1 - rtems_partition_ident - partition 2 id = 00010002
+TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - 0x00000000
+TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - 0x00000200
+TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - 0x00000000
+TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - 0x00000080
+TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - 0x00000000
+TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - 0x00000200
+TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - 0x00000000
+TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - 0x00000080
+TA1 - rtems_partition_delete - delete partition 1
+TA1 - rtems_partition_delete - delete partition 2
+*** END OF TEST 15 ***
diff --git a/testsuites/sptests/sp15/system.h b/testsuites/sptests/sp15/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp15/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/sp15/task1.c b/testsuites/sptests/sp15/task1.c
new file mode 100644
index 0000000000..f22d27efe3
--- /dev/null
+++ b/testsuites/sptests/sp15/task1.c
@@ -0,0 +1,129 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It tests the partition manager.
+ *
+ * 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_id ptid_1;
+ rtems_id ptid_2;
+ void *buffer_address_1;
+ void *buffer_address_2;
+ void *buffer_address_3;
+ void *buffer_address_4;
+ rtems_status_code status;
+
+ puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " );
+ status = rtems_partition_ident(
+ Partition_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &ptid_1
+ );
+ directive_failed( status, "rtems_partition_ident of PT1" );
+ printf( "%08x\n", ptid_1 );
+
+ puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " );
+ status = rtems_partition_ident(
+ Partition_name[ 2 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &ptid_2
+ );
+ directive_failed( status, "rtems_partition_ident of PT2" );
+ printf( "%08x\n", ptid_2 );
+
+ puts_nocr(
+ "TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - "
+ );
+ status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 );
+ directive_failed( status, "rtems_partition_get_buffer" );
+ Put_address_from_area_1( buffer_address_1 );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - "
+ );
+ status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 );
+ directive_failed( status, "rtems_partition_get_buffer" );
+ Put_address_from_area_1( buffer_address_2 );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - "
+ );
+ status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 );
+ directive_failed( status, "rtems_partition_get_buffer" );
+ Put_address_from_area_2( buffer_address_3 );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - "
+ );
+ status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 );
+ directive_failed( status, "rtems_partition_get_buffer" );
+ Put_address_from_area_2( buffer_address_4 );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - "
+ );
+ Put_address_from_area_1( buffer_address_1 );
+ new_line;
+ status = rtems_partition_return_buffer( ptid_1, buffer_address_1 );
+ directive_failed( status, "rtems_partition_return_buffer" );
+
+ puts_nocr(
+ "TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - "
+ );
+ Put_address_from_area_1( buffer_address_2 );
+ new_line;
+ status = rtems_partition_return_buffer( ptid_1, buffer_address_2 );
+ directive_failed( status, "rtems_partition_return_buffer" );
+
+ puts_nocr(
+ "TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - "
+ );
+ Put_address_from_area_2( buffer_address_3 );
+ new_line;
+ status = rtems_partition_return_buffer( ptid_2, buffer_address_3 );
+ directive_failed( status, "rtems_partition_return_buffer" );
+
+ puts_nocr(
+ "TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - "
+ );
+ Put_address_from_area_2( buffer_address_4 );
+ new_line;
+ status = rtems_partition_return_buffer( ptid_2, buffer_address_4 );
+ directive_failed( status, "rtems_partition_return_buffer" );
+
+ puts( "TA1 - rtems_partition_delete - delete partition 1"
+ );
+ status = rtems_partition_delete( ptid_1 );
+ directive_failed( status, "rtems_partition_delete" );
+
+ puts( "TA1 - rtems_partition_delete - delete partition 2"
+ );
+ status = rtems_partition_delete( ptid_2 );
+ directive_failed( status, "rtems_partition_delete" );
+
+ puts( "*** END OF TEST 15 ***" );
+ exit( 0 );
+}