summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-19 21:17:55 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-19 21:21:27 +0200
commitf22af606d42c5669bba8c2d0a8a7582e0e43c703 (patch)
treea9eac85c2344911bb29119a05263ad89c3135c85
parent1cfe0125437232d6b6acd023acdd62968d521d51 (diff)
downloadrtems-f22af606d42c5669bba8c2d0a8a7582e0e43c703.tar.bz2
sptests/sp37: Fix type and simplify
-rw-r--r--testsuites/sptests/sp37/init.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c
index 647485e555..0846491700 100644
--- a/testsuites/sptests/sp37/init.c
+++ b/testsuites/sptests/sp37/init.c
@@ -333,10 +333,7 @@ volatile int isr_in_progress_inline;
void check_isr_in_progress_inline(void)
{
- bool in_isr;
-
- in_isr = rtems_interrupt_is_in_progress();
- isr_in_progress_inline = ( in_isr ) ? 1 : 2;
+ isr_in_progress_inline = rtems_interrupt_is_in_progress() ? 1 : 2;
}
#undef rtems_interrupt_disable
@@ -353,12 +350,9 @@ rtems_timer_service_routine test_isr_in_progress(
void *arg
)
{
- bool in_isr;
-
check_isr_in_progress_inline();
- in_isr = rtems_interrupt_is_in_progress();
- isr_in_progress_body = ( in_isr ) ? 1 : 2;
+ isr_in_progress_body = rtems_interrupt_is_in_progress() ? 1 : 2;
}
void check_isr_worked(
@@ -367,13 +361,14 @@ void check_isr_worked(
)
{
switch (result) {
- case -1:
+ case 0:
printf( "isr_in_progress(%s) timer did not fire\n", s );
+ rtems_test_exit(0);
break;
case 1:
printf( "isr_in_progress(%s) from ISR -- OK\n", s );
break;
- case 2:
+ default:
printf( "isr_in_progress(%s) from ISR -- returned bad value\n", s);
rtems_test_exit(0);
break;
@@ -573,16 +568,13 @@ rtems_task Init(
/*
* Test ISR in progress from actual ISR
*/
- isr_in_progress_body = -1;
- isr_in_progress_inline = -1;
-
status = rtems_timer_fire_after( timer, 10, test_isr_in_progress, NULL );
directive_failed( status, "timer_fire_after failed" );
- status = rtems_task_wake_after( 100 );
+ status = rtems_task_wake_after( 11 );
directive_failed( status, "wake_after failed" );
- check_isr_worked( "inline", isr_in_progress_body );
+ check_isr_worked( "inline", isr_in_progress_inline );
check_isr_worked( "body", isr_in_progress_body );