2009-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>

* sp63/init.c, sp63/sp63.scn: Add case for math on size requested
	overflowing on _Heap_Allocate_aligned.
This commit is contained in:
Joel Sherrill
2009-08-18 18:46:21 +00:00
parent 3a95c67925
commit 3a12177645
3 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2009-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp63/init.c, sp63/sp63.scn: Add case for math on size requested
overflowing on _Heap_Allocate_aligned.
2009-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* spobjgetnext/init.c, spobjgetnext/spobjgetnext.scn: Add error cases

View File

@@ -31,6 +31,10 @@ void test_case_one(void)
heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
printf( "Init - Heap size=%d\n", heap_size );
puts( "Init - _Heap_Allocate - too large size (overflow)- not OK");
ptr1 = _Heap_Allocate( &Heap, 0xffffffff );
assert( !ptr1 );
puts( "Init - _Heap_Allocate_aligned - OK");
ptr1 = _Heap_Allocate_aligned( &Heap, 64, 32 );
assert( ptr1 );

View File

@@ -1,11 +1,13 @@
*** TEST 63 ***
Init - _Heap_Initialize (for test one) - OK
Init - Heap size=1012
Init - Heap size=1000
Init - _Heap_Allocate - too large size (overflow)- not OK
Init - _Heap_Allocate_aligned - OK
Init - _Heap_Resize_block - OK
Init - _Heap_Initialize (for test two) - OK
Init - Heap size=1012
Init - Heap size=1000
Init - _Heap_Allocate_aligned - OK
Init - _Heap_Resize_block - OK
Init - _Heap_Allocate_aligned - request impossible - not OK
*** END OF TEST 63 ***