diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 91f4fd844f..dca9d6d3b5 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,7 @@ +2008-01-22 Joel Sherrill + + * sp39/init.c: Modify to improve coverage. + 2008-01-18 Jennifer Averett * sp36/strict_order_mut.c: diff --git a/testsuites/sptests/sp39/init.c b/testsuites/sptests/sp39/init.c index 6ee567580c..e92cdae998 100644 --- a/testsuites/sptests/sp39/init.c +++ b/testsuites/sptests/sp39/init.c @@ -26,45 +26,22 @@ rtems_timer_service_routine test_event_from_isr( { rtems_status_code status; - status = rtems_event_send( main_task, 0x01 ); + if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { + /* + * This event send hits the critical section but sends to + * another task so doesn't impact this critical section. + */ + rtems_event_send( other_task, 0x02 ); + + /* + * This event send hits the main task but doesn't satisfy + * it's blocking condition so it will still block + */ + rtems_event_send( main_task, 0x02 ); - if ( _Event_Sync_state == EVENT_SYNC_SATISFIED ) case_hit = TRUE; -} - -rtems_timer_service_routine test_timeout_from_isr( - rtems_id timer, - void *arg -) -{ - if ( _Event_Sync_state != EVENT_SYNC_NOTHING_HAPPENED ) - return; - - /* - * The main task should have timed out and we are in the - * event synchronization critical section with "timeout". - */ - - /* - * This event send hits the critical section but sends to - * another task so doesn't impact this critical section. - */ - rtems_event_send( other_task, 0x02 ); - - /* - * This event send hits the main task but doesn't satisfy - * it's blocking condition so it will still time out. - */ - rtems_event_send( main_task, 0x02 ); - - /* - * This event send should cancel the main task's time out - * and deliver the interrupt because both occurred simultaneously. - */ - rtems_event_send( main_task, 0x01 ); - - - case_hit = TRUE; + } + status = rtems_event_send( main_task, 0x01 ); } rtems_task Init( @@ -111,7 +88,7 @@ rtems_task Init( directive_failed( status, "timer_fire_after failed" ); for (i=0 ; i= 0x10000 ) - break; } printf( @@ -131,30 +106,30 @@ rtems_task Init( /* * Now try for a timeout case */ + iterations = 0; case_hit = FALSE; max = 1; + puts( + "Run multiple times in attempt to hit event timeout synchronization point" + ); while (1) { - status = rtems_timer_fire_after( timer, 1, test_timeout_from_isr, NULL ); - directive_failed( status, "timer_fire_after failed" ); - for (i=0 ; i 1024 ) + max = 0; + + if ( ++iterations >= 0x1000 ) + break; + } puts( "*** END OF TEST 39 ***" ); rtems_test_exit( 0 );