* Fix tests needed for https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/435

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
pull/768/head
Gaurav-Aggarwal-AWS 3 years ago committed by GitHub
parent 598508a10b
commit 26dcb22052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -107,6 +107,7 @@ void test_xQueueReceive_blocking_success_locked_no_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &td_task_xTaskResumeAllStub );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
uint32_t checkVal = INVALID_UINT32;
@ -138,6 +139,7 @@ void test_xQueuePeek_blocking_success_locked_no_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &td_task_xTaskResumeAllStub );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
uint32_t checkVal = INVALID_UINT32;
@ -193,6 +195,7 @@ void test_xQueueReceive_blocking_timeout_locked_high_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xQueueReceive_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY + 1 );
@ -232,6 +235,7 @@ void test_xQueuePeek_blocking_timeout_locked_high_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xQueueReceive_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY + 1 );
@ -271,6 +275,7 @@ void test_xQueueReceive_blocking_success_locked_low_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xQueueReceive_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY - 1 );
@ -306,6 +311,7 @@ void test_xQueuePeek_blocking_success_locked_low_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueReceive_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xQueueReceive_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY - 1 );

@ -1001,6 +1001,8 @@ void test_xQueueReceiveFromISR_locked( void )
( void ) xQueueSend( xQueue, &testVal, 0 );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
/* Set private lock counters */
vSetQueueRxLock( xQueue, queueLOCKED_UNMODIFIED );
vSetQueueTxLock( xQueue, queueLOCKED_UNMODIFIED );
@ -1043,6 +1045,10 @@ void test_xQueueReceiveFromISR_locked_overflow( void )
uint32_t checkVal = INVALID_UINT32;
/* The number of tasks need to be more than 127 to trigger the
* overflow assertion. */
uxTaskGetNumberOfTasks_IgnoreAndReturn( 128 );
/* Expect an assertion since the cRxLock value has overflowed */
fakeAssertExpectFail();

@ -114,6 +114,7 @@ void test_macro_xQueueSend_blocking_success_locked_no_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueSend_locked_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &td_task_xTaskResumeAllStub );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
uint32_t testVal2 = getLastMonotonicTestValue() + 12345;
@ -169,6 +170,7 @@ void test_macro_xQueueSend_blocking_fail_locked_high_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueSend_locked_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xQueueSend_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
/* this task is lower priority than the pending task */
td_task_setFakeTaskPriority( DEFAULT_PRIORITY + 1 );
@ -215,6 +217,7 @@ void test_macro_xQueueSend_blocking_success_locked_low_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xQueueSend_locked_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xQueueSend_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
/* The pending task is lower priority */
td_task_setFakeTaskPriority( DEFAULT_PRIORITY - 1 );

@ -604,6 +604,7 @@ void test_macro_xQueueSendFromISR_locked( void )
vSetQueueTxLock( xQueue, queueLOCKED_UNMODIFIED );
vFakePortAssertIfInterruptPriorityInvalid_Expect();
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
uint32_t testval = getNextMonotonicTestValue();
@ -641,6 +642,10 @@ void test_macro_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();

@ -438,6 +438,7 @@ void test_xSemaphoreGiveFromISR_locked( void )
vSetQueueTxLock( xSemaphore, queueLOCKED_UNMODIFIED );
vFakePortAssertIfInterruptPriorityInvalid_Expect();
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( pdTRUE, xSemaphoreGiveFromISR( xSemaphore, NULL ) );
@ -466,6 +467,11 @@ void test_xSemaphoreGiveFromISR_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();
@ -645,6 +651,8 @@ void test_xSemaphoreTake_blocking_success( void )
vFakePortAssertIfInterruptPriorityInvalid_Ignore();
xTaskCheckForTimeOut_Stub( &blocking_success_xTaskCheckForTimeOut_cb );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( pdTRUE, xSemaphoreTake( xSemaphore, TICKS_TO_WAIT ) );
@ -690,6 +698,7 @@ void test_xSemaphoreTake_blocking_success_last_chance( void )
vFakePortAssertIfInterruptPriorityInvalid_Expect();
xTaskCheckForTimeOut_Stub( &blocking_last_chance_xTaskCheckForTimeOut_cb );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( pdTRUE, xSemaphoreTake( xSemaphore, TICKS_TO_WAIT ) );
@ -759,6 +768,7 @@ static BaseType_t xSemaphoreTake_xTaskCheckForTimeOutCB( TimeOut_t * const pxTim
if( cmock_num_calls == NUM_CALLS_TO_INTERCEPT )
{
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_TRUE( xSemaphoreGiveFromISR( xSemaphoreHandleStatic, NULL ) );
TEST_ASSERT_EQUAL( 1, uxQueueMessagesWaiting( xSemaphoreHandleStatic ) );
}
@ -783,6 +793,7 @@ void test_xSemaphoreTake_blocking_success_locked_no_pending( void )
xTaskCheckForTimeOut_Stub( &xSemaphoreTake_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &td_task_xTaskResumeAllStub );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( pdTRUE, xSemaphoreTake( xSemaphore, TICKS_TO_WAIT ) );
@ -835,6 +846,7 @@ void test_xSemaphoreTake_blocking_timeout_locked_high_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xSemaphoreTake_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xSemaphoreTake_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY + 1 );

@ -419,6 +419,7 @@ void test_xSemaphoreTake_blocking_success( void )
vFakePortAssertIfInterruptPriorityInvalid_Expect();
xTaskCheckForTimeOut_Stub( &blocking_xTaskCheckForTimeOut_cb );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( 0, uxSemaphoreGetCount( xSemaphore ) );
@ -468,6 +469,7 @@ void test_xSemaphoreTake_blocking_success_last_chance( void )
vFakePortAssertIfInterruptPriorityInvalid_Expect();
xTaskCheckForTimeOut_Stub( &blocking_last_chance_xTaskCheckForTimeOut_cb );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( 0, uxSemaphoreGetCount( xSemaphore ) );
@ -564,6 +566,7 @@ void test_xSemaphoreTake_blocking_success_locked_no_pending( void )
xTaskCheckForTimeOut_Stub( &xSemaphoreTake_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &td_task_xTaskResumeAllStub );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
TEST_ASSERT_EQUAL( pdTRUE, xSemaphoreTake( xSemaphore, TICKS_TO_WAIT ) );
@ -616,6 +619,7 @@ void test_xSemaphoreTake_blocking_timeout_locked_high_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xSemaphoreTake_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xSemaphoreTake_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY + 1 );
@ -653,6 +657,7 @@ void test_xSemaphoreTake_blocking_success_locked_low_prio_pending( void )
xTaskCheckForTimeOut_Stub( &xSemaphoreTake_xTaskCheckForTimeOutCB );
xTaskResumeAll_Stub( &xSemaphoreTake_xTaskResumeAllCallback );
uxTaskGetNumberOfTasks_IgnoreAndReturn( 1 );
td_task_setFakeTaskPriority( DEFAULT_PRIORITY - 1 );

@ -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…
Cancel
Save