Changeset b0e81c96 in rtems


Ignore:
Timestamp:
Jun 7, 2010, 9:33:32 AM (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
b2a0214
Parents:
e66b4e9
Message:

2010-06-07 Sebastian Huber <sebastian.huber@…>

  • heapwalk/init.c, malloctest/init.c: Update for heap extend changes.
Location:
testsuites/libtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    re66b4e9 rb0e81c96  
     12010-06-07      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * heapwalk/init.c, malloctest/init.c: Update for heap extend changes.
     4
    152010-05-17      Sebastian Huber <sebastian.huber@embedded-brains.de>
    26
  • testsuites/libtests/heapwalk/init.c

    re66b4e9 rb0e81c96  
    128128  test_call_heap_walk( false );
    129129
    130   puts( "\tset the previous block size of the first block to an invalid value" );
    131   test_heap_init_custom();
    132   TestHeap.first_block->prev_size = 0;
    133   test_call_heap_walk( false );
    134 
    135130  puts( "\tset invalid next block for last block" );
    136131  test_heap_init_custom();
  • testsuites/libtests/malloctest/init.c

    re66b4e9 rb0e81c96  
    926926}
    927927
     928static void test_heap_assert(bool ret, bool expected)
     929{
     930  rtems_test_assert( ret == expected );
     931  rtems_test_assert( _Heap_Walk( &TestHeap, 0, false ) );
     932}
     933
    928934static void test_heap_extend(void)
    929935{
    930   bool      ret;
    931 
    932   /*
    933    * Easier to hit extend with a dedicated heap.
    934    *
    935    */
    936   _Heap_Initialize( &TestHeap, TestHeapMemory, 512, 0 );
    937 
    938   puts( "heap extend - bad address" );
    939   ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory - 512, 512 );
    940   rtems_test_assert( ret == false );
    941 
    942   puts( "heap extend - OK" );
    943   ret = _Protected_heap_Extend( &TestHeap, &TestHeapMemory[ 512 ], 512 );
    944   rtems_test_assert( ret == true );
     936  bool ret = false;
     937
     938  _Heap_Initialize( &TestHeap, TestHeapMemory + 768, 256, 0 );
     939
     940  puts( "heap extend - link below" );
     941  ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 0, 256 );
     942  test_heap_assert( ret, true );
     943
     944  puts( "heap extend - merge below" );
     945  ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 512, 256 );
     946  test_heap_assert( ret, true );
     947
     948  puts( "heap extend - merge above" );
     949  ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 1024, 256 );
     950  test_heap_assert( ret, true );
     951
     952  puts( "heap extend - link above" );
     953  ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 1536, 256 );
     954  test_heap_assert( ret, true );
     955
     956  puts( "heap extend - area too small" );
     957  ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 2048, 0 );
     958  test_heap_assert( ret, false );
     959
     960  puts( "heap extend - invalid area" );
     961  ret = _Protected_heap_Extend( &TestHeap, (void *) -1, 2 );
     962  test_heap_assert( ret, false );
    945963}
    946964
Note: See TracChangeset for help on using the changeset viewer.