mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-15 17:27:46 -04:00
Update queue Unit Tests to add uxQueueItemSize (#1040)
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
9f6437ca6a
commit
8b98d08bcc
4 changed files with 35 additions and 20 deletions
|
@ -69,17 +69,17 @@ int suiteTearDown( int numFailures )
|
|||
static void test_long_queue( QueueHandle_t xQueue,
|
||||
uint32_t maxItems )
|
||||
{
|
||||
/* Veify that queue is empty */
|
||||
/* Verify that queue is empty */
|
||||
TEST_ASSERT_EQUAL( 0, uxQueueMessagesWaiting( xQueue ) );
|
||||
|
||||
queue_common_add_sequential_to_queue( xQueue, maxItems );
|
||||
|
||||
/* Veify that queue is full */
|
||||
/* Verify that queue is full */
|
||||
TEST_ASSERT_EQUAL( 0, uxQueueSpacesAvailable( xQueue ) );
|
||||
|
||||
queue_common_receive_sequential_from_queue( xQueue, maxItems, maxItems, 0 );
|
||||
|
||||
/* Veify that queue is empty */
|
||||
/* Verify that queue is empty */
|
||||
TEST_ASSERT_EQUAL( 0, uxQueueMessagesWaiting( xQueue ) );
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,10 @@ void test_macro_xQueueCreateStatic_nullQueueStorage_oneItem_zeroLength( void )
|
|||
/* validate returned queue handle */
|
||||
TEST_ASSERT_NOT_EQUAL( NULL, xQueue );
|
||||
|
||||
/* Veify that new queue is empty */
|
||||
/* Verify that Queue ItemSize is zero */
|
||||
TEST_ASSERT_EQUAL( 0, uxQueueGetQueueItemSize( xQueue ) );
|
||||
|
||||
/* Verify that new queue is empty */
|
||||
TEST_ASSERT_EQUAL( 0, uxQueueMessagesWaiting( xQueue ) );
|
||||
|
||||
/* Valdiate that the queue has 1 space remaining */
|
||||
|
@ -184,7 +187,7 @@ void test_macro_xQueueCreateStatic_validQueueStorage_oneItem_zeroLength( void )
|
|||
uint32_t queueData;
|
||||
|
||||
/* Expect that xQueueCreateStatic will assert because data storage is
|
||||
* prohibited for a zero itemLength queue */
|
||||
* prohibited for a zero itemLength queue */
|
||||
fakeAssertExpectFail();
|
||||
QueueHandle_t xQueue = xQueueCreateStatic( 1, 0, ( void * ) &queueData, &queueBuffer );
|
||||
|
||||
|
@ -205,6 +208,9 @@ void test_macro_xQueueCreateStatic_large( void )
|
|||
StaticQueue_t queueBuffer;
|
||||
QueueHandle_t xQueue = xQueueCreateStatic( MAX_QUEUE_ITEMS, sizeof( uint32_t ), ( void * ) queueStorage, &queueBuffer );
|
||||
|
||||
/* Verify that Queue ItemSize is 4 */
|
||||
TEST_ASSERT_EQUAL( 4, uxQueueGetQueueItemSize( xQueue ) );
|
||||
|
||||
test_long_queue( xQueue, MAX_QUEUE_ITEMS );
|
||||
vQueueDelete( xQueue );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue