summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-05 22:17:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-05 22:17:52 +0000
commitc30fcf522c7c703e36494609af52c532cd06b365 (patch)
tree2a4025d75009e10e0b7f59f25fc3707b1ce213dd /testsuites/libtests
parent2009-06-05 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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')
-rw-r--r--testsuites/libtests/ChangeLog4
-rw-r--r--testsuites/libtests/heapwalk/heapwalk.scn3
-rw-r--r--testsuites/libtests/heapwalk/init.c22
3 files changed, 29 insertions, 0 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index 9e218c40bf..2720adecf3 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -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.
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);