diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-01 00:25:20 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-01 00:25:20 +0000 |
commit | ba23ff5e3685e201d4338f4e1c566a3b84865a69 (patch) | |
tree | 0b209d08ed3b23dba9e618169ce3f9d70b8a739b /testsuites/sptests/sp63/init.c | |
parent | 2009-07-31 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-ba23ff5e3685e201d4338f4e1c566a3b84865a69.tar.bz2 |
2009-07-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, sp62/init.c: Add new test to ensure a
particular path is taken through the _Heap_Resize_block code.
* sp63/.cvsignore, sp63/Makefile.am, sp63/init.c, sp63/sp63.doc,
sp63/sp63.scn: New files.
Diffstat (limited to 'testsuites/sptests/sp63/init.c')
-rw-r--r-- | testsuites/sptests/sp63/init.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/testsuites/sptests/sp63/init.c b/testsuites/sptests/sp63/init.c new file mode 100644 index 0000000000..ac120cd6c9 --- /dev/null +++ b/testsuites/sptests/sp63/init.c @@ -0,0 +1,58 @@ +/* + * COPYRIGHT (c) 1989-2009. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <tmacros.h> + +uint32_t Memory[256]; + +rtems_task Init( + rtems_task_argument ignored +) +{ + 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" ); + 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, 4, &old, &avail ); + assert( !hc ); + + puts( "*** END OF TEST 63 ***" ); + + rtems_test_exit(0); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_REGIONS 1 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> + +/* global variables */ |