Changeset 9e7d02a3 in rtems


Ignore:
Timestamp:
Dec 8, 2009, 5:52:56 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
9f90987b
Parents:
2317457
Message:

2009-12-08 Joel Sherrill <joel.sherrill@…>

  • sp18/init.c, sp31/task1.c, sp43/init.c, sp63/init.c, sp64/init.c, spfatal10/testcase.h, spfatal11/testcase.h, spobjgetnext/init.c, spwkspace/init.c: Use rtems_test_assert() consistently instead of system assert(). rtems_test_assert() is designed to integrate into the RTEMS test suite infrastructure.
Location:
testsuites/sptests
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    r2317457 r9e7d02a3  
     12009-12-08      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * sp18/init.c, sp31/task1.c, sp43/init.c, sp63/init.c, sp64/init.c,
     4        spfatal10/testcase.h, spfatal11/testcase.h, spobjgetnext/init.c,
     5        spwkspace/init.c: Use rtems_test_assert() consistently instead of
     6        system assert(). rtems_test_assert() is designed to integrate into
     7        the RTEMS test suite infrastructure.
     8
    192009-12-04      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
    210
  • testsuites/sptests/sp18/init.c

    r2317457 r9e7d02a3  
    2727  puts( "Init - rtems_workspace_get_information - OK" );
    2828  sb = rtems_workspace_get_information( &start );
    29   assert( sb );
     29  rtems_test_assert( sb );
    3030
    3131  #if 0
     
    3333    printf( "Init - workspace free blocks = %d\n", start.Free.number );
    3434  #endif
    35   assert( start.Free.number == 1 );
     35  rtems_test_assert( start.Free.number == 1 );
    3636  stack_size = start.Free.largest;
    3737
     
    6161     */
    6262    sb = rtems_workspace_get_information( &info );
    63     assert( sb );
    64     assert( info.Free.largest == start.Free.largest );
    65     assert( info.Free.number  == start.Free.number  );
     63    rtems_test_assert( sb );
     64    rtems_test_assert( info.Free.largest == start.Free.largest );
     65    rtems_test_assert( info.Free.number  == start.Free.number  );
    6666
    6767    stack_size -= 8;
     
    8282  puts( "Init - verify workspace has same memory" );
    8383  sb = rtems_workspace_get_information( &info );
    84   assert( sb );
    85   assert( info.Free.largest == start.Free.largest );
    86   assert( info.Free.number  == start.Free.number  );
     84  rtems_test_assert( sb );
     85  rtems_test_assert( info.Free.largest == start.Free.largest );
     86  rtems_test_assert( info.Free.number  == start.Free.number  );
    8787
    8888  puts( "*** END OF TEST 18 ***" );
  • testsuites/sptests/sp31/task1.c

    r2317457 r9e7d02a3  
    141141  printf( "Timer Server scheduled for %" PRIdWatchdog_Interval " ticks since boot\n",
    142142    schedule_time() );
    143   assert(  (info.start_time + info.initial) == schedule_time() );
     143  rtems_test_assert(  (info.start_time + info.initial) == schedule_time() );
    144144
    145145  puts( "TA1 - rtems_task_wake_after - 1 second" );
     
    158158  printf( "Timer Server scheduled for %" PRIdWatchdog_Interval " ticks since boot\n",
    159159    schedule_time() );
    160   assert(  (info.start_time + info.initial) == schedule_time() );
     160  rtems_test_assert(  (info.start_time + info.initial) == schedule_time() );
    161161
    162162  puts( "TA1 - rtems_timer_cancel - timer 1" );
  • testsuites/sptests/sp43/init.c

    r2317457 r9e7d02a3  
    271271
    272272  puts( "rtems_build_id - build an id to match init task" );
    273   tmpId = rtems_build_id( OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TASKS, 1, 1 ),
    274   assert( tmpId == main_task );
     273  tmpId = rtems_build_id( OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TASKS, 1, 1 );
     274  rtems_test_assert( tmpId == main_task );
    275275
    276276  puts( "rtems_object_id_get_api - OK" );
    277277  part = rtems_object_id_get_api( main_task );
    278   assert( part == OBJECTS_CLASSIC_API );
     278  rtems_test_assert( part == OBJECTS_CLASSIC_API );
    279279
    280280  puts( "rtems_object_id_get_class - OK" );
    281281  part = rtems_object_id_get_class( main_task );
    282   assert( part == OBJECTS_RTEMS_TASKS );
     282  rtems_test_assert( part == OBJECTS_RTEMS_TASKS );
    283283
    284284  puts( "rtems_object_id_get_node - OK" );
    285285  part = rtems_object_id_get_node( main_task );
    286   assert( part == 1 );
     286  rtems_test_assert( part == 1 );
    287287
    288288  puts( "rtems_object_id_get_index - OK" );
    289289  part = rtems_object_id_get_index( main_task );
    290   assert( part == 1 );
     290  rtems_test_assert( part == 1 );
    291291
    292292  /*
  • testsuites/sptests/sp63/init.c

    r2317457 r9e7d02a3  
    3131  heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
    3232  printf( "Init - Heap size=%" PRIu32 "\n", heap_size );
    33   assert( heap_size );
     33  rtems_test_assert( heap_size );
    3434
    3535  puts( "Init - _Heap_Allocate - too large size (overflow)- not OK");
    3636  ptr1 = _Heap_Allocate( &Heap, UINTPTR_MAX );
    37   assert( !ptr1 );
     37  rtems_test_assert( !ptr1 );
    3838
    3939  puts( "Init - _Heap_Allocate_aligned - OK");
    4040  ptr1 = _Heap_Allocate_aligned( &Heap, 64, 32 );
    41   assert( ptr1 );
     41  rtems_test_assert( ptr1 );
    4242
    4343  puts( "Init - _Heap_Resize_block - OK");
    4444  hc = _Heap_Resize_block( &Heap, ptr1, 4, &old, &avail );
    45   assert( !hc );
     45  rtems_test_assert( !hc );
    4646}
    4747
     
    6161  heap_size = _Heap_Initialize( &Heap, Memory, sizeof(Memory), 8 );
    6262  printf( "Init - Heap size=%" PRIu32 "\n", heap_size );
    63   assert( heap_size );
     63  rtems_test_assert( heap_size );
    6464
    6565  puts( "Init - _Heap_Allocate_aligned - OK");
    6666  ptr1 = _Heap_Allocate_aligned( &Heap, 64, 4 );
    67   assert( ptr1 );
     67  rtems_test_assert( ptr1 );
    6868
    6969  puts( "Init - _Heap_Resize_block - OK");
    7070  hc = _Heap_Resize_block( &Heap, ptr1, 56, &old, &avail );
    71   assert( !hc );
     71  rtems_test_assert( !hc );
    7272}
    7373
  • testsuites/sptests/sp64/init.c

    r2317457 r9e7d02a3  
    4343  puts( "Init - rtems_workspace_get_information - OK" );
    4444  sb = rtems_workspace_get_information( &start );
    45   assert( sb );
     45  rtems_test_assert( sb );
    4646
    4747  #if 0
     
    4949    printf( "Init - workspace free blocks = %d\n", start.Free.number );
    5050  #endif
    51   assert( start.Free.number == 1 );
     51  rtems_test_assert( start.Free.number == 1 );
    5252  to_alloc = start.Free.largest;
    5353
     
    7070   */
    7171  sb = rtems_workspace_get_information( &info );
    72   assert( sb );
    73   assert( info.Free.largest == start.Free.largest );
    74   assert( info.Free.number  == start.Free.number  );
     72  rtems_test_assert( sb );
     73  rtems_test_assert( info.Free.largest == start.Free.largest );
     74  rtems_test_assert( info.Free.number  == start.Free.number  );
    7575
    7676  puts( "Init - rtems_region_create - auto-extend - RTEMS_UNSATISFIED" );
     
    7878
    7979    sb = rtems_workspace_allocate( to_alloc, &alloced );
    80     assert( sb );
     80    rtems_test_assert( sb );
    8181
    8282    sc = rtems_region_create(
     
    108108        info.Free.largest, info.Free.number );
    109109    #endif
    110     assert( sb );
    111     assert( info.Free.largest == start.Free.largest );
    112     assert( info.Free.number  == start.Free.number  );
     110    rtems_test_assert( sb );
     111    rtems_test_assert( info.Free.largest == start.Free.largest );
     112    rtems_test_assert( info.Free.number  == start.Free.number  );
    113113
    114114    to_alloc -= 8;
     
    125125  puts( "Init - rtems_region_delete - OK" );
    126126  sc = rtems_region_delete( region2 );
    127   assert( sc == 0 );
     127  rtems_test_assert( sc == 0 );
    128128
    129129  /*
     
    140140      info.Free.largest, info.Free.number );
    141141    #endif
    142     assert( sb );
    143     assert( info.Free.largest == start.Free.largest );
    144     assert( info.Free.number  == start.Free.number  );
     142    rtems_test_assert( sb );
     143    rtems_test_assert( info.Free.largest == start.Free.largest );
     144    rtems_test_assert( info.Free.number  == start.Free.number  );
    145145  #endif
    146146
  • testsuites/sptests/spfatal10/testcase.h

    r2317457 r9e7d02a3  
    1010 *  $Id$
    1111 */
     12
     13#include <assert.h>
    1214
    1315#define FATAL_ERROR_TEST_NAME            "10"
  • testsuites/sptests/spfatal11/testcase.h

    r2317457 r9e7d02a3  
    1010 *  $Id$
    1111 */
     12
     13#include <assert.h>
    1214
    1315#define FATAL_ERROR_TEST_NAME            "11"
  • testsuites/sptests/spobjgetnext/init.c

    r2317457 r9e7d02a3  
    7575  puts( "Init - _Objects_Get_next - NULL object information" );
    7676  o = _Objects_Get_next( NULL, main_task, &location, &id );
    77   assert( o == NULL );
     77  rtems_test_assert( o == NULL );
    7878
    7979  puts( "Init - _Objects_Get_next - NULL location" );
    8080  o = _Objects_Get_next( info, main_task, NULL, &id );
    81   assert( o == NULL );
     81  rtems_test_assert( o == NULL );
    8282
    8383  puts( "Init - _Objects_Get_next - NULL id" );
    8484  o = _Objects_Get_next( info, main_task, &location, NULL );
    85   assert( o == NULL );
     85  rtems_test_assert( o == NULL );
    8686
    8787  /* XXX push the three NULL error cases */
     
    9090  count = scan_objects( info, OBJECTS_ID_INITIAL_INDEX );
    9191  printf( "%d RTEMS Task%s\n", count, ((count == 1) ? "" : "s") );
    92   assert( count == 1 );
     92  rtems_test_assert( count == 1 );
    9393
    9494  /* simple case of only 1 task in the system, starting at that task */
    9595  count = scan_objects( info, main_task );
    9696  printf( "%d RTEMS Task%s\n", count, ((count == 1) ? "" : "s") );
    97   assert( count == 1 );
     97  rtems_test_assert( count == 1 );
    9898
    9999  /* XXX create >= 1 task and make sure the counts are correct when */
  • testsuites/sptests/spwkspace/init.c

    r2317457 r9e7d02a3  
    2727  puts( "rtems_workspace_get_information - null pointer" );
    2828  retbool = rtems_workspace_get_information( NULL );
    29   assert( retbool == false );
     29  rtems_test_assert( retbool == false );
    3030
    3131  puts( "rtems_workspace_get_information - OK" );
    3232  retbool = rtems_workspace_get_information( &info );
    33   assert( retbool == true );
     33  rtems_test_assert( retbool == true );
    3434
    3535  puts( "rtems_workspace_allocate - null pointer" );
    3636  retbool = rtems_workspace_allocate( 42, NULL );
    37   assert( retbool == false );
     37  rtems_test_assert( retbool == false );
    3838
    3939  puts( "rtems_workspace_allocate - 0 bytes" );
    4040  retbool = rtems_workspace_allocate( 0, &p1 );
    41   assert( retbool == false );
     41  rtems_test_assert( retbool == false );
    4242
    4343  puts( "rtems_workspace_allocate - too many bytes" );
    4444  retbool = rtems_workspace_allocate( info.Free.largest * 2, &p1 );
    45   assert( retbool == false );
     45  rtems_test_assert( retbool == false );
    4646
    4747  puts( "rtems_workspace_allocate - 42 bytes" );
    4848  retbool = rtems_workspace_allocate( 42, &p1 );
    49   assert( retbool == true );
    50   assert( p1 != NULL );
     49  rtems_test_assert( retbool == true );
     50  rtems_test_assert( p1 != NULL );
    5151
    5252  puts( "rtems_workspace_free - NULL" );
    5353  retbool = rtems_workspace_free( NULL );
    54   assert( retbool == false );
     54  rtems_test_assert( retbool == false );
    5555
    5656  puts( "rtems_workspace_free - previous pointer to 42 bytes" );
    5757  retbool = rtems_workspace_free( p1 );
    58   assert( retbool == true );
     58  rtems_test_assert( retbool == true );
    5959
    6060  puts( "*** END OF TEST WORKSPACE CLASSIC API ***" );
Note: See TracChangeset for help on using the changeset viewer.