diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-05 22:17:52 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-05 22:17:52 +0000 |
commit | c30fcf522c7c703e36494609af52c532cd06b365 (patch) | |
tree | 2a4025d75009e10e0b7f59f25fc3707b1ce213dd /testsuites/libtests/heapwalk | |
parent | 2009-06-05 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-c30fcf522c7c703e36494609af52c532cd06b365.tar.bz2 |
2009-06-05 Santosh G Vattam <vattam.santosh@gmail.com>
* heapwalk/heapwalk.scn, heapwalk/init.c: Add a test case.
Diffstat (limited to 'testsuites/libtests/heapwalk')
-rw-r--r-- | testsuites/libtests/heapwalk/heapwalk.scn | 3 | ||||
-rw-r--r-- | testsuites/libtests/heapwalk/init.c | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/testsuites/libtests/heapwalk/heapwalk.scn b/testsuites/libtests/heapwalk/heapwalk.scn index 8a1f9cd806..4d41167903 100644 --- a/testsuites/libtests/heapwalk/heapwalk.scn +++ b/testsuites/libtests/heapwalk/heapwalk.scn @@ -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 *** diff --git a/testsuites/libtests/heapwalk/init.c b/testsuites/libtests/heapwalk/init.c index 1aeadb4be4..ef7732b905 100644 --- a/testsuites/libtests/heapwalk/init.c +++ b/testsuites/libtests/heapwalk/init.c @@ -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); |