From 71a30785f2181934522672fd432d57f37f371e76 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Tue, 22 Jun 2010 19:27:12 +0000 Subject: 2010-06-22 Jennifer Averett * 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. --- testsuites/libtests/ChangeLog | 7 +++++ testsuites/libtests/Makefile.am | 5 ++-- testsuites/libtests/configure.ac | 1 + testsuites/libtests/malloc03/.cvsignore | 2 ++ testsuites/libtests/malloc03/Makefile.am | 26 ++++++++++++++++++ testsuites/libtests/malloc03/init.c | 44 +++++++++++++++++++++++++++++++ testsuites/libtests/malloc03/malloc03.doc | 22 ++++++++++++++++ testsuites/libtests/malloc03/malloc03.scn | 4 +++ 8 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 testsuites/libtests/malloc03/.cvsignore create mode 100644 testsuites/libtests/malloc03/Makefile.am create mode 100644 testsuites/libtests/malloc03/init.c create mode 100644 testsuites/libtests/malloc03/malloc03.doc create mode 100644 testsuites/libtests/malloc03/malloc03.scn (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 41686e9fdc..e1d637d88c 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,10 @@ +2010-06-22 Jennifer Averett + + * 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. + 2010-06-22 Jennifer Averett * malloctest/init.c: Added error case with malloc of size 0. diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index 36eb7a2507..263dab8146 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -6,8 +6,9 @@ ACLOCAL_AMFLAGS = -I ../aclocal SUBDIRS = POSIX -SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 heapwalk putenvtest monitor \ - monitor02 rtmonuse stackchk stackchk01 termios termios01 termios02 \ +SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 malloc03 heapwalk \ + putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \ + termios termios01 termios02 \ rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \ block08 block09 block10 stringto01 diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac index e2ec4a25b2..5f4e16fa32 100644 --- a/testsuites/libtests/configure.ac +++ b/testsuites/libtests/configure.ac @@ -48,6 +48,7 @@ cpuuse/Makefile heapwalk/Makefile malloctest/Makefile malloc02/Makefile +malloc03/Makefile monitor/Makefile monitor02/Makefile putenvtest/Makefile 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 +#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 +/* 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 *** -- cgit v1.2.3