mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-23 11:09:28 -05:00
Fix tests needed for https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/435 (#766)
* Fix tests needed for https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/435 Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
parent
598508a10b
commit
26dcb22052
7 changed files with 48 additions and 0 deletions
|
|
@ -570,6 +570,7 @@ void test_xQueueSendFromISR_locked( void )
|
|||
vSetQueueTxLock( xQueueSet, queueLOCKED_UNMODIFIED );
|
||||
|
||||
vFakePortAssertIfInterruptPriorityInvalid_Expect();
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
|
||||
|
||||
uint32_t testVal = getNextMonotonicTestValue();
|
||||
|
||||
|
|
@ -613,6 +614,11 @@ void test_xQueueSendFromISR_locked_overflow( void )
|
|||
|
||||
vFakePortAssertIfInterruptPriorityInvalid_Expect();
|
||||
|
||||
/* The number of tasks need to be more than 127 to trigger the
|
||||
* overflow assertion. */
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 128 );
|
||||
|
||||
|
||||
/* Expect an assertion since the cTxLock value has overflowed */
|
||||
fakeAssertExpectFail();
|
||||
|
||||
|
|
@ -670,6 +676,7 @@ static BaseType_t xQueueSend_locked_xTaskCheckForTimeOutCB( TimeOut_t * const px
|
|||
|
||||
if( cmock_num_calls == NUM_CALLS_TO_INTERCEPT )
|
||||
{
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
|
||||
uint32_t checkVal = INVALID_UINT32;
|
||||
QueueHandle_t xQueue = xQueueSelectFromSetFromISR( xQueueSetHandleStatic );
|
||||
TEST_ASSERT_NOT_NULL( xQueue );
|
||||
|
|
@ -731,6 +738,7 @@ static BaseType_t xQueueSend_xTaskResumeAllCallback( int cmock_num_calls )
|
|||
{
|
||||
if( cmock_num_calls == NUM_CALLS_TO_INTERCEPT )
|
||||
{
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
|
||||
uint32_t testVal = getNextMonotonicTestValue();
|
||||
( void ) xQueueSendFromISR( xQueueHandleStatic, &testVal, NULL );
|
||||
}
|
||||
|
|
@ -865,6 +873,7 @@ void test_xQueueReceive_in_set_blocking_success_locked_no_pending( void )
|
|||
|
||||
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
|
||||
xTaskResumeAll_Stub( &td_task_xTaskResumeAllStub );
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
|
||||
|
||||
uint32_t checkVal = INVALID_UINT32;
|
||||
|
||||
|
|
@ -929,6 +938,7 @@ void test_xQueueReceive_in_set_blocking_fail_locked_high_prio_pending( void )
|
|||
|
||||
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
|
||||
xTaskResumeAll_Stub( &xQueueReceive_xTaskResumeAllCallback );
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
|
||||
|
||||
td_task_setFakeTaskPriority( DEFAULT_PRIORITY + 1 );
|
||||
|
||||
|
|
@ -971,6 +981,7 @@ void test_xQueueReceive_in_set_blocking_success_locked_low_prio_pending( void )
|
|||
|
||||
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
|
||||
xTaskResumeAll_Stub( &xQueueReceive_xTaskResumeAllCallback );
|
||||
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
|
||||
|
||||
td_task_setFakeTaskPriority( DEFAULT_PRIORITY - 1 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue