summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-12 23:10:48 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-12 23:10:48 +0000
commit9202c24e3ee7aee00c1916bda08e72ca627ad212 (patch)
tree7a441d7be435f1201c7259d612661c798174bbc1 /testsuites/libtests
parent2007-12-12 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-9202c24e3ee7aee00c1916bda08e72ca627ad212.tar.bz2
2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com>
* malloctest/init.c: Add some primitive testing of realloc() which also does some positive path testing on the SuperCore heap.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/ChangeLog5
-rw-r--r--testsuites/libtests/malloctest/init.c17
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index dee0268d2f..26293492cc 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * malloctest/init.c: Add some primitive testing of realloc() which also
+ does some positive path testing on the SuperCore heap.
+
2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* cpuuse/task2.c, rtmonuse/rtmonuse.scn, rtmonuse/task1.c: Add new
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index 1fcfd597ce..bd5206736c 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -24,6 +24,21 @@
#define TEST_INIT
#include "system.h"
+/*
+ * A simple test of realloc
+ */
+void test_realloc(void)
+{
+ void *p1, *p2;
+ int i;
+
+ p2 = p1 = malloc(1);
+ for (i=2 ; i<2048 ; i++)
+ p2 = realloc(p2, i);
+
+ free(p2);
+}
+
rtems_task Init(
rtems_task_argument argument
)
@@ -37,6 +52,8 @@ rtems_task Init(
status = rtems_clock_set( &time );
directive_failed( status, "rtems_clock_set" );
+ test_realloc();
+
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );