diff options
Diffstat (limited to 'testsuites/validation/tc-intr-entry-install.c')
-rw-r--r-- | testsuites/validation/tc-intr-entry-install.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/testsuites/validation/tc-intr-entry-install.c b/testsuites/validation/tc-intr-entry-install.c index 714486772a..152963828c 100644 --- a/testsuites/validation/tc-intr-entry-install.c +++ b/testsuites/validation/tc-intr-entry-install.c @@ -190,6 +190,12 @@ typedef struct { rtems_vector_number test_vector; /** + * @brief If this member is true, then the testable interrupt vector was + * enabled at the test case begin. + */ + bool test_vector_was_enabled; + + /** * @brief This member provides the attributes of the testable interrupt * vector. */ @@ -1120,6 +1126,11 @@ static void RtemsIntrReqEntryInstall_Setup( ctx->initialized_during_setup = bsp_interrupt_is_initialized(); ctx->test_vector = GetTestableInterruptVector( &required ); + ctx->test_vector_was_enabled = false; + (void) rtems_interrupt_vector_is_enabled( + ctx->test_vector, + &ctx->test_vector_was_enabled + ); sc = rtems_interrupt_get_attributes( ctx->test_vector, &ctx->attributes ); T_rsc_success( sc ); } @@ -1133,6 +1144,24 @@ static void RtemsIntrReqEntryInstall_Setup_Wrap( void *arg ) RtemsIntrReqEntryInstall_Setup( ctx ); } +static void RtemsIntrReqEntryInstall_Teardown( + RtemsIntrReqEntryInstall_Context *ctx +) +{ + if ( ctx->test_vector_was_enabled ) { + (void) rtems_interrupt_vector_enable( ctx->test_vector ); + } +} + +static void RtemsIntrReqEntryInstall_Teardown_Wrap( void *arg ) +{ + RtemsIntrReqEntryInstall_Context *ctx; + + ctx = arg; + ctx->Map.in_action_loop = false; + RtemsIntrReqEntryInstall_Teardown( ctx ); +} + static void RtemsIntrReqEntryInstall_Prepare( RtemsIntrReqEntryInstall_Context *ctx ) @@ -1320,7 +1349,7 @@ static size_t RtemsIntrReqEntryInstall_Scope( void *arg, char *buf, size_t n ) static T_fixture RtemsIntrReqEntryInstall_Fixture = { .setup = RtemsIntrReqEntryInstall_Setup_Wrap, .stop = NULL, - .teardown = NULL, + .teardown = RtemsIntrReqEntryInstall_Teardown_Wrap, .scope = RtemsIntrReqEntryInstall_Scope, .initial_context = &RtemsIntrReqEntryInstall_Instance }; |