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.
This commit is contained in:
Jennifer Averett
2010-06-22 19:27:12 +00:00
parent 91e446f3ab
commit 71a30785f2
8 changed files with 109 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
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.
2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* malloctest/init.c: Added error case with malloc of size 0.

View File

@@ -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

View File

@@ -48,6 +48,7 @@ cpuuse/Makefile
heapwalk/Makefile
malloctest/Makefile
malloc02/Makefile
malloc03/Makefile
monitor/Makefile
monitor02/Makefile
putenvtest/Makefile

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -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

View File

@@ -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 */

View File

@@ -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:
+

View File

@@ -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 ***