Add tests for the length caps within xStreamBufferSend(). (#319)

This commit is contained in:
RichardBarry 2020-10-11 10:27:47 -07:00 committed by GitHub
parent 00247a7637
commit e07d681cc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 142 additions and 21 deletions

View file

@ -193,6 +193,17 @@ UBaseType_t uxOriginalPriority;
( void ) xExpectedSpace;
( void ) xNextLength;
/* Try sending more bytes than possible, first using the FromISR version, then
with an infinite block time to ensure this task does not lock up. */
xReturned = xMessageBufferSendFromISR( xMessageBuffer, ( void * ) pucData, mbMESSAGE_BUFFER_LENGTH_BYTES + sizeof( configMESSAGE_BUFFER_LENGTH_TYPE ), NULL );
configASSERT( xReturned == ( size_t ) 0 );
/* In case configASSERT() is not defined. */
( void ) xReturned;
xReturned = xMessageBufferSend( xMessageBuffer, ( void * ) pucData, mbMESSAGE_BUFFER_LENGTH_BYTES + sizeof( configMESSAGE_BUFFER_LENGTH_TYPE ), portMAX_DELAY );
configASSERT( xReturned == ( size_t ) 0 );
/* In case configASSERT() is not defined. */
( void ) xReturned;
/* The buffer is 50 bytes long. When an item is added to the buffer an
additional 4 bytes are added to hold the item's size. That means adding
6 bytes to the buffer will actually add 10 bytes to the buffer. Therefore,