diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-07 17:08:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-07 17:08:28 +0000 |
commit | 8814cf04cc3f50ea78e8b645b74ae46b462e037a (patch) | |
tree | 9f9abae5605b7286494bdb0db24a2c2d31dea985 /testsuites/libtests | |
parent | libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h: Added (diff) | |
download | rtems-8814cf04cc3f50ea78e8b645b74ae46b462e037a.tar.bz2 |
2009-05-07 Santosh G Vattam <vattam.santosh@gmail.com>
* malloctest/init.c: Add test case for heap resize block when the
resize creates a free block large enough to free.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r-- | testsuites/libtests/ChangeLog | 5 | ||||
-rw-r--r-- | testsuites/libtests/malloctest/init.c | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 2f1d72168c..63e31bc024 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,8 @@ +2009-05-07 Santosh G Vattam <vattam.santosh@gmail.com> + + * malloctest/init.c: Add test case for heap resize block when the + resize creates a free block large enough to free. + 2009-04-03 Ralf Corsépius <ralf.corsepius@rtems.org> * cpuuse/Makefile.am, malloctest/Makefile.am, diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c index 37c9e4d762..2ca8197e5c 100644 --- a/testsuites/libtests/malloctest/init.c +++ b/testsuites/libtests/malloctest/init.c @@ -150,6 +150,25 @@ void test_heap_cases_1() /* XXX what should we expect */ _Heap_Free( &TestHeap, p3 ); _Heap_Free( &TestHeap, p4 ); + _Heap_Free( &TestHeap, p1 ); + + /* + * To tackle a special case of resizing a block in order to cover the + * code in heapresizeblock.c + * + * Re-initialise the heap, so that the blocks created from now on + * are contiguous. + */ + test_heap_init(); + puts( "Heap Initialized" ); + p1 = _Heap_Allocate( &TestHeap, 500 ); + rtems_test_assert( p2 != NULL ); + p2 = _Heap_Allocate( &TestHeap, 500 ); + rtems_test_assert( p2 != NULL ); + rsc = _Heap_Resize_block( &TestHeap, p1, 256, &u1, &u2 ); + rtems_test_assert( rsc == HEAP_RESIZE_SUCCESSFUL ); + _Heap_Free( &TestHeap, p1 ); + _Heap_Free( &TestHeap, p2 ); } void test_heap_extend() |