2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>

* Makefile.am, configure.ac: Add new test to exercise
	malloc_get_statistics().
	* malloc05/.cvsignore, malloc05/Makefile.am, malloc05/init.c,
	malloc05/malloc05.doc, malloc05/malloc05.scn: New files.
This commit is contained in:
Joel Sherrill
2010-07-14 23:29:45 +00:00
parent 830c6eee8e
commit 8911ffd33f
8 changed files with 112 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add new test to exercise
malloc_get_statistics().
* malloc05/.cvsignore, malloc05/Makefile.am, malloc05/init.c,
malloc05/malloc05.doc, malloc05/malloc05.scn: New files.
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1535/tests

View File

@@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
SUBDIRS = POSIX
SUBDIRS += bspcmdline01 cpuuse gxx01 \
malloctest malloc02 malloc03 malloc04 heapwalk \
malloctest malloc02 malloc03 malloc04 malloc05 heapwalk \
putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
termios termios01 termios02 termios03 termios04 termios05 termios06 \
rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \

View File

@@ -51,6 +51,7 @@ malloctest/Makefile
malloc02/Makefile
malloc03/Makefile
malloc04/Makefile
malloc05/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 = malloc05
malloc05_SOURCES = init.c
dist_rtems_tests_DATA = malloc05.scn
dist_rtems_tests_DATA += malloc05.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 = $(malloc05_OBJECTS) $(malloc05_LDADD)
LINK_LIBS = $(malloc05_LDLIBS)
malloc05$(EXEEXT): $(malloc05_OBJECTS) $(malloc05_DEPENDENCIES)
@rm -f malloc05$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am

View File

@@ -0,0 +1,49 @@
/*
* 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"
#include <rtems/malloc.h>
rtems_task Init(
rtems_task_argument argument
)
{
int sc;
rtems_malloc_statistics_t stats;
puts( "\n\n*** TEST MALLOC05 ***" );
puts( "malloc_get_statistics( NULL ) - returns -1" );
sc = malloc_get_statistics( NULL );
rtems_test_assert( sc == -1 );
puts( "malloc_get_statistics( &stats ) - returns -0" );
sc = malloc_get_statistics( &stats );
rtems_test_assert( sc == 0 );
puts( "*** END OF TEST MALLOC05 ***" );
rtems_test_exit(0);
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_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: malloc05
directives:
malloc_get_statistics
concepts:
+ Fully exercise malloc_get_statistics.

View File

@@ -0,0 +1,4 @@
*** TEST MALLOC05 ***
malloc_get_statistics( NULL ) - returns -1
malloc_get_statistics( &stats ) - returns -0
*** END OF TEST MALLOC05 ***