Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: arm_no_multithreading: confirm IRQ index being non-negative #34321

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions tests/arch/arm/arm_no_multithreading/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,26 @@ void test_main(void)
}
}

__ASSERT(i >= 0,
"No available IRQ line to use in the test\n");
if (i >= 0) {

printk("Available IRQ line: %u\n", i);
printk("Available IRQ line: %u\n", i);

arch_irq_connect_dynamic(i, 0 /* highest priority */,
arm_isr_handler,
NULL,
0);
arch_irq_connect_dynamic(i, 0 /* highest priority */,
arm_isr_handler,
NULL,
0);

NVIC_EnableIRQ(i);
NVIC_EnableIRQ(i);

__DSB();
__ISB();
__DSB();
__ISB();

flag = test_flag;
flag = test_flag;

__ASSERT(flag > 0, "Test flag not set by IRQ\n");
__ASSERT(flag > 0, "Test flag not set by IRQ\n");

printk("ARM no multithreading test successful\n");
printk("ARM no multithreading test successful\n");
} else {
__ASSERT(0, "No available IRQ line to use in the test\n");
}
}