static BaseType_t prvPeekTimeout()

in Debug_extra/FreeRTOS_demo/code_coverage_additions.c [261:293]


static BaseType_t prvPeekTimeout( void )
{
QueueHandle_t xHandle;
const UBaseType_t xQueueLength = 1;
BaseType_t xReturn = pdPASS;
TickType_t xBlockTime = ( TickType_t ) 2;
UBaseType_t uxReceived;

	/* Create the queue just to try peeking it while it is empty. */
	xHandle = xQueueCreate( xQueueLength, ( UBaseType_t ) sizeof( xQueueLength ) );

	if( xHandle != NULL )
	{
		if( uxQueueMessagesWaiting( xHandle ) != 0 )
		{
			xReturn = pdFAIL;
		}

		/* Ensure peeking from the queue times out as the queue is empty. */
		if( xQueuePeek( xHandle, &uxReceived, xBlockTime ) != pdFALSE )
		{
			xReturn = pdFAIL;
		}

		vQueueDelete( xHandle );
	}
	else
	{
		xReturn = pdFAIL;
	}

	return xReturn;
}