+static void prvTestQueueOverwriteWithQueueSet( void )\r
+{\r
+uint32_t ulValueToSend = 0, ulValueReceived = 0;\r
+QueueHandle_t xQueueHandle = NULL, xReceivedHandle = NULL;\r
+const UBaseType_t xLengthOfOne = ( UBaseType_t ) 1;\r
+\r
+ /* Create a queue that has a length of one - a requirement in order to call\r
+ xQueueOverwrite. This will get deleted again when this test completes. */\r
+ xQueueHandle = xQueueCreate( xLengthOfOne, sizeof( uint32_t ) );\r
+\r
+ if( xQueueHandle != NULL )\r
+ {\r
+ xQueueAddToSet( xQueueHandle, xQueueSet );\r
+\r
+ /* Add an item to the queue then ensure the queue set correctly\r
+ indicates that one item is available, and that that item is indeed the\r
+ queue written to. */\r
+ xQueueSend( xQueueHandle, ( void * ) &ulValueToSend, 0 );\r
+ if( uxQueueMessagesWaiting( xQueueSet ) != ( UBaseType_t ) 1 )\r
+ {\r
+ /* Expected one item in the queue set. */\r
+ xQueueSetTasksStatus = pdFAIL;\r
+ }\r
+ xQueuePeek( xQueueSet, &xReceivedHandle, queuesetDONT_BLOCK );\r
+ if( xReceivedHandle != xQueueHandle )\r
+ {\r
+ /* Wrote to xQueueHandle so expected xQueueHandle to be the handle\r
+ held in the queue set. */\r
+ xQueueSetTasksStatus = pdFAIL;\r
+ }\r
+\r
+ /* Now overwrite the value in the queue and ensure the queue set state\r
+ doesn't change as the number of items in the queues within the set have\r
+ not changed. */\r
+ ulValueToSend++;\r
+ xQueueOverwrite( xQueueHandle, ( void * ) &ulValueToSend );\r
+ if( uxQueueMessagesWaiting( xQueueSet ) != ( UBaseType_t ) 1 )\r
+ {\r
+ /* Still expected one item in the queue set. */\r
+ xQueueSetTasksStatus = pdFAIL;\r
+ }\r
+ xReceivedHandle = xQueueSelectFromSet( xQueueSet, queuesetDONT_BLOCK );\r
+ if( xReceivedHandle != xQueueHandle )\r
+ {\r
+ /* Wrote to xQueueHandle so expected xQueueHandle to be the handle\r
+ held in the queue set. */\r
+ xQueueSetTasksStatus = pdFAIL;\r
+ }\r
+\r
+ /* Also ensure the value received from the queue is the overwritten\r
+ value, not the value originally written. */\r
+ xQueueReceive( xQueueHandle, &ulValueReceived, queuesetDONT_BLOCK );\r
+ if( ulValueReceived != ulValueToSend )\r
+ {\r
+ /* Unexpected value recevied from the queue. */\r
+ xQueueSetTasksStatus = pdFAIL;\r
+ }\r
+\r
+ /* Clean up. */\r
+ xQueueRemoveFromSet( xQueueHandle, xQueueSet );\r
+ vQueueDelete( xQueueHandle );\r
+ }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r