summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/malloc03
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2010-06-22 19:27:12 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2010-06-22 19:27:12 +0000
commit71a30785f2181934522672fd432d57f37f371e76 (patch)
treef1fb97d6b45fd155dfb37cc75931e7886abb1a75 /testsuites/libtests/malloc03
parent2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com> (diff)
downloadrtems-71a30785f2181934522672fd432d57f37f371e76.tar.bz2
2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* Makefile.am, configure.ac: Added test that attempts to free stack memory. This causes a error to be printed from the free function. * malloc03/.cvsignore, malloc03/Makefile.am, malloc03/init.c, malloc03/malloc03.doc, malloc03/malloc03.scn: New files.
Diffstat (limited to 'testsuites/libtests/malloc03')
-rw-r--r--testsuites/libtests/malloc03/.cvsignore2
-rw-r--r--testsuites/libtests/malloc03/Makefile.am26
-rw-r--r--testsuites/libtests/malloc03/init.c44
-rw-r--r--testsuites/libtests/malloc03/malloc03.doc22
-rw-r--r--testsuites/libtests/malloc03/malloc03.scn4
5 files changed, 98 insertions, 0 deletions
diff --git a/testsuites/libtests/malloc03/.cvsignore b/testsuites/libtests/malloc03/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/libtests/malloc03/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/libtests/malloc03/Makefile.am b/testsuites/libtests/malloc03/Makefile.am
new file mode 100644
index 0000000000..582dc0d8ea
--- /dev/null
+++ b/testsuites/libtests/malloc03/Makefile.am
@@ -0,0 +1,26 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = malloc03
+malloc03_SOURCES = init.c ../../support/src/spin.c
+
+dist_rtems_tests_DATA = malloc03.scn
+dist_rtems_tests_DATA += malloc03.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 = $(malloc03_OBJECTS) $(malloc03_LDADD)
+LINK_LIBS = $(malloc03_LDLIBS)
+
+malloc03$(EXEEXT): $(malloc03_OBJECTS) $(malloc03_DEPENDENCIES)
+ @rm -f malloc03$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/libtests/malloc03/init.c b/testsuites/libtests/malloc03/init.c
new file mode 100644
index 0000000000..5779ed99a0
--- /dev/null
+++ b/testsuites/libtests/malloc03/init.c
@@ -0,0 +1,44 @@
+/*
+ * 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 <tmacros.h>
+#include "test_support.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ void *p1;
+ unsigned int val = 999;
+
+ puts( "\n\n*** TEST MALLOC03 ***" );
+
+ p1 = &val;
+ printf("Attempt to free stack memory\n");
+ free( p1 );
+
+ puts( "*** END OF TEST MALLOC03 ***" );
+
+ 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_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
diff --git a/testsuites/libtests/malloc03/malloc03.doc b/testsuites/libtests/malloc03/malloc03.doc
new file mode 100644
index 0000000000..7d4a8b16b1
--- /dev/null
+++ b/testsuites/libtests/malloc03/malloc03.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: malloc03
+
+directives:
+
+ + free stack memory
+
+concepts:
+
++
diff --git a/testsuites/libtests/malloc03/malloc03.scn b/testsuites/libtests/malloc03/malloc03.scn
new file mode 100644
index 0000000000..e70040a4bd
--- /dev/null
+++ b/testsuites/libtests/malloc03/malloc03.scn
@@ -0,0 +1,4 @@
+*** TEST MALLOC03 ***
+Attempt to free stack memory
+Program heap: free of bad pointer 2E2F0 -- range 2EA60 - 1000000
+*** END OF TEST MALLOC03 ***