summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spintrcritical09
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-22 21:46:56 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-22 21:46:56 +0000
commit2d730043c0e0685ccab30116cc35b204381e91e4 (patch)
tree6d2181c573dfe50b4fd276133f871b5d8bbdd649 /testsuites/sptests/spintrcritical09
parent2009-07-22 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-2d730043c0e0685ccab30116cc35b204381e91e4.tar.bz2
2009-07-22 Joel Sherrill <joel.sherrill@OARcorp.com>
* spintrcritical09/init.c, spintrcritical09/spintrcritical09.scn: Make test work for case that it is documented to handle.
Diffstat (limited to 'testsuites/sptests/spintrcritical09')
-rw-r--r--testsuites/sptests/spintrcritical09/init.c40
-rw-r--r--testsuites/sptests/spintrcritical09/spintrcritical09.scn4
2 files changed, 10 insertions, 34 deletions
diff --git a/testsuites/sptests/spintrcritical09/init.c b/testsuites/sptests/spintrcritical09/init.c
index 565c8c84d7..46faf214e8 100644
--- a/testsuites/sptests/spintrcritical09/init.c
+++ b/testsuites/sptests/spintrcritical09/init.c
@@ -14,7 +14,6 @@
#include <intrcritical.h>
rtems_id Main_task;
-rtems_id Flusher_id;
rtems_id Semaphore;
volatile bool case_hit;
@@ -44,26 +43,12 @@ rtems_timer_service_routine test_release_from_isr(
}
}
-rtems_task Flusher(
- rtems_task_argument ignored
-)
-{
- rtems_status_code sc;
-
- while (1) {
- sc = rtems_semaphore_flush( Semaphore );
- directive_failed( sc, "rtems_semaphore_flush" );
-
- sc = rtems_task_wake_after( 2 );
- directive_failed( sc, "rtems_task_wake_after" );
- }
-}
-
rtems_task Init(
rtems_task_argument ignored
)
{
rtems_status_code sc;
+ int resets;
puts( "\n\n*** TEST INTERRUPT CRITICAL SECTION 09 ***" );
@@ -80,30 +65,23 @@ rtems_task Init(
Main_task = rtems_task_self();
- sc = rtems_task_create(
- rtems_build_name( 'F', 'L', 'S', 'H' ),
- 1,
- RTEMS_MINIMUM_STACK_SIZE,
- RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Flusher_id
- );
- directive_failed( sc, "rtems_task_create" );
-
- sc = rtems_task_start( Flusher_id, Flusher, 0 );
- directive_failed( sc, "rtems_task_start" );
-
interrupt_critical_section_test_support_initialize( test_release_from_isr );
case_hit = false;
- while (!case_hit) {
+ for (resets=0 ; resets< 2 ;) {
+ if ( interrupt_critical_section_test_support_delay() )
+ resets++;
+
interrupt_critical_section_test_support_delay();
(void) rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 1 );
}
- puts( "Init - Case hit" );
+ if (!case_hit)
+ rtems_test_exit(0);
+
+ puts( "Init - It appears we hit the case" );
puts( "*** END OF TEST INTERRUPT CRITICAL SECTION 09 ***" );
rtems_test_exit(0);
diff --git a/testsuites/sptests/spintrcritical09/spintrcritical09.scn b/testsuites/sptests/spintrcritical09/spintrcritical09.scn
index 6740440a4f..19f11b127b 100644
--- a/testsuites/sptests/spintrcritical09/spintrcritical09.scn
+++ b/testsuites/sptests/spintrcritical09/spintrcritical09.scn
@@ -1,6 +1,4 @@
*** TEST INTERRUPT CRITICAL SECTION 09 ***
-Init - Trying to generate timeout from ISR while blocking
Init - Test may not be able to detect case is hit reliably
-Support - rtems_timer_create - creating timer 1
Init - Trying to generate timeout from ISR while blocking
-*** END OF TEST INTERRUPT CRITICAL SECTION 09 ***
+Support - rtems_timer_create - creating timer 1