summaryrefslogtreecommitdiff
path: root/testsuites/libtests/heapwalk/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-07 17:48:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-07 17:48:15 +0000
commit56b7951e4563580d96b5d2249e2d3e3d62d48120 (patch)
tree363896937fe539f082bbc0a5d891e9e295ff8d1f /testsuites/libtests/heapwalk/init.c
parent8814cf04cc3f50ea78e8b645b74ae46b462e037a (diff)
2009-05-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add shell of heap walk test for Santosh. * heapwalk/.cvsignore, heapwalk/Makefile.am, heapwalk/heapwalk.scn, heapwalk/init.c, heapwalk/system.h: New files.
Diffstat (limited to 'testsuites/libtests/heapwalk/init.c')
-rw-r--r--testsuites/libtests/heapwalk/init.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/testsuites/libtests/heapwalk/init.c b/testsuites/libtests/heapwalk/init.c
new file mode 100644
index 0000000000..1aeadb4be4
--- /dev/null
+++ b/testsuites/libtests/heapwalk/init.c
@@ -0,0 +1,50 @@
+/*
+ * Test of Heap Walker
+ *
+ * COPYRIGHT (c) 1989-2008.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
+#define CONFIGURE_INIT
+#include "system.h"
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <rtems/score/heap.h>
+
+#define TEST_HEAP_SIZE 1024
+uint8_t TestHeapMemory[TEST_HEAP_SIZE];
+Heap_Control TestHeap;
+
+void test_heap_init(void)
+{
+ _Heap_Initialize( &TestHeap, TestHeapMemory, TEST_HEAP_SIZE, 0 );
+}
+
+void test_walk_freshly_initialized(void)
+{
+ puts( "Walk freshly initialized heap" );
+ test_heap_init();
+
+ _Heap_Walk( &TestHeap, 0x01, true );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ puts( "\n\n*** HEAP WALK TEST ***" );
+
+ test_walk_freshly_initialized();
+
+ puts( "*** END OF HEAP WALK TEST ***" );
+ rtems_test_exit(0);
+}