summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/malloctest
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 13:50:16 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 13:50:16 +0200
commitd7e68c96b46599c7f3277d04ec4d1107ac2ff594 (patch)
treebb3a1273e8eca5d87b81381d606b56a590be1f95 /testsuites/libtests/malloctest
parentscore: Delete _Chain_Append() (diff)
downloadrtems-d7e68c96b46599c7f3277d04ec4d1107ac2ff594.tar.bz2
malloc: Fix early realloc() allocation
Diffstat (limited to 'testsuites/libtests/malloctest')
-rw-r--r--testsuites/libtests/malloctest/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index acf25d7cc5..6123977ff7 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -1375,6 +1375,9 @@ static void test_early_malloc( void )
{
void *p;
char *q;
+ void *r;
+ void *s;
+ void *t;
p = malloc( 1 );
rtems_test_assert( p != NULL );
@@ -1387,6 +1390,20 @@ static void test_early_malloc( void )
rtems_test_assert( q[0] == 0 );
free( q );
+
+ r = realloc( q, 128 );
+ rtems_test_assert( r == q );
+
+ s = malloc( 1 );
+ rtems_test_assert( s != NULL );
+
+ free( s );
+
+ t = realloc( r, 256 );
+ rtems_test_assert( t != NULL );
+ rtems_test_assert( t != r );
+
+ free( t );
}
RTEMS_SYSINIT_ITEM(