summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spintrcritical11
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-08 15:18:07 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-10 07:12:55 +0200
commit802808900053e732881795d0d748d8fdc2a54e13 (patch)
tree7e9c96202fc39ce59cbd1c7d19806348631f2d14 /testsuites/sptests/spintrcritical11
parentscore: More strict RTEMS_DEQUALIFY implementation. (diff)
downloadrtems-802808900053e732881795d0d748d8fdc2a54e13.tar.bz2
tests: Rework interrupt critical tests
This avoids test durations of more than one hour on fast targets, since fast targets can count a lot during one clock tick period, so the minor loop iteration count was quite high. Estimate now the test body duration to iterate only through the interesting time window. Add and use interrupt_critical_section_test().
Diffstat (limited to 'testsuites/sptests/spintrcritical11')
-rw-r--r--testsuites/sptests/spintrcritical11/init.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/testsuites/sptests/spintrcritical11/init.c b/testsuites/sptests/spintrcritical11/init.c
index 0d8987537c..2a3f83a315 100644
--- a/testsuites/sptests/spintrcritical11/init.c
+++ b/testsuites/sptests/spintrcritical11/init.c
@@ -47,13 +47,21 @@ rtems_timer_service_routine test_release_from_isr(
(void) rtems_event_send( Main_task, EVENTS_TO_SEND );
}
+static bool test_body( void *arg )
+{
+ rtems_event_set out;
+
+ (void) arg;
+
+ rtems_event_receive( EVENTS_TO_RECEIVE, RTEMS_EVENT_ANY, 1, &out );
+
+ return false;
+}
+
rtems_task Init(
rtems_task_argument ignored
)
{
- rtems_event_set out;
- int resets;
-
TEST_BEGIN();
puts( "Init - Test may not be able to detect case is hit reliably" );
@@ -62,14 +70,7 @@ rtems_task Init(
Main_task = rtems_task_self();
- interrupt_critical_section_test_support_initialize( test_release_from_isr );
-
- for (resets=0 ; resets< 2 ;) {
- if ( interrupt_critical_section_test_support_delay() )
- resets++;
-
- (void) rtems_event_receive( EVENTS_TO_RECEIVE, RTEMS_EVENT_ANY, 1, &out );
- }
+ interrupt_critical_section_test( test_body, NULL, test_release_from_isr );
TEST_END();
rtems_test_exit(0);
@@ -83,6 +84,7 @@ rtems_task Init(
#define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE