summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp63
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-26 02:13:38 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-26 02:13:38 +0000
commitbd039332dd319bb1caf03ae1ecd835e0446d48b7 (patch)
treebad9598a99e31a9ed6a8d565c8504bd3b70fe308 /testsuites/sptests/sp63
parent2009-08-25 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-bd039332dd319bb1caf03ae1ecd835e0446d48b7.tar.bz2
2009-08-25 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* sp59/init.c, sp59/sp59.scn: Added status code assignment. Fixed typos. * sp63/init.c: Check return value of _Heap_Initialize().
Diffstat (limited to 'testsuites/sptests/sp63')
-rw-r--r--testsuites/sptests/sp63/init.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/testsuites/sptests/sp63/init.c b/testsuites/sptests/sp63/init.c
index ee551d817a..c0a704caca 100644
--- a/testsuites/sptests/sp63/init.c
+++ b/testsuites/sptests/sp63/init.c
@@ -30,6 +30,7 @@ void test_case_one(void)
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 );
+ assert( heap_size );
puts( "Init - _Heap_Allocate - too large size (overflow)- not OK");
ptr1 = _Heap_Allocate( &Heap, 0xffffffff );
@@ -59,6 +60,7 @@ void test_case_two(void)
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 );
+ assert( heap_size );
puts( "Init - _Heap_Allocate_aligned - OK");
ptr1 = _Heap_Allocate_aligned( &Heap, 64, 4 );
@@ -97,9 +99,11 @@ void test_case_three(void)
for ( alloc=4 ; alloc < sizeof(Memory)/2 ; alloc+=4 ) {
heap_size =
_Heap_Initialize( &Heap, &Memory[sz], sizeof(Memory)/2, 1 << pg );
- do {
- ptr1 = _Heap_Allocate_aligned( &Heap, alloc, 1 <<al );
- } while ( ptr1 );
+ if ( heap_size != 0 ) {
+ do {
+ ptr1 = _Heap_Allocate_aligned( &Heap, alloc, 1 <<al );
+ } while ( ptr1 );
+ }
}
}
}