Changeset ce217f96 in rtems


Ignore:
Timestamp:
Mar 9, 2011, 3:39:58 PM (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
b1e13f4
Parents:
9d5f600
Message:

2011-03-09 Sebastian Huber <sebastian.huber@…>

  • malloctest/init.c: Improve coverage.
  • malloctest/malloctest.scn: Update.
Location:
testsuites/libtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    r9d5f600 rce217f96  
     12011-03-09      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * malloctest/init.c: Improve coverage.
     4        * malloctest/malloctest.scn: Update.
     5
    162011-02-22      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • testsuites/libtests/malloctest/init.c

    r9d5f600 rce217f96  
    941941{
    942942  bool ret = false;
    943 
    944   _Heap_Initialize( &TestHeap, TestHeapMemory + 768, 256, 0 );
     943  Heap_Control *heap = &TestHeap;
     944  uint8_t *area_begin = TestHeapMemory;
     945
     946  _Heap_Initialize( heap, area_begin + 768, 256, 0 );
    945947
    946948  puts( "heap extend - link below" );
    947   ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 0, 256 );
     949  ret = _Protected_heap_Extend( heap, area_begin + 0, 256 );
    948950  test_heap_assert( ret, true );
    949951
    950952  puts( "heap extend - merge below" );
    951   ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 512, 256 );
     953  ret = _Protected_heap_Extend( heap, area_begin + 512, 256 );
    952954  test_heap_assert( ret, true );
    953955
    954956  puts( "heap extend - merge above" );
    955   ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 1024, 256 );
     957  ret = _Protected_heap_Extend( heap, area_begin + 1024, 256 );
    956958  test_heap_assert( ret, true );
    957959
    958960  puts( "heap extend - link above" );
    959   ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 1536, 256 );
     961  ret = _Protected_heap_Extend( heap, area_begin + 1536, 256 );
    960962  test_heap_assert( ret, true );
    961963
    962964  puts( "heap extend - area too small" );
    963   ret = _Protected_heap_Extend( &TestHeap, TestHeapMemory + 2048, 0 );
     965  ret = _Protected_heap_Extend( heap, area_begin + 2048, 0 );
    964966  test_heap_assert( ret, false );
    965967
    966968  puts( "heap extend - invalid area" );
    967   ret = _Protected_heap_Extend( &TestHeap, (void *) -1, 2 );
     969  ret = _Protected_heap_Extend( heap, (void *) -1, 2 );
    968970  test_heap_assert( ret, false );
     971
     972  area_begin = (uint8_t *) (((uintptr_t) area_begin) | 1);
     973
     974  _Heap_Initialize( heap, area_begin + 768, 256, 0 );
     975
     976  puts( "heap extend - merge below with align up" );
     977  ret = _Protected_heap_Extend( heap, area_begin + 512, 256 );
     978  test_heap_assert( ret, true );
    969979}
    970980
  • testsuites/libtests/malloctest/malloctest.scn

    r9d5f600 rce217f96  
    4545malloc_walk - in critical section path
    4646Heap Initialized
    47 heap extend - bad address
    48 heap extend - OK
     47heap extend - link below
     48heap extend - merge below
     49heap extend - merge above
     50heap extend - link above
     51heap extend - area too small
     52heap extend - invalid area
     53heap extend - merge below with align up
    4954malloc_free_space - check malloc space drops after malloc
    5055malloc_free_space - verify free space returns to previous value
Note: See TracChangeset for help on using the changeset viewer.