diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-01 14:40:37 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-01 14:40:37 +0000 |
commit | fa4c10cbd9df4437bc63b36d55a8d389bc3621ab (patch) | |
tree | 02993634aa1427ab3ff67d582da3883c6a076d7e /testsuites/sptests/sp63 | |
parent | 2009-07-31 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-fa4c10cbd9df4437bc63b36d55a8d389bc3621ab.tar.bz2 |
2009-08-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp63/init.c, sp63/sp63.scn: Move into subroutines and add a second
test case to exercise another odd branch not taken.
Diffstat (limited to 'testsuites/sptests/sp63')
-rw-r--r-- | testsuites/sptests/sp63/init.c | 42 | ||||
-rw-r--r-- | testsuites/sptests/sp63/sp63.scn | 7 |
2 files changed, 41 insertions, 8 deletions
diff --git a/testsuites/sptests/sp63/init.c b/testsuites/sptests/sp63/init.c index ac120cd6c9..f4415b1282 100644 --- a/testsuites/sptests/sp63/init.c +++ b/testsuites/sptests/sp63/init.c @@ -12,21 +12,17 @@ #include <tmacros.h> uint32_t Memory[256]; +Heap_Control Heap; -rtems_task Init( - rtems_task_argument ignored -) +void test_case_one(void) { - Heap_Control Heap; uint32_t heap_size; void *ptr1; intptr_t old; intptr_t avail; Heap_Resize_status hc; - puts( "\n\n*** TEST 63 ***" ); - - puts( "Init - _Heap_Initialize - OK" ); + puts( "Init - _Heap_Initialize (for test one) - OK" ); heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 ); printf( "Init - Heap size=%d\n", heap_size ); @@ -37,6 +33,38 @@ rtems_task Init( puts( "Init - _Heap_Resize_block - OK"); hc = _Heap_Resize_block( &Heap, ptr1, 4, &old, &avail ); assert( !hc ); +} + +void test_case_two(void) +{ + uint32_t heap_size; + void *ptr1; + intptr_t old; + intptr_t avail; + Heap_Resize_status hc; + + puts( "\nInit - _Heap_Initialize (for test two) - OK" ); + heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 ); + printf( "Init - Heap size=%d\n", heap_size ); + + puts( "Init - _Heap_Allocate_aligned - OK"); + ptr1 = _Heap_Allocate_aligned( &Heap, 64, 32 ); + assert( ptr1 ); + + puts( "Init - _Heap_Resize_block - OK"); + hc = _Heap_Resize_block( &Heap, ptr1, 56, &old, &avail ); + assert( !hc ); +} + +rtems_task Init( + rtems_task_argument ignored +) +{ + puts( "\n\n*** TEST 63 ***" ); + + test_case_one(); + + test_case_two(); puts( "*** END OF TEST 63 ***" ); diff --git a/testsuites/sptests/sp63/sp63.scn b/testsuites/sptests/sp63/sp63.scn index 766fbe9c9b..592572492e 100644 --- a/testsuites/sptests/sp63/sp63.scn +++ b/testsuites/sptests/sp63/sp63.scn @@ -1,5 +1,10 @@ *** TEST 63 *** -Init - _Heap_Initialize - OK +Init - _Heap_Initialize (for test one) - OK +Init - Heap size=1012 +Init - _Heap_Allocate_aligned - OK +Init - _Heap_Resize_block - OK + +Init - _Heap_Initialize (for test two) - OK Init - Heap size=1012 Init - _Heap_Allocate_aligned - OK Init - _Heap_Resize_block - OK |