From 8911ffd33fe83c040fee9aac29e03c83f6cb60d2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 14 Jul 2010 23:29:45 +0000 Subject: 2010-07-14 Joel Sherrill * 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. --- testsuites/libtests/ChangeLog | 7 +++++ testsuites/libtests/Makefile.am | 2 +- testsuites/libtests/configure.ac | 1 + testsuites/libtests/malloc05/.cvsignore | 2 ++ testsuites/libtests/malloc05/Makefile.am | 26 ++++++++++++++++ testsuites/libtests/malloc05/init.c | 49 +++++++++++++++++++++++++++++++ testsuites/libtests/malloc05/malloc05.doc | 22 ++++++++++++++ testsuites/libtests/malloc05/malloc05.scn | 4 +++ 8 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 testsuites/libtests/malloc05/.cvsignore create mode 100644 testsuites/libtests/malloc05/Makefile.am create mode 100644 testsuites/libtests/malloc05/init.c create mode 100644 testsuites/libtests/malloc05/malloc05.doc create mode 100644 testsuites/libtests/malloc05/malloc05.scn (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 28b9dd9916..249b421cfd 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,10 @@ +2010-07-14 Joel Sherrill + + * 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 PR 1535/tests diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index 5b329dd6e8..057721d1c8 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -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 \ diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac index 52f7127139..6a23a9d0c9 100644 --- a/testsuites/libtests/configure.ac +++ b/testsuites/libtests/configure.ac @@ -51,6 +51,7 @@ malloctest/Makefile malloc02/Makefile malloc03/Makefile malloc04/Makefile +malloc05/Makefile monitor/Makefile monitor02/Makefile putenvtest/Makefile diff --git a/testsuites/libtests/malloc05/.cvsignore b/testsuites/libtests/malloc05/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/libtests/malloc05/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/libtests/malloc05/Makefile.am b/testsuites/libtests/malloc05/Makefile.am new file mode 100644 index 0000000000..2c0e8c8668 --- /dev/null +++ b/testsuites/libtests/malloc05/Makefile.am @@ -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 diff --git a/testsuites/libtests/malloc05/init.c b/testsuites/libtests/malloc05/init.c new file mode 100644 index 0000000000..7b5444dd6a --- /dev/null +++ b/testsuites/libtests/malloc05/init.c @@ -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 +#include "test_support.h" +#include + +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 +/* end of file */ diff --git a/testsuites/libtests/malloc05/malloc05.doc b/testsuites/libtests/malloc05/malloc05.doc new file mode 100644 index 0000000000..adeba1aaae --- /dev/null +++ b/testsuites/libtests/malloc05/malloc05.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: malloc05 + +directives: + + malloc_get_statistics + +concepts: + ++ Fully exercise malloc_get_statistics. diff --git a/testsuites/libtests/malloc05/malloc05.scn b/testsuites/libtests/malloc05/malloc05.scn new file mode 100644 index 0000000000..0331bf609f --- /dev/null +++ b/testsuites/libtests/malloc05/malloc05.scn @@ -0,0 +1,4 @@ +*** TEST MALLOC05 *** +malloc_get_statistics( NULL ) - returns -1 +malloc_get_statistics( &stats ) - returns -0 +*** END OF TEST MALLOC05 *** -- cgit v1.2.3