forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2009-07-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-07-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* Makefile.am, configure.ac, sp62/init.c: Add new test to ensure a
|
* Makefile.am, configure.ac, sp62/init.c: Add new test to ensure a
|
||||||
|
|||||||
@@ -12,21 +12,17 @@
|
|||||||
#include <tmacros.h>
|
#include <tmacros.h>
|
||||||
|
|
||||||
uint32_t Memory[256];
|
uint32_t Memory[256];
|
||||||
|
|
||||||
rtems_task Init(
|
|
||||||
rtems_task_argument ignored
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Heap_Control Heap;
|
Heap_Control Heap;
|
||||||
|
|
||||||
|
void test_case_one(void)
|
||||||
|
{
|
||||||
uint32_t heap_size;
|
uint32_t heap_size;
|
||||||
void *ptr1;
|
void *ptr1;
|
||||||
intptr_t old;
|
intptr_t old;
|
||||||
intptr_t avail;
|
intptr_t avail;
|
||||||
Heap_Resize_status hc;
|
Heap_Resize_status hc;
|
||||||
|
|
||||||
puts( "\n\n*** TEST 63 ***" );
|
puts( "Init - _Heap_Initialize (for test one) - OK" );
|
||||||
|
|
||||||
puts( "Init - _Heap_Initialize - OK" );
|
|
||||||
heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
|
heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
|
||||||
printf( "Init - Heap size=%d\n", heap_size );
|
printf( "Init - Heap size=%d\n", heap_size );
|
||||||
|
|
||||||
@@ -37,6 +33,38 @@ rtems_task Init(
|
|||||||
puts( "Init - _Heap_Resize_block - OK");
|
puts( "Init - _Heap_Resize_block - OK");
|
||||||
hc = _Heap_Resize_block( &Heap, ptr1, 4, &old, &avail );
|
hc = _Heap_Resize_block( &Heap, ptr1, 4, &old, &avail );
|
||||||
assert( !hc );
|
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 ***" );
|
puts( "*** END OF TEST 63 ***" );
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
*** TEST 63 ***
|
*** 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 size=1012
|
||||||
Init - _Heap_Allocate_aligned - OK
|
Init - _Heap_Allocate_aligned - OK
|
||||||
Init - _Heap_Resize_block - OK
|
Init - _Heap_Resize_block - OK
|
||||||
|
|||||||
Reference in New Issue
Block a user