Changeset 265d9b64 in rtems


Ignore:
Timestamp:
Jan 22, 2008, 2:46:13 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
00b66f2
Parents:
c539ced1
Message:

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

  • sp39/init.c: Modify to improve coverage.
Location:
testsuites/sptests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    rc539ced1 r265d9b64  
     12008-01-22      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * sp39/init.c: Modify to improve coverage.
     4
    152008-01-18      Jennifer Averett <jennifer.averett@OARcorp.com>
    26
  • testsuites/sptests/sp39/init.c

    rc539ced1 r265d9b64  
    2727  rtems_status_code     status;
    2828
     29  if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) {
     30    /*
     31     *  This event send hits the critical section but sends to
     32     *  another task so doesn't impact this critical section.
     33     */
     34    rtems_event_send( other_task, 0x02 );
     35
     36    /*
     37     *  This event send hits the main task but doesn't satisfy
     38     *  it's blocking condition so it will still block
     39     */
     40    rtems_event_send( main_task, 0x02 );
     41
     42    case_hit = TRUE;
     43  }
    2944  status = rtems_event_send( main_task, 0x01 );
    30 
    31   if ( _Event_Sync_state == EVENT_SYNC_SATISFIED )
    32     case_hit = TRUE;
    33 }
    34 
    35 rtems_timer_service_routine test_timeout_from_isr(
    36   rtems_id  timer,
    37   void     *arg
    38 )
    39 {
    40   if ( _Event_Sync_state != EVENT_SYNC_NOTHING_HAPPENED )
    41     return;
    42 
    43   /*
    44    *  The main task should have timed out and we are in the
    45    *  event synchronization critical section with "timeout".
    46    */
    47 
    48   /*
    49    *  This event send hits the critical section but sends to
    50    *  another task so doesn't impact this critical section.
    51    */
    52   rtems_event_send( other_task, 0x02 );
    53 
    54   /*
    55    *  This event send hits the main task but doesn't satisfy
    56    *  it's blocking condition so it will still time out.
    57    */
    58   rtems_event_send( main_task, 0x02 );
    59 
    60   /*
    61    *  This event send should cancel the main task's time out
    62    *  and deliver the interrupt because both occurred simultaneously.
    63    */
    64   rtems_event_send( main_task, 0x01 );
    65 
    66 
    67   case_hit = TRUE;
    6845}
    6946
     
    11289
    11390    for (i=0 ; i<max ; i++ )
    114       if ( _Event_Sync_state == EVENT_SYNC_SATISFIED )
     91      if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_SATISFIED )
    11592        break;
    11693
     
    12097      break;
    12198    max += 2;
    122     if ( ++iterations >= 0x10000 )
    123       break;
    12499  }
    125100
     
    132107   *  Now try for a timeout case
    133108   */
     109  iterations = 0;
    134110  case_hit = FALSE;
    135111  max = 1;
    136112
     113  puts(
     114    "Run multiple times in attempt to hit event timeout synchronization point"
     115  );
    137116  while (1) {
    138     status = rtems_timer_fire_after( timer, 1, test_timeout_from_isr, NULL );
    139     directive_failed( status, "timer_fire_after failed" );
    140 
    141117
    142118    for (i=0 ; i<max ; i++ )
    143       if ( case_hit )
     119      if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_SATISFIED )
    144120        break;
    145121
    146122    status = rtems_event_receive( 0x01, RTEMS_DEFAULT_OPTIONS, 1, &out );
    147     if ( status == RTEMS_SUCCESSFUL ) {
     123    fatal_directive_status( status, RTEMS_TIMEOUT, "event_receive timeout" );
     124    if ( case_hit )
    148125      break;
    149     }
    150     fatal_directive_status( status, RTEMS_TIMEOUT, "event_receive timeout" );
    151     max += 1;
     126
     127    if ( ++max > 1024 )
     128      max = 0;
     129
     130    if ( ++iterations >= 0x1000 )
     131      break;
    152132  }
    153 
    154   printf(
    155      "Event timeout hitting synchronization point has %soccurred\n",
    156      (( case_hit == TRUE ) ? "" : "NOT ")
    157   );
    158133
    159134  puts( "*** END OF TEST 39 ***" );
Note: See TracChangeset for help on using the changeset viewer.