From ac6b4a00a9ddc8133b5cd46ccd5fff984fbb3670 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Thu, 19 Mar 2020 10:34:37 +0100 Subject: [PATCH] tests: arch: arm: arm_interrupt: remove side effect in assertion Remove a side effect in an assertion check of the expected reason after spurious interrupt handling. Signed-off-by: Ioannis Glaropoulos --- tests/arch/arm/arm_interrupt/src/arm_interrupt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/arch/arm/arm_interrupt/src/arm_interrupt.c b/tests/arch/arm/arm_interrupt/src/arm_interrupt.c index 187ea4b7d92..d4382422ce0 100644 --- a/tests/arch/arm/arm_interrupt/src/arm_interrupt.c +++ b/tests/arch/arm/arm_interrupt/src/arm_interrupt.c @@ -54,7 +54,7 @@ void test_arm_interrupt(void) { /* Determine an NVIC IRQ line that is not currently in use. */ int i; - int init_flag, post_flag; + int init_flag, post_flag, reason; init_flag = test_flag; @@ -101,8 +101,9 @@ void test_arm_interrupt(void) /* Verify that the spurious ISR has led to the fault and the * expected reason variable is reset. */ - zassert_true(expected_reason == -1, - "expected_reason has not been reset\n"); + reason = expected_reason; + zassert_equal(reason, -1, + "expected_reason has not been reset (%d)\n", reason); NVIC_DisableIRQ(i); arch_irq_connect_dynamic(i, 0 /* highest priority */,