Changeset b7bc1d1 in rtems


Ignore:
Timestamp:
Jan 29, 2008, 5:28:49 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
1ff7e19
Parents:
e0a66c15
Message:

2008-01-29 Joel Sherrill <joel.sherrill@…>

  • malloctest/init.c: Add more tests per suggestions from Sergei Organov.
Location:
testsuites/libtests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    re0a66c15 rb7bc1d1  
     12008-01-29      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * malloctest/init.c: Add more tests per suggestions from Sergei
     4        Organov.
     5
    162008-01-24      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • testsuites/libtests/malloctest/init.c

    re0a66c15 rb7bc1d1  
    3434void test_realloc(void)
    3535{
    36   void *p1, *p2, *p3;
     36  void *p1, *p2, *p3, *p4;
    3737  int i;
    3838  int sc;
     
    8383
    8484  /*
    85    *  Bad hack to get coverage
    86    */
    87 
    88   {
    89     void *p5;
    90     extern Heap_Control RTEMS_Malloc_Heap;
    91     p5 = _Protected_heap_Allocate_aligned( &RTEMS_Malloc_Heap, 8, 0 );
    92     if ( p5 )
    93       free( p5 );
    94   }
     85   *  Allocate with default alignment coverage
     86   */
     87  sc = rtems_memalign( &p4, 0, 8 );
     88  if ( !sc && p4 )
     89    free( p4 );
     90
     91  /*
     92   * Walk the C Program Heap
     93   */
     94  malloc_walk( 1234, 0 );
     95
     96  /*
     97   *  Realloc with a bad pointer to force a point
     98   */
     99  p4 = realloc( test_realloc, 32 );
     100
     101  /*
     102   * Another odd case.  What we are trying to do from Sergei
     103   *
     104   * 32-bit CPU when CPU_ALIGNMENT = 4 (most targets have 8) with the
     105   * code like this:
     106   */
     107   p1 = malloc(12);
     108   p2 = malloc(32);
     109   p3 = malloc(32);
     110   free(p2);
     111   sc = rtems_memalign(&p2, 8, 28);
     112   free(p1);
     113   free(p2);
     114   free(p3);
     115
     116   /*
     117    *  Odd case in resizing a block.  Again test case outline per Sergei
     118    */
     119   p1 = malloc(32);
     120   p2 = malloc(8);
     121   p3 = malloc(32);
     122   free(p2);
     123   p4 = realloc(p1, 42);
     124   free(p3);
     125   free(p4);
     126
    95127}
    96128
Note: See TracChangeset for help on using the changeset viewer.