summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-01 00:25:20 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-01 00:25:20 +0000
commitba23ff5e3685e201d4338f4e1c566a3b84865a69 (patch)
tree0b209d08ed3b23dba9e618169ce3f9d70b8a739b /testsuites/sptests
parent2009-07-31 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-ba23ff5e3685e201d4338f4e1c566a3b84865a69.tar.bz2
2009-07-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, sp62/init.c: Add new test to ensure a particular path is taken through the _Heap_Resize_block code. * sp63/.cvsignore, sp63/Makefile.am, sp63/init.c, sp63/sp63.doc, sp63/sp63.scn: New files.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am2
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/sp62/init.c3
-rw-r--r--testsuites/sptests/sp63/.cvsignore2
-rw-r--r--testsuites/sptests/sp63/Makefile.am28
-rw-r--r--testsuites/sptests/sp63/init.c58
-rw-r--r--testsuites/sptests/sp63/sp63.doc26
-rw-r--r--testsuites/sptests/sp63/sp63.scn6
9 files changed, 129 insertions, 4 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 5cc80ffe10..b4cc7e95cb 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-31 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac, sp62/init.c: Add new test to ensure a
+ particular path is taken through the _Heap_Resize_block code.
+ * sp63/.cvsignore, sp63/Makefile.am, sp63/init.c, sp63/sp63.doc,
+ sp63/sp63.scn: New files.
+
2009-07-30 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp42/Makefile.am, sp42/init.c, sp42/sp42.scn: Test was testing the
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 142e32174e..40c65a62a5 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -13,7 +13,7 @@ SUBDIRS = \
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 \
sp40 sp41 sp42 sp43 sp44 sp45 sp46 sp47 sp48 sp49 \
sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 sp58 sp59 \
- sp60 sp61 sp62 \
+ sp60 sp61 sp62 sp63 \
spchain spobjgetnext spprintk spsize spstkalloc spthreadq01 \
spwatchdog spwkspace \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 779892706d..169f0a776f 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -89,6 +89,7 @@ sp59/Makefile
sp60/Makefile
sp61/Makefile
sp62/Makefile
+sp63/Makefile
spchain/Makefile
spfatal01/Makefile
spfatal02/Makefile
diff --git a/testsuites/sptests/sp62/init.c b/testsuites/sptests/sp62/init.c
index 2757ff33f0..0a8f595685 100644
--- a/testsuites/sptests/sp62/init.c
+++ b/testsuites/sptests/sp62/init.c
@@ -36,12 +36,10 @@ rtems_task Blocker(
);
directive_failed( sc, "rtems_region_get_segment" );
-
puts( "Blocker - Got memory after resize" );
case_hit = true;
(void) rtems_task_delete( RTEMS_SELF );
-
}
rtems_task Init(
@@ -70,7 +68,6 @@ rtems_task Init(
sc = rtems_task_start( task_id, Blocker, 0 );
directive_failed( sc, "rtems_task_start of Blocker" );
-
puts( "Init - rtems_task_create Region - OK" );
sc = rtems_region_create(
rtems_build_name( 'R', 'N', '1', ' ' ),
diff --git a/testsuites/sptests/sp63/.cvsignore b/testsuites/sptests/sp63/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp63/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp63/Makefile.am b/testsuites/sptests/sp63/Makefile.am
new file mode 100644
index 0000000000..d53442c0cb
--- /dev/null
+++ b/testsuites/sptests/sp63/Makefile.am
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp63
+sp63_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp63.scn
+dist_rtems_tests_DATA += sp63.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp63_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp63_OBJECTS) $(sp63_LDADD)
+LINK_LIBS = $(sp63_LDLIBS)
+
+sp63$(EXEEXT): $(sp63_OBJECTS) $(sp63_DEPENDENCIES)
+ @rm -f sp63$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp63/init.c b/testsuites/sptests/sp63/init.c
new file mode 100644
index 0000000000..ac120cd6c9
--- /dev/null
+++ b/testsuites/sptests/sp63/init.c
@@ -0,0 +1,58 @@
+/*
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+uint32_t Memory[256];
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ Heap_Control Heap;
+ uint32_t heap_size;
+ void *ptr1;
+ intptr_t old;
+ intptr_t avail;
+ Heap_Resize_status hc;
+
+ puts( "\n\n*** TEST 63 ***" );
+
+ puts( "Init - _Heap_Initialize - OK" );
+ heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
+ printf( "Init - Heap size=%d\n", heap_size );
+
+ puts( "Init - _Heap_Allocate_aligned - OK");
+ ptr1 = _Heap_Allocate_aligned( &Heap, 64, 32 );
+ assert( ptr1 );
+
+ puts( "Init - _Heap_Resize_block - OK");
+ hc = _Heap_Resize_block( &Heap, ptr1, 4, &old, &avail );
+ assert( !hc );
+
+ puts( "*** END OF TEST 63 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_REGIONS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/sp63/sp63.doc b/testsuites/sptests/sp63/sp63.doc
new file mode 100644
index 0000000000..6d6a155938
--- /dev/null
+++ b/testsuites/sptests/sp63/sp63.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: sp63
+
+directives:
+
+ _Heap_Initialize
+ _Heap_Allocate_aligned
+ _Heap_Resize_block
+
+concepts:
+
++ Exercise the case where we shrink a block that creates a block that
+ is less than the minimum. This is mainly to ensure that a branch is taken.
+
diff --git a/testsuites/sptests/sp63/sp63.scn b/testsuites/sptests/sp63/sp63.scn
new file mode 100644
index 0000000000..766fbe9c9b
--- /dev/null
+++ b/testsuites/sptests/sp63/sp63.scn
@@ -0,0 +1,6 @@
+*** TEST 63 ***
+Init - _Heap_Initialize - OK
+Init - Heap size=1012
+Init - _Heap_Allocate_aligned - OK
+Init - _Heap_Resize_block - OK
+*** END OF TEST 63 ***