diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-09-08 15:18:07 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-09-10 07:12:55 +0200 |
commit | 802808900053e732881795d0d748d8fdc2a54e13 (patch) | |
tree | 7e9c96202fc39ce59cbd1c7d19806348631f2d14 /testsuites/sptests/spintrcritical18 | |
parent | score: More strict RTEMS_DEQUALIFY implementation. (diff) | |
download | rtems-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/spintrcritical18')
-rw-r--r-- | testsuites/sptests/spintrcritical18/init.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/testsuites/sptests/spintrcritical18/init.c b/testsuites/sptests/spintrcritical18/init.c index c34f4b95c7..f621d21280 100644 --- a/testsuites/sptests/spintrcritical18/init.c +++ b/testsuites/sptests/spintrcritical18/init.c @@ -95,11 +95,19 @@ static void high_priority_task( rtems_task_argument arg ) } } +static bool test_body( void *arg ) +{ + test_context *ctx = arg; + + wake_up( ctx->middle_priority_task ); + + return false; +} + static void Init( rtems_task_argument ignored ) { test_context *ctx = &global_ctx; rtems_status_code sc; - int resets = 0; TEST_BEGIN(); @@ -137,17 +145,7 @@ static void Init( rtems_task_argument ignored ) ); ASSERT_SC(sc); - interrupt_critical_section_test_support_initialize( - active_high_priority_task - ); - - while ( resets < 3 ) { - if ( interrupt_critical_section_test_support_delay() ) { - ++resets; - } - - wake_up( ctx->middle_priority_task ); - } + interrupt_critical_section_test( test_body, ctx, active_high_priority_task ); TEST_END(); @@ -161,6 +159,7 @@ static void Init( rtems_task_argument ignored ) #define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_MAXIMUM_TIMERS 1 +#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 #define CONFIGURE_INIT_TASK_PRIORITY PRIORITY_LOW #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |