From f5e3d89e326567c2aa345abb6d6b4f28fb497b37 Mon Sep 17 00:00:00 2001 From: Enjia Mai Date: Wed, 5 May 2021 11:31:45 +0800 Subject: [PATCH] tests: ztest: fix testcase might fail when assertion fail in ISR Put the testcase test_catch_assert_in_isr() to execute last, to prevent it affects other test cases. Because when we caught an assert failure in the ISR handler, it cannot be guaranteed that all the current program status would be recovered. Fixes #34844. Signed-off-by: Enjia Mai --- tests/ztest/error_hook/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ztest/error_hook/src/main.c b/tests/ztest/error_hook/src/main.c index a8244298b77..2331d273085 100644 --- a/tests/ztest/error_hook/src/main.c +++ b/tests/ztest/error_hook/src/main.c @@ -341,8 +341,8 @@ void test_main(void) ztest_test_suite(error_hook_tests, ztest_user_unit_test(test_catch_assert_fail), ztest_user_unit_test(test_catch_fatal_error), - ztest_unit_test(test_catch_assert_in_isr), - ztest_unit_test(test_catch_z_oops) + ztest_unit_test(test_catch_z_oops), + ztest_unit_test(test_catch_assert_in_isr) ); ztest_run_test_suite(error_hook_tests); #else