forked from Imagelibrary/rtems
2009-06-05 Santosh G Vattam <vattam.santosh@gmail.com>
* heapwalk/heapwalk.scn, heapwalk/init.c: Add a test case.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2009-06-05 Santosh G Vattam <vattam.santosh@gmail.com>
|
||||
|
||||
* heapwalk/heapwalk.scn, heapwalk/init.c: Add a test case.
|
||||
|
||||
2009-05-19 Chris Johns <chrisj@rtems.org>
|
||||
|
||||
* cpuuse/tswitch.c: Lower sample count for small memory targets.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
*** HEAP WALK TEST ***
|
||||
Calling Heap Walk without initialising
|
||||
PASS: 1 !HEAP_PREV_USED flag of 1st block isn't set
|
||||
Walk freshly initialized heap
|
||||
Passing negative value for source
|
||||
*** END OF HEAP WALK TEST ***
|
||||
|
||||
@@ -33,7 +33,27 @@ void test_walk_freshly_initialized(void)
|
||||
{
|
||||
puts( "Walk freshly initialized heap" );
|
||||
test_heap_init();
|
||||
_Heap_Walk( &TestHeap, 0x01, true );
|
||||
}
|
||||
|
||||
void test_negative_source_value(void)
|
||||
{
|
||||
test_heap_init();
|
||||
/* Passing a negative value for source so that
|
||||
* the control enters the if block on line 67
|
||||
*/
|
||||
puts( "Passing negative value for source" );
|
||||
_Heap_Walk( &TestHeap, -1, true );
|
||||
|
||||
}
|
||||
|
||||
void test_prev_block_flag_check(void)
|
||||
{
|
||||
/* Calling heapwalk without initialising the heap.
|
||||
* Covers line 80 and 85 on heapwalk.
|
||||
* Actually covers more than that.
|
||||
*/
|
||||
puts( "Calling Heap Walk without initialising" );
|
||||
_Heap_Walk( &TestHeap, 0x01, true );
|
||||
}
|
||||
|
||||
@@ -43,7 +63,9 @@ rtems_task Init(
|
||||
{
|
||||
puts( "\n\n*** HEAP WALK TEST ***" );
|
||||
|
||||
test_prev_block_flag_check();
|
||||
test_walk_freshly_initialized();
|
||||
test_negative_source_value();
|
||||
|
||||
puts( "*** END OF HEAP WALK TEST ***" );
|
||||
rtems_test_exit(0);
|
||||
|
||||
Reference in New Issue
Block a user