summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/malloctest
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-05-05 16:45:47 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-05-05 16:45:47 +0000
commit6f27ba8077b83c9e00d0b297eb18e9f08c8225a8 (patch)
treefa7dbf84cc523c17ade54bdde4976dd662d827b2 /testsuites/libtests/malloctest
parent2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-6f27ba8077b83c9e00d0b297eb18e9f08c8225a8.tar.bz2
2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* devnullfatal01/testcase.h, malloc02/init.c, malloc04/init.c, malloctest/init.c, termios03/termios_testdriver_polled.c, termios04/termios_testdriver_intr.c: Remove warnings.
Diffstat (limited to 'testsuites/libtests/malloctest')
-rw-r--r--testsuites/libtests/malloctest/init.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index 35cb0c7f72..89797d8554 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -11,7 +11,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-2009.
+ * COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* Copyright (c) 2009, 2010 embedded brains GmbH.
@@ -420,15 +420,11 @@ static void test_heap_allocate(void)
uintptr_t previous_last_block_begin = 0;
uintptr_t previous_last_page_begin = 0;
- uintptr_t first_block_begin = 0;
-
uintptr_t last_block_begin = 0;
uintptr_t last_alloc_begin = 0;
test_heap_init( TEST_DEFAULT_PAGE_SIZE );
- first_block_begin = (uintptr_t) TestHeap.first_block;
-
last_block_begin = (uintptr_t) TestHeap.last_block;
last_alloc_begin = _Heap_Alloc_area_of_block( TestHeap.last_block );
@@ -467,6 +463,8 @@ static void test_heap_allocate(void)
alloc_size = test_page_size();
p1 = test_init_and_alloc_simple( alloc_size, alignment, boundary );
p2 = test_alloc_simple( alloc_size, alignment, boundary );
+ rtems_test_assert( p2 );
+
test_free( p1 );
alloc_size = 2 * alloc_size;
@@ -890,7 +888,11 @@ static void test_heap_resize_block(void)
puts( "\t\tlet the next block be used alredy and try to get a size bigger than the actual block" );
test_heap_init( TEST_DEFAULT_PAGE_SIZE );
p1 = test_alloc_one_page();
+ rtems_test_assert( p1 );
+
p2 = test_alloc_one_page();
+ rtems_test_assert( p2 );
+
new_alloc_size = 3 * TEST_DEFAULT_PAGE_SIZE / 2;
test_simple_resize_block( p1, new_alloc_size, HEAP_RESIZE_UNSATISFIED );
@@ -903,8 +905,14 @@ static void test_heap_resize_block(void)
puts( "\t\tlet the block after the next be used and try to allocate more then one pagesize more" );
test_heap_init( TEST_DEFAULT_PAGE_SIZE );
p1 = test_alloc_one_page();
+ rtems_test_assert( p1 );
+
p2 = test_alloc_one_page();
+ rtems_test_assert( p2 );
+
p3 = test_alloc_one_page();
+ rtems_test_assert( p3 );
+
_Heap_Free( &TestHeap, p2 );
new_alloc_size = 5 * TEST_DEFAULT_PAGE_SIZE / 2;
test_simple_resize_block( p1, new_alloc_size, HEAP_RESIZE_UNSATISFIED );