source: rtems/testsuites/sptests/sp63/init.c @ ba23ff5

4.104.115
Last change on this file since ba23ff5 was ba23ff5, checked in by Joel Sherrill <joel.sherrill@…>, on 08/01/09 at 00:25:20

2009-07-31 Joel Sherrill <joel.sherrill@…>

  • 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.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <tmacros.h>
13
14uint32_t      Memory[256];
15
16rtems_task Init(
17  rtems_task_argument ignored
18)
19{
20  Heap_Control       Heap;
21  uint32_t           heap_size;
22  void              *ptr1;
23  intptr_t           old;
24  intptr_t           avail;
25  Heap_Resize_status hc;
26
27  puts( "\n\n*** TEST 63 ***" );
28 
29  puts( "Init - _Heap_Initialize - OK" );
30  heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
31  printf( "Init - Heap size=%d\n", heap_size );
32
33  puts( "Init - _Heap_Allocate_aligned - OK");
34  ptr1 = _Heap_Allocate_aligned( &Heap, 64, 32 );
35  assert( ptr1 );
36
37  puts( "Init - _Heap_Resize_block - OK");
38  hc = _Heap_Resize_block( &Heap, ptr1, 4, &old, &avail );
39  assert( !hc );
40
41  puts( "*** END OF TEST 63 ***" );
42
43  rtems_test_exit(0);
44}
45
46/* configuration information */
47
48#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
49#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
50
51#define CONFIGURE_MAXIMUM_TASKS         1
52#define CONFIGURE_MAXIMUM_REGIONS       1
53#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
54
55#define CONFIGURE_INIT
56#include <rtems/confdefs.h>
57
58/* global variables */
Note: See TracBrowser for help on using the repository browser.