Skip to content

Commit

Permalink
Fix SMP coverage tests for kernel PR 1206
Browse files Browse the repository at this point in the history
PR Link - FreeRTOS/FreeRTOS-Kernel#1206

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
  • Loading branch information
aggarg committed Dec 18, 2024
1 parent f6672f9 commit 6ca756f
Showing 1 changed file with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1741,11 +1741,7 @@ void test_coverage_xTaskRemoveFromEventList_remove_eq_priority_task( void )
uxCurrentNumberOfTasks = uxCurrentNumberOfTasks + 1;

/* Expectations. */
vFakePortGetCoreID_StubWithCallback( NULL );
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get portGET_CRITICAL_NESTING_COUNT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get prvYieldCore. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get portGET_CRITICAL_NESTING_COUNT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get xYieldPendings. */
vFakePortGetCoreID_ExpectAndReturn( 0 );
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* portTASK_SWITCH_HOOK(). */

/* API call. */
Expand Down Expand Up @@ -1942,9 +1938,7 @@ void test_coverage_vTaskRemoveFromUnorderedEventList_remove_higher_priority_task
uxCurrentNumberOfTasks = uxCurrentNumberOfTasks + 1;

/* Expectations. */
vFakePortGetCoreID_StubWithCallback( NULL );
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get portGET_CRITICAL_NESTING_COUNT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get prvYieldCore. */
vFakePortGetCoreID_ExpectAndReturn( 0 );

/* API call. */
vTaskRemoveFromUnorderedEventList( &xTaskTCB.xEventListItem, 500 | 0x80000000UL );
Expand Down Expand Up @@ -1990,9 +1984,7 @@ void test_coverage_vTaskEnterCritical_task_in_critical_already( void )

/* Expectations. */
vFakePortDisableInterrupts_ExpectAndReturn( 0 );
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get both locks. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Increment the critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check first time enter critical section. */
vFakePortGetCoreID_ExpectAndReturn( 0 );

/* API call. */
vTaskEnterCritical();
Expand Down Expand Up @@ -2030,9 +2022,8 @@ void test_coverage_vTaskEnterCriticalFromISR_isr_in_critical_already( void )
vFakePortGetCoreID_StubWithCallback( NULL );

/* Expectations. */
vFakePortGetCoreID_ExpectAndReturn( 0 );
ulFakePortSetInterruptMaskFromISR_ExpectAndReturn( 0x5a5a ); /* The value to be verified. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Get ISR locks. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Increment the critical nesting count. */

/* API call. */
xSavedInterruptStatus = vTaskEnterCriticalFromISR();
Expand Down Expand Up @@ -2073,10 +2064,7 @@ void test_coverage_vTaskExitCritical_task_enter_critical_mt_1( void )
vFakePortGetCoreID_StubWithCallback( NULL );

/* Expectations. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* configASSERT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Decrease the critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check exit critical section. */
vFakePortGetCoreID_ExpectAndReturn( 0 );

/* API call. */
vTaskExitCritical();
Expand Down Expand Up @@ -2114,8 +2102,7 @@ void test_coverage_vTaskExitCritical_task_not_in_critical( void )
vFakePortGetCoreID_StubWithCallback( NULL );

/* Expectations. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* configASSERT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 );

/* API call. */
vTaskExitCritical();
Expand Down Expand Up @@ -2172,10 +2159,7 @@ void test_coverage_vTaskExitCriticalFromISR_isr_enter_critical_mt_1( void )
vFakePortGetCoreID_StubWithCallback( NULL );

/* Expectations. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* configASSERT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Decrement critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 );

/* API call. */
/* The mask value has not effect since ISR enters critical section more than 1 time. */
Expand Down Expand Up @@ -2215,8 +2199,7 @@ void test_coverage_vTaskExitCriticalFromISR_isr_not_in_critical( void )
vFakePortGetCoreID_StubWithCallback( NULL );

/* Expectations. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* configASSERT. */
vFakePortGetCoreID_ExpectAndReturn( 0 ); /* Check critical nesting count. */
vFakePortGetCoreID_ExpectAndReturn( 0 );

/* API call. */
/* The mask value has not effect since ISR is not in critical section. */
Expand Down

0 comments on commit 6ca756f

Please sign in to comment.