diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-08 19:39:14 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-08 19:39:14 +0000 |
commit | c33c3532754e33676207f8d43d3eec171c0e0405 (patch) | |
tree | dfd1e4e6bef1b02a9623143fe6be5c709027048f /testsuites/sptests/spfatal09 | |
parent | 2010-07-08 Bharath Suri <bharath.s.jois@gmail.com> (diff) | |
download | rtems-c33c3532754e33676207f8d43d3eec171c0e0405.tar.bz2 |
2010-07-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Readd spfatal09 as a malloc initialization
fatal error.
* spfatal09/.cvsignore, spfatal09/Makefile.am, spfatal09/spfatal09.doc,
spfatal09/spfatal09.scn, spfatal09/testcase.h: New files.
Diffstat (limited to 'testsuites/sptests/spfatal09')
-rw-r--r-- | testsuites/sptests/spfatal09/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/spfatal09/Makefile.am | 25 | ||||
-rw-r--r-- | testsuites/sptests/spfatal09/spfatal09.doc | 22 | ||||
-rw-r--r-- | testsuites/sptests/spfatal09/spfatal09.scn | 4 | ||||
-rw-r--r-- | testsuites/sptests/spfatal09/testcase.h | 30 |
5 files changed, 83 insertions, 0 deletions
diff --git a/testsuites/sptests/spfatal09/.cvsignore b/testsuites/sptests/spfatal09/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/spfatal09/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/spfatal09/Makefile.am b/testsuites/sptests/spfatal09/Makefile.am new file mode 100644 index 0000000000..4d2df9285b --- /dev/null +++ b/testsuites/sptests/spfatal09/Makefile.am @@ -0,0 +1,25 @@ +## +## $Id$ +## + +rtems_tests_PROGRAMS = spfatal09 +spfatal09_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h \ + testcase.h + +dist_rtems_tests_DATA = spfatal09.scn +dist_rtems_tests_DATA += spfatal09.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(spfatal09_OBJECTS) $(spfatal09_LDADD) +LINK_LIBS = $(spfatal09_LDLIBS) + +spfatal09$(EXEEXT): $(spfatal09_OBJECTS) $(spfatal09_DEPENDENCIES) + @rm -f spfatal09$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/spfatal09/spfatal09.doc b/testsuites/sptests/spfatal09/spfatal09.doc new file mode 100644 index 0000000000..318611895e --- /dev/null +++ b/testsuites/sptests/spfatal09/spfatal09.doc @@ -0,0 +1,22 @@ +# +# $Id$ +# +# COPYRIGHT (c) 1989-2010. +# 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: spfatal09 + +directives: + + RTEMS_Malloc_Initialize + +concepts: + ++ fatal error for heap initialization failing diff --git a/testsuites/sptests/spfatal09/spfatal09.scn b/testsuites/sptests/spfatal09/spfatal09.scn new file mode 100644 index 0000000000..4ab109adc3 --- /dev/null +++ b/testsuites/sptests/spfatal09/spfatal09.scn @@ -0,0 +1,4 @@ +*** TEST FATAL 9 *** +Fatal error (Bad heap address to malloc) hit +*** END OF TEST *** + diff --git a/testsuites/sptests/spfatal09/testcase.h b/testsuites/sptests/spfatal09/testcase.h new file mode 100644 index 0000000000..ee87c1e729 --- /dev/null +++ b/testsuites/sptests/spfatal09/testcase.h @@ -0,0 +1,30 @@ +/* + * Malloc Initialization Error + * + * COPYRIGHT (c) 1989-2010. + * 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 <rtems/malloc.h> +#include <rtems/libcsupport.h> + +#define FATAL_ERROR_TEST_NAME "9" +#define FATAL_ERROR_DESCRIPTION "Bad heap address to malloc" +#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API +#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE +#define FATAL_ERROR_EXPECTED_ERROR RTEMS_NO_MEMORY + +char Malloc_Heap[ 1 ] CPU_STRUCTURE_ALIGNMENT; + +void force_error() +{ + RTEMS_Malloc_Initialize( Malloc_Heap, sizeof(Malloc_Heap), 0 ); + + /* we will not run this far */ +} |