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 + + * 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 * 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', ' ' );