summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-18 18:46:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-18 18:46:21 +0000
commit3a121776450c5ba37637119d48094d59f2e2d5c2 (patch)
treef754847b2ff2d09e6b822589114532eb14f2923d /testsuites
parent2009-08-18 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-3a121776450c5ba37637119d48094d59f2e2d5c2.tar.bz2
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.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog5
-rw-r--r--testsuites/sptests/sp63/init.c4
-rw-r--r--testsuites/sptests/sp63/sp63.scn6
3 files changed, 13 insertions, 2 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 79db688ce5..cd970e6ddc 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,5 +1,10 @@
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
for various null parameters.
diff --git a/testsuites/sptests/sp63/init.c b/testsuites/sptests/sp63/init.c
index 4d4c63f73d..ee551d817a 100644
--- a/testsuites/sptests/sp63/init.c
+++ b/testsuites/sptests/sp63/init.c
@@ -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 );
diff --git a/testsuites/sptests/sp63/sp63.scn b/testsuites/sptests/sp63/sp63.scn
index 592572492e..8f603a6867 100644
--- a/testsuites/sptests/sp63/sp63.scn
+++ b/testsuites/sptests/sp63/sp63.scn
@@ -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 ***