Changeset b2f05456 in rtems


Ignore:
Timestamp:
Sep 9, 2009, 4:30:14 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
f52ba58
Parents:
809fb589
Message:

2009-09-09 Sebastian Huber <Sebastian.Huber@…>

  • heapwalk/heapwalk.scn, heapwalk/init.c: Add missing _Heap_Walk test cases to get back to 100% object coverage.
Location:
testsuites/libtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    r809fb589 rb2f05456  
     12009-09-09      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
     2
     3        * heapwalk/heapwalk.scn, heapwalk/init.c: Add missing _Heap_Walk test
     4        cases to get back to 100% object coverage.
     5
    162009-09-09      Christian Mauderer <christian.mauderer@embedded-brains.de>
    27
  • testsuites/libtests/heapwalk/heapwalk.scn

    r809fb589 rb2f05456  
    55        set page size to a not CPU-aligned value
    66        set minimal block size to a not page aligned value
    7         let the alloc area of the first block be not page-aligned
     7        set allocation area of the first block to be non page-aligned
    88        clear the previous used flag of the first block
    99        set the previous block size of the first block to an invalid value
     
    2222        create a block with a size smaller than the min_block_size
    2323        make a block with a size, so that the block reaches into the next block
     24        create a block with invalid successor
    2425        make a block with a size, so that it includes the next block
    2526test the _Heap_Walk_check_free_block() function
     
    3031therefore use the (already tested) case with a page size of 0
    3132PASS[0]: page size 0, min block size 16
    32         area begin 0x????????, area end 0x????????
    33         first block 0x????????, last block 0x????????
    34         first free 0x????????, last free 0x????????
     33        area begin 0x0202C4BC, area end 0x0202D4BC
     34        first block 0x0202C4C0, last block 0x0202D4B0
     35        first free 0x0202C4C0, last free 0x0202C4C0
    3536FAIL[0]: page size is zero
    3637*** END OF HEAP WALK TEST ***
  • testsuites/libtests/heapwalk/init.c

    r809fb589 rb2f05456  
    118118  test_call_heap_walk( false );
    119119
    120   /*
    121    * Set the page size to a value, other than the first block alloc area.  Set
    122    * even the min_block_size to that value to avoid it being not alligned.
    123    */
    124   puts( "\tlet the alloc area of the first block be not page-aligned" );
    125   test_heap_init_custom();
    126   TestHeap.page_size = (uintptr_t) TestHeap.first_block + CPU_ALIGNMENT;
    127   TestHeap.min_block_size = TestHeap.page_size;
     120  puts( "\tset allocation area of the first block to be non page-aligned" );
     121  test_heap_init_custom();
     122  TestHeap.first_block = (Heap_Block *) ((char *) TestHeap.first_block + CPU_ALIGNMENT);
    128123  test_call_heap_walk( false );
    129124
     
    249244  block = _Heap_Block_of_alloc_area( (uintptr_t) p1, TestHeap.page_size  );
    250245  block->size_and_flag = ( 3 * _Heap_Block_size( block ) / 2 ) | HEAP_PREV_BLOCK_USED;
     246  test_call_heap_walk( false );
     247
     248  puts( "\tcreate a block with invalid successor" );
     249  test_heap_init_default();
     250  test_allocate_block();
     251  p1 = test_allocate_block();
     252  block = _Heap_Block_of_alloc_area( (uintptr_t) p1, TestHeap.page_size  );
     253  block->size_and_flag = (0 - TestHeap.page_size) | HEAP_PREV_BLOCK_USED;
    251254  test_call_heap_walk( false );
    252255
Note: See TracChangeset for help on using the changeset viewer.