From 3e1c9a51df21275d938c6f8b71ac00b3f4d8e1e9 Mon Sep 17 00:00:00 2001 From: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:37:31 +0800 Subject: [PATCH] Update SMP unit test for vTaskDelete change (#1158) * Fix vTaskDelete SMP unit test --- FreeRTOS/Test/CMock/smp/config_assert/config_assert_utest.c | 4 ++++ .../covg_multiple_priorities_no_timeslice_mock_utest.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/FreeRTOS/Test/CMock/smp/config_assert/config_assert_utest.c b/FreeRTOS/Test/CMock/smp/config_assert/config_assert_utest.c index 4fb1aa403..a99773c53 100644 --- a/FreeRTOS/Test/CMock/smp/config_assert/config_assert_utest.c +++ b/FreeRTOS/Test/CMock/smp/config_assert/config_assert_utest.c @@ -395,6 +395,10 @@ void test_vTaskDelete_assert_scheduler_suspended_eq_1( void ) listLIST_ITEM_CONTAINER_ExpectAnyArgsAndReturn( NULL ); vListInsertEnd_ExpectAnyArgs(); vPortCurrentTaskDying_ExpectAnyArgs(); + vFakePortExitCriticalSection_Expect(); + + /* Critical section for check task is running. */ + vFakePortEnterCriticalSection_Expect(); vFakePortGetCoreID_ExpectAndReturn( 1 ); EXPECT_ASSERT_BREAK( vTaskDelete( xTaskToDelete ) ); diff --git a/FreeRTOS/Test/CMock/smp/multiple_priorities_no_timeslice_mock/covg_multiple_priorities_no_timeslice_mock_utest.c b/FreeRTOS/Test/CMock/smp/multiple_priorities_no_timeslice_mock/covg_multiple_priorities_no_timeslice_mock_utest.c index 9ca22b72c..06e061379 100644 --- a/FreeRTOS/Test/CMock/smp/multiple_priorities_no_timeslice_mock/covg_multiple_priorities_no_timeslice_mock_utest.c +++ b/FreeRTOS/Test/CMock/smp/multiple_priorities_no_timeslice_mock/covg_multiple_priorities_no_timeslice_mock_utest.c @@ -584,6 +584,10 @@ void test_coverage_vTaskDelete_task_not_running( void ) vFakePortExitCriticalSection_Expect(); + /* Critical section for check task is running. */ + vFakePortEnterCriticalSection_Expect(); + vFakePortExitCriticalSection_Expect(); + /* API Call */ vTaskDelete( xTaskToDelete );