Skip to content

Commit

Permalink
Merge branch 'main' into cov
Browse files Browse the repository at this point in the history
  • Loading branch information
moninom1 committed Dec 5, 2023
2 parents 9b7a03c + d70a21c commit f47e507
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
with:
coverage-file: ./test/unit-test/build/coverage.info
branch-coverage-min: 100
line-coverage-min: 100

spell-check:
runs-on: ubuntu-latest
Expand Down
10 changes: 5 additions & 5 deletions source/FreeRTOS_ARP.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ static TickType_t xLastGratuitousARPTime = 0U;
traceARP_PACKET_RECEIVED();

/* Some extra logging while still testing. */
#if ( ipconfigHAS_PRINTF != 0 )
#if ( ipconfigHAS_DEBUG_PRINTF != 0 )
if( pxARPHeader->usOperation == ( uint16_t ) ipARP_REPLY )
{
FreeRTOS_printf( ( "ipARP_REPLY from %xip to %xip end-point %xip\n",
( unsigned ) FreeRTOS_ntohl( ulSenderProtocolAddress ),
( unsigned ) FreeRTOS_ntohl( ulTargetProtocolAddress ),
( unsigned ) FreeRTOS_ntohl( ( pxTargetEndPoint != NULL ) ? pxTargetEndPoint->ipv4_settings.ulIPAddress : 0U ) ) );
FreeRTOS_debug_printf( ( "ipARP_REPLY from %xip to %xip end-point %xip\n",
( unsigned ) FreeRTOS_ntohl( ulSenderProtocolAddress ),
( unsigned ) FreeRTOS_ntohl( ulTargetProtocolAddress ),
( unsigned ) FreeRTOS_ntohl( ( pxTargetEndPoint != NULL ) ? pxTargetEndPoint->ipv4_settings.ulIPAddress : 0U ) ) );
}
#endif /* ( ipconfigHAS_DEBUG_PRINTF != 0 ) */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,10 @@ void test_FreeRTOS_get_tx_base_InvalidParams( void )
xSocket.ucProtocol = FREERTOS_IPPROTO_TCP;
pucReturn = FreeRTOS_get_tx_base( &xSocket );
TEST_ASSERT_EQUAL( NULL, pucReturn );

xSocket.u.xTCP.bits.bMallocError == pdTRUE_UNSIGNED;
pucReturn = FreeRTOS_get_tx_base( &xSocket );
TEST_ASSERT_EQUAL( NULL, pucReturn );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ void test_vSocketBind_TCP( void )
/**
* @brief Address passed is NULL.
*/
void test_vSocketBind_TCPNULLAddress( void )
void test_vSocketBind_TCPNULLAddress_v4( void )
{
BaseType_t xReturn;
FreeRTOS_Socket_t xSocket;
Expand All @@ -603,6 +603,30 @@ void test_vSocketBind_TCPNULLAddress( void )
memset( &xSocket, 0, sizeof( xSocket ) );

xSocket.ucProtocol = ( uint8_t ) FREERTOS_IPPROTO_TCP;
xSocket.bits.bIsIPv6 = 0;

xApplicationGetRandomNumber_ExpectAnyArgsAndReturn( pdFALSE );
xReturn = vSocketBind( &xSocket, NULL, uxAddressLength, xInternal );

TEST_ASSERT_EQUAL( -pdFREERTOS_ERRNO_EADDRNOTAVAIL, xReturn );
}

/**
* @brief Address passed is NULL.
*/
void test_vSocketBind_TCPNULLAddress_v6( void )
{
BaseType_t xReturn;
FreeRTOS_Socket_t xSocket;
struct freertos_sockaddr xBindAddress;
size_t uxAddressLength;
BaseType_t xInternal = pdFALSE;

memset( &xBindAddress, 0xFC, sizeof( xBindAddress ) );
memset( &xSocket, 0, sizeof( xSocket ) );

xSocket.ucProtocol = ( uint8_t ) FREERTOS_IPPROTO_TCP;
xSocket.bits.bIsIPv6 = 1;

xApplicationGetRandomNumber_ExpectAnyArgsAndReturn( pdFALSE );
xReturn = vSocketBind( &xSocket, NULL, uxAddressLength, xInternal );
Expand Down

0 comments on commit f47e507

Please sign in to comment.