Skip to content

Commit

Permalink
tests: arch: arm: arm_interrupt: remove side effect in assertion
Browse files Browse the repository at this point in the history
Remove a side effect in an assertion check of the
expected reason after spurious interrupt handling.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information
ioannisg authored and nashif committed Mar 25, 2020
1 parent 6380c24 commit ac6b4a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/arch/arm/arm_interrupt/src/arm_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */,
Expand Down

0 comments on commit ac6b4a0

Please sign in to comment.