|
|
|
@ -410,19 +410,27 @@ void test_vTaskDelete_assert_scheduler_suspended_eq_1( void )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief This test ensures that the code asserts when a task is suspended while
|
|
|
|
|
* the scheduler is suspended
|
|
|
|
|
* @brief vTaskSuspend - scheduler suspended assertion.
|
|
|
|
|
*
|
|
|
|
|
* This test ensures that the code asserts when a task is suspended while
|
|
|
|
|
* the scheduler is suspended
|
|
|
|
|
*
|
|
|
|
|
* <b>Coverage</b>
|
|
|
|
|
* @code{c}
|
|
|
|
|
* vTaskDelete( xTaskToDelete );
|
|
|
|
|
*
|
|
|
|
|
* configASSERT( uxSchedulerSuspended == 0 );
|
|
|
|
|
*
|
|
|
|
|
* if( xSchedulerRunning != pdFALSE )
|
|
|
|
|
* {
|
|
|
|
|
* if( pxTCB->xTaskRunState == ( BaseType_t ) portGET_CORE_ID() )
|
|
|
|
|
* {
|
|
|
|
|
* configASSERT( uxSchedulerSuspended == 0 );
|
|
|
|
|
* vTaskYieldWithinAPI();
|
|
|
|
|
* }
|
|
|
|
|
* else
|
|
|
|
|
* {
|
|
|
|
|
* prvYieldCore( pxTCB->xTaskRunState );
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
* @endcode
|
|
|
|
|
*
|
|
|
|
|
* configNUMBER_OF_CORES > 1
|
|
|
|
|
* INCLUDE_vTaskSuspend
|
|
|
|
|
* configASSERT( uxSchedulerSuspended == 0 ) is triggered.
|
|
|
|
|
*/
|
|
|
|
|
void test_vTaskSuspend_assert_schedulersuspended_ne_zero( void )
|
|
|
|
|
{
|
|
|
|
@ -438,7 +446,15 @@ void test_vTaskSuspend_assert_schedulersuspended_ne_zero( void )
|
|
|
|
|
uxListRemove_ExpectAnyArgsAndReturn( pdTRUE );
|
|
|
|
|
listLIST_ITEM_CONTAINER_ExpectAnyArgsAndReturn( NULL );
|
|
|
|
|
vListInsertEnd_ExpectAnyArgs();
|
|
|
|
|
vFakePortExitCriticalSection_Expect();
|
|
|
|
|
|
|
|
|
|
/* Reset the next expected unblock time if scheduler is running. */
|
|
|
|
|
vFakePortEnterCriticalSection_Expect();
|
|
|
|
|
listLIST_IS_EMPTY_ExpectAnyArgsAndReturn( pdTRUE );
|
|
|
|
|
vFakePortExitCriticalSection_Expect();
|
|
|
|
|
|
|
|
|
|
/* Check task run state in critical section. */
|
|
|
|
|
vFakePortEnterCriticalSection_Expect();
|
|
|
|
|
vFakePortGetCoreID_ExpectAndReturn( 1 );
|
|
|
|
|
|
|
|
|
|
EXPECT_ASSERT_BREAK( vTaskSuspend( xTaskToSuspend ) );
|
|
|
|
|