Changeset 9f37fb1 in rtems


Ignore:
Timestamp:
Jun 25, 2013, 10:16:13 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
7c1fcff3
Parents:
b64e8dc0
git-author:
Sebastian Huber <sebastian.huber@…> (06/25/13 10:16:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/25/13 15:05:18)
Message:

sptests/sp18: Simplify

This avoids problems with debugging enabled.

Location:
testsuites/sptests/sp18
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/sp18/init.c

    rb64e8dc0 r9f37fb1  
    1212#endif
    1313
     14#include <rtems/libcsupport.h>
     15
    1416#include <tmacros.h>
    1517
     
    2325  rtems_id                task_id;
    2426  rtems_status_code       sc;
    25   bool                    sb;
    26   Heap_Information_block  start;
    27   Heap_Information_block  info;
    28   size_t                  stack_size;
     27  bool                    ok;
     28  uintptr_t               stack_size;
     29  rtems_resource_snapshot snapshot;
     30  void                   *greedy;
    2931
    3032  puts( "\n\n*** TEST 18 ***" );
    3133
    32   puts( "Init - rtems_workspace_get_information - OK" );
    33   sb = rtems_workspace_get_information( &start );
    34   rtems_test_assert( sb );
     34  greedy = rtems_workspace_greedy_allocate_all_except_largest( &stack_size );
     35  rtems_resource_snapshot_take( &snapshot );
    3536
    36   #if 0
    37     printf( "Init - workspace free = %d\n", start.Free.largest );
    38     printf( "Init - workspace free blocks = %d\n", start.Free.number );
    39   #endif
    40   rtems_test_assert( start.Free.number == 1 );
    41   stack_size = start.Free.largest;
    42 
    43   #if 0
    44     printf( "Init - start with stack size of = %d\n", stack_size );
    45   #endif
     37  /* Make sure the first allocation fails */
     38  ++stack_size;
    4639
    4740  puts( "Init - rtems_task_create - Unsatisfied on Extensions" );
     
    6558     * Verify heap is still in same shape if we couldn't allocate a task
    6659     */
    67     sb = rtems_workspace_get_information( &info );
    68     rtems_test_assert( sb );
    69     rtems_test_assert( info.Free.largest == start.Free.largest );
    70     rtems_test_assert( info.Free.number  == start.Free.number  );
     60    ok = rtems_resource_snapshot_check( &snapshot );
     61    rtems_test_assert( ok );
    7162
    7263    stack_size -= 8;
     
    8677
    8778  puts( "Init - verify workspace has same memory" );
    88   sb = rtems_workspace_get_information( &info );
    89   rtems_test_assert( sb );
    90   rtems_test_assert( info.Free.largest == start.Free.largest );
    91   rtems_test_assert( info.Free.number  == start.Free.number );
     79  ok = rtems_resource_snapshot_check( &snapshot );
     80  rtems_test_assert( ok );
     81
     82  rtems_workspace_greedy_free( greedy );
    9283
    9384  puts( "*** END OF TEST 18 ***" );
  • testsuites/sptests/sp18/sp18.scn

    rb64e8dc0 r9f37fb1  
    11*** TEST 18 ***
    2 Init - rtems_workspace_get_information - OK
    32Init - rtems_task_create - Unsatisfied on Extensions
    43Init - rtems_task_delete - OK
Note: See TracChangeset for help on using the changeset viewer.