Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong test in function prvTCPSendLoop() #1043

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/FreeRTOS_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -4546,7 +4546,7 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket )
xBytesLeft -= xByteCount;
xBytesSent += xByteCount;

if( ( xBytesLeft == 0 ) && ( pvBuffer == NULL ) )
if( ( xBytesLeft == 0 ) || ( pvBuffer == NULL ) )
{
/* pvBuffer can be NULL in case TCP zero-copy transmissions are used. */
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ void test_FreeRTOS_send_ExactSpaceInStreamBuffer( void )
xTaskResumeAll_ExpectAndReturn( pdFALSE );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );
xSendEventToIPTask_ExpectAndReturn( eTCPTimerEvent, pdPASS );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );

xReturn = FreeRTOS_send( &xSocket, pvBuffer, uxDataLength, xFlags );

Expand All @@ -1008,7 +1007,6 @@ void test_FreeRTOS_send_ExactSpaceInStreamBuffer( void )
uxStreamBufferAdd_ExpectAndReturn( xSocket.u.xTCP.txStream, 0U, pvBuffer, uxDataLength, uxDataLength );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );
xSendEventToIPTask_ExpectAndReturn( eTCPTimerEvent, pdPASS );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );
xReturn = FreeRTOS_send( &xSocket, pvBuffer, uxDataLength, xFlags );

TEST_ASSERT_EQUAL( uxDataLength, xReturn );
Expand Down Expand Up @@ -1044,7 +1042,6 @@ void test_FreeRTOS_send_MoreSpaceInStreamBuffer( void )
xTaskResumeAll_ExpectAndReturn( pdFALSE );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );
xSendEventToIPTask_ExpectAndReturn( eTCPTimerEvent, pdPASS );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );
xReturn = FreeRTOS_send( &xSocket, pvBuffer, uxDataLength, xFlags );

TEST_ASSERT_EQUAL( uxDataLength, xReturn );
Expand Down Expand Up @@ -1132,7 +1129,6 @@ void test_FreeRTOS_send_LessSpaceInStreamBuffer_EventuallySpaceAvailable( void )
uxStreamBufferAdd_ExpectAndReturn( xSocket.u.xTCP.txStream, 0U, &pvBuffer[ 80 ], 20, 20 );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );
xSendEventToIPTask_ExpectAndReturn( eTCPTimerEvent, pdFALSE );
xTaskCheckForTimeOut_ExpectAnyArgsAndReturn( pdTRUE );

xReturn = FreeRTOS_send( &xSocket, pvBuffer, uxDataLength, xFlags );

Expand Down Expand Up @@ -1290,7 +1286,6 @@ void test_FreeRTOS_send_IPTaskWithNULLBuffer_LessSpaceInStreamBuffer( void )
uxStreamBufferGetSpace_ExpectAndReturn( xSocket.u.xTCP.txStream, uxDataLength - 20 );
uxStreamBufferAdd_ExpectAndReturn( xSocket.u.xTCP.txStream, 0U, NULL, uxDataLength - 20, uxDataLength - 20 );
xIsCallingFromIPTask_ExpectAndReturn( pdTRUE );
xIsCallingFromIPTask_ExpectAndReturn( pdTRUE );

xReturn = FreeRTOS_send( &xSocket, NULL, uxDataLength, xFlags );

Expand Down Expand Up @@ -1360,7 +1355,6 @@ void test_FreeRTOS_send_ExactSpaceInStreamBufferInIPTask( void )
uxStreamBufferAdd_ExpectAndReturn( xSocket.u.xTCP.txStream, 0U, pvBuffer, uxDataLength, uxDataLength );
xTaskResumeAll_ExpectAndReturn( pdFALSE );
xIsCallingFromIPTask_ExpectAndReturn( pdTRUE );
xIsCallingFromIPTask_ExpectAndReturn( pdFALSE );

xReturn = FreeRTOS_send( &xSocket, pvBuffer, uxDataLength, xFlags );

Expand Down