summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-04 08:05:17 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-04 08:05:17 +0200
commit3c0f07267651b72c55922e981e31808d5c79af2a (patch)
tree918f6900db43aba15c87d644b35240b36470bd8d
parent409ff1b00e8f31b6aa2dc85df6f1bae22ae89550 (diff)
testsuites/validation/tc-bsp-interrupt-spurious.c
-rw-r--r--testsuites/validation/tc-bsp-interrupt-spurious.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/testsuites/validation/tc-bsp-interrupt-spurious.c b/testsuites/validation/tc-bsp-interrupt-spurious.c
index 8f17371a12..accfb03736 100644
--- a/testsuites/validation/tc-bsp-interrupt-spurious.c
+++ b/testsuites/validation/tc-bsp-interrupt-spurious.c
@@ -117,12 +117,12 @@ typedef struct {
/**
* @brief This member contains the fatal source.
*/
- rtems_fatal_source fatal_source;
+ rtems_fatal_source fatal_source[ 2 ];
/**
* @brief This member contains a fatal code.
*/
- rtems_fatal_code fatal_code;
+ rtems_fatal_code fatal_code[ 2 ];
/**
* @brief This member contains a valid vector number.
@@ -178,12 +178,18 @@ static void FatalExtension(
)
{
Context *ctx;
+ uint32_t counter;
ctx = T_fixture_context();
T_false( always_set_to_false );
- ctx->fatal_source = source;
- ctx->fatal_code = code;
- ++ctx->fatal_counter;
+ counter = ctx->fatal_counter;
+ ctx->fatal_counter = counter + 1;
+
+ if ( counter < 2 ) {
+ ctx->fatal_source[ counter ] = source;
+ ctx->fatal_code[ counter ] = code;
+ }
+
longjmp( ctx->before_call, 1 );
}
@@ -228,7 +234,7 @@ static void BspReqInterruptSpurious_Post_Result_Check(
* A fatal error shall occur.
*/
T_eq_u32( ctx->entry_counter, 0 );
- T_eq_u32( ctx->fatal_counter, 1 );
+ T_eq_u32( ctx->fatal_counter, 2 );
break;
}
@@ -237,7 +243,7 @@ static void BspReqInterruptSpurious_Post_Result_Check(
* The interrupt entries installed at the interrupt vector specified by
* the ``vector`` parameter shall be dispatched.
*/
- T_eq_u32( ctx->entry_counter, 1 );
+ T_eq_u32( ctx->entry_counter, 2 );
T_eq_u32( ctx->fatal_counter, 0 );
break;
}
@@ -258,7 +264,14 @@ static void BspReqInterruptSpurious_Post_FatalSource_Check(
* The fatal source shall be equal to
* RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT.
*/
- T_eq_int( ctx->fatal_source, RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT );
+ T_eq_int(
+ ctx->fatal_source[ 0 ],
+ RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT
+ );
+ T_eq_int(
+ ctx->fatal_source[ 1 ],
+ RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT
+ );
break;
}
@@ -277,7 +290,8 @@ static void BspReqInterruptSpurious_Post_FatalCode_Check(
/*
* The fatal code shall be equal to the ``vector`` parameter.
*/
- T_eq_ulong( ctx->fatal_code, ctx->vector );
+ T_eq_ulong( ctx->fatal_code[ 0 ], ctx->vector );
+ T_eq_ulong( ctx->fatal_code[ 1 ], ctx->vector );
break;
}
@@ -347,15 +361,17 @@ static void BspReqInterruptSpurious_Action(
{
ctx->entry_counter = 0;
ctx->fatal_counter = 0;
- ctx->fatal_source = RTEMS_FATAL_SOURCE_LAST;
- ctx->fatal_code = UINT32_MAX;
+ ctx->fatal_source[ 0 ] = RTEMS_FATAL_SOURCE_LAST;
+ ctx->fatal_source[ 1 ] = RTEMS_FATAL_SOURCE_LAST;
+ ctx->fatal_code[ 0 ] = UINT32_MAX;
+ ctx->fatal_code[ 1 ] = UINT32_MAX;
if ( setjmp( ctx->before_call ) == 0 ) {
- if ( *ctx->first == NULL ) {
- bsp_interrupt_handler_dispatch_unchecked( ctx->vector );
- } else {
- bsp_interrupt_spurious( ctx->vector );
- }
+ bsp_interrupt_handler_dispatch_unchecked( ctx->vector );
+ }
+
+ if ( setjmp( ctx->before_call ) == 0 ) {
+ bsp_interrupt_spurious( ctx->vector );
}
}