mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
test(panic_handler): Added unit test to verify panic handler can halt
This test verifies that the panic handler can indeed halt when configured to print and halt instead of rebboting.
This commit is contained in:
@@ -443,3 +443,12 @@ void test_capture_dram(void)
|
||||
assert(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT
|
||||
void test_panic_halt(void)
|
||||
{
|
||||
printf("Triggering panic. Device should print 'CPU halted.' and stop.\n");
|
||||
fflush(stdout);
|
||||
assert(0);
|
||||
}
|
||||
#endif /* CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT */
|
||||
|
||||
Reference in New Issue
Block a user