Update unit tests to match changes in queue.c (#614)

This commit is contained in:
Dan Good 2021-06-01 15:33:43 -04:00 committed by GitHub
parent ea798d0612
commit f37753da06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 57 additions and 535 deletions

View file

@ -75,47 +75,6 @@ int suiteTearDown( int numFailures )
/* ============================== Test Cases =============================== */
/**
* @brief Test xQueueSend on a member Queue (size 1) of a QueueSet (size 0)
* @details: In this case, sending to the queue causes a configASSERT, but returns pdTRUE.
* @coverage xQueueGenericSend
*/
void test_macro_xQueueSend_QueueSet_Fail( void )
{
/* Expect that xQueueCreateSet will assert because a length of 0 is invalid */
fakeAssertExpectFail();
QueueSetHandle_t xQueueSet = xQueueCreateSet( 0 );
fakeAssertGetFlagAndClear();
QueueHandle_t xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
TEST_ASSERT_EQUAL( pdTRUE, xQueueAddToSet( xQueue, xQueueSet ) );
/* Expect that xQueueSend / prvNotifyQueueSetContainer will assert because
* a QueueSet length of 0 is invalid */
fakeAssertExpectFail();
uint32_t testValue = getNextMonotonicTestValue();
TEST_ASSERT_EQUAL( pdTRUE, xQueueSend( xQueue, &testValue, 0 ) );
TEST_ASSERT_EQUAL( pdTRUE, fakeAssertGetFlagAndClear() );
QueueHandle_t xQueue2 = xQueueSelectFromSet( xQueueSet, 0 );
TEST_ASSERT_EQUAL( NULL, xQueue2 );
uint32_t checkValue = INVALID_UINT32;
TEST_ASSERT_EQUAL( pdTRUE, xQueueReceive( xQueue, &checkValue, 0 ) );
TEST_ASSERT_EQUAL( testValue, checkValue );
vQueueDelete( xQueueSet );
vQueueDelete( xQueue );
}
/**
* @brief Test xQueueSend on a member Queue (size 1) of a QueueSet (size 1)
* @details: Send an item to a queue that is part of a QueueSet.