summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp25
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/sp25
downloadrtems-ac7d5ef06a6d6e8d84abbd1f0b82162725f98326.tar.bz2
Initial revision
Diffstat (limited to 'testsuites/sptests/sp25')
-rw-r--r--testsuites/sptests/sp25/init.c69
-rw-r--r--testsuites/sptests/sp25/sp25.doc32
-rw-r--r--testsuites/sptests/sp25/sp25.scn29
-rw-r--r--testsuites/sptests/sp25/system.h32
-rw-r--r--testsuites/sptests/sp25/task1.c241
5 files changed, 403 insertions, 0 deletions
diff --git a/testsuites/sptests/sp25/init.c b/testsuites/sptests/sp25/init.c
new file mode 100644
index 0000000000..fcd5b3dfd6
--- /dev/null
+++ b/testsuites/sptests/sp25/init.c
@@ -0,0 +1,69 @@
+/* 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 25 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ BASE_PRIORITY,
+ 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" );
+
+ Region_name[ 1 ] = rtems_build_name('R', 'N', '0', '1');
+
+
+ status = rtems_region_create(
+ Region_name[ 1 ],
+ Area_1,
+ sizeof( Area_1 ),
+ 64,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Region_id[ 1 ]
+ );
+ directive_failed( status, "rtems_region_create of RN1" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp25/sp25.doc b/testsuites/sptests/sp25/sp25.doc
new file mode 100644
index 0000000000..98684f53b3
--- /dev/null
+++ b/testsuites/sptests/sp25/sp25.doc
@@ -0,0 +1,32 @@
+#
+# $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: test25
+
+directives:
+ task_create
+ task_start
+ task_delete
+ region_create
+ region_ident
+ region_get_segment
+ region_return_segment
+ region_delete
+
+concepts:
+
+ a. Verifies that the heap maintains it's integrity trhough a series
+ on region_get_segments and region_return_segments.
+
diff --git a/testsuites/sptests/sp25/sp25.scn b/testsuites/sptests/sp25/sp25.scn
new file mode 100644
index 0000000000..1944f18f4b
--- /dev/null
+++ b/testsuites/sptests/sp25/sp25.scn
@@ -0,0 +1,29 @@
+*** TEST 25 ***
+TA1 - rtems_region_ident - 00010002
+TA1 - rtems_region_get_segment - wait on 64 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000f9b8
+TA1 - rtems_region_get_segment - wait on 128 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000f930
+TA1 - rtems_region_get_segment - wait on 256 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000f828
+TA1 - rtems_region_get_segment - wait on 512 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000f620
+TA1 - rtems_region_get_segment - wait on 1024 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000f218
+TA1 - rtems_region_get_segment - wait on 2048 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000ea10
+TA1 - rtems_region_get_segment - wait on 4096 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000da08
+TA1 - rtems_region_get_segment - wait on 8192 byte segment from region 1
+TA1 - got segment from region 1 - 0x0000ba00
+<pause>
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f828
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f620
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f9b8
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f930
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000da08
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000ea10
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000ba00
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f218
+TA1 - rtems_region_delete - walks heap if debug enabled
+*** END OF TEST 25 ***
diff --git a/testsuites/sptests/sp25/system.h b/testsuites/sptests/sp25/system.h
new file mode 100644
index 0000000000..9e2b748a85
--- /dev/null
+++ b/testsuites/sptests/sp25/system.h
@@ -0,0 +1,32 @@
+/* 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 */
+
+#define BASE_PRIORITY 140 /* all tasks priority */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp25/task1.c b/testsuites/sptests/sp25/task1.c
new file mode 100644
index 0000000000..6222c4e734
--- /dev/null
+++ b/testsuites/sptests/sp25/task1.c
@@ -0,0 +1,241 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It tests the region 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
+)
+{
+ void *address_1;
+ void *address_2;
+ void *address_3;
+ void *address_4;
+ void *address_5;
+ void *address_6;
+ void *address_7;
+ void *address_8;
+ rtems_status_code status;
+ rtems_id region_id;
+
+ status = rtems_region_ident(Region_name[ 1 ], &region_id);
+ printf( "TA1 - rtems_region_ident - %08x\n", region_id );
+ directive_failed(status, "rtems_region_ident of RN01");
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 64 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 64,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_1 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 128 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 128,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_2
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_2 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 256 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 256,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_3
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_3 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 512 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 512,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_4
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_4 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 1024 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 1024,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_5
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_5 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 2048 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 2048,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_6
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_6 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 4096 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 4096,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_7
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_7 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 8192 byte segment from region 1"
+ );
+ rtems_region_get_segment(
+ Region_id[ 1 ],
+ 8192,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &address_8
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( address_8 );
+ new_line;
+
+pause();
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_3 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_3 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_3 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_4 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_4 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_4 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_1 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_1 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_1 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_2 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_2 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_2 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_7 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_7 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_7 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_6 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_6 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_6 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_8 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_8 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_8 = 0;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( address_5 );
+ status = rtems_region_return_segment( Region_id[ 1 ], address_5 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+ address_5 = 0;
+
+ puts( "TA1 - rtems_region_delete - walks heap if debug enabled" );
+ rtems_region_delete(Region_id[ 1 ]);
+
+ puts( "*** END OF TEST 25 ***" );
+ exit( 0 );
+}