summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-14 23:29:45 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-14 23:29:45 +0000
commit8911ffd33fe83c040fee9aac29e03c83f6cb60d2 (patch)
tree0e37185458ccfc7d58887ba7a952f976bbbf4a8d /testsuites
parent2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-8911ffd33fe83c040fee9aac29e03c83f6cb60d2.tar.bz2
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.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/ChangeLog7
-rw-r--r--testsuites/libtests/Makefile.am2
-rw-r--r--testsuites/libtests/configure.ac1
-rw-r--r--testsuites/libtests/malloc05/.cvsignore2
-rw-r--r--testsuites/libtests/malloc05/Makefile.am26
-rw-r--r--testsuites/libtests/malloc05/init.c49
-rw-r--r--testsuites/libtests/malloc05/malloc05.doc22
-rw-r--r--testsuites/libtests/malloc05/malloc05.scn4
8 files changed, 112 insertions, 1 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index 28b9dd9916..249b421cfd 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -1,5 +1,12 @@
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
* malloc04/init.c, malloc04/malloc04.scn: Address issues in test. A mix
of work by Ralf and Joel.
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 <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 */
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 ***