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/spintrcritical06 | |
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/spintrcritical06')
-rw-r--r-- | testsuites/sptests/spintrcritical06/init.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/testsuites/sptests/spintrcritical06/init.c b/testsuites/sptests/spintrcritical06/init.c index 96c2a91be4..8d519226ff 100644 --- a/testsuites/sptests/spintrcritical06/init.c +++ b/testsuites/sptests/spintrcritical06/init.c @@ -71,12 +71,24 @@ rtems_task Secondary_task( rtems_test_assert(0); } +static bool test_body( void *arg ) +{ + (void) arg; + + rtems_semaphore_obtain( + Semaphore, + RTEMS_DEFAULT_OPTIONS, + SEMAPHORE_OBTAIN_TIMEOUT + ); + + return false; +} + rtems_task Init( rtems_task_argument ignored ) { rtems_status_code status; - int resets; TEST_BEGIN(); @@ -105,18 +117,7 @@ rtems_task Init( status = rtems_task_start( Secondary_task_id, Secondary_task, 0 ); directive_failed( status, "rtems_task_start" ); - interrupt_critical_section_test_support_initialize( test_release_from_isr ); - - for (resets=0 ; resets< 2 ;) { - if ( interrupt_critical_section_test_support_delay() ) - resets++; - - status = rtems_semaphore_obtain( - Semaphore, - RTEMS_DEFAULT_OPTIONS, - SEMAPHORE_OBTAIN_TIMEOUT - ); - } + interrupt_critical_section_test( test_body, NULL, test_release_from_isr ); TEST_END(); rtems_test_exit(0); @@ -130,6 +131,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_INIT_TASK_PRIORITY INIT_PRIORITY #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_PREEMPT #define CONFIGURE_MICROSECONDS_PER_TICK 2000 |