Add configASSERTs to alert when invalid parameters are passed into Queue Registry related functions.

Add a configASSERT when a queue is added to a QueueRegistry that is already full.
This commit is contained in:
Paul Bartell 2021-03-05 11:19:12 -08:00
parent cc3f74b90f
commit 58ba569663

View file

@ -2725,6 +2725,9 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
UBaseType_t ux;
configASSERT( xQueue );
configASSERT( pcQueueName );
/* See if there is an empty space in the registry. A NULL name denotes
* a free slot. */
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
@ -2743,6 +2746,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
mtCOVERAGE_TEST_MARKER();
}
}
/* Assert that the queue was added successfully */
configASSERT( ( ux != configQUEUE_REGISTRY_SIZE ) );
}
#endif /* configQUEUE_REGISTRY_SIZE */
@ -2755,6 +2760,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
UBaseType_t ux;
const char * pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
configASSERT( xQueue );
/* Note there is nothing here to protect against another task adding or
* removing entries from the registry while it is being searched. */
@ -2783,6 +2790,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
UBaseType_t ux;
configASSERT( xQueue );
/* See if the handle of the queue being unregistered in actually in the
* registry. */
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )