diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c21195c62..9d21a66b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_TCP_API_utest.c b/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_TCP_API_utest.c index f242720d8..8a562c408 100644 --- a/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_TCP_API_utest.c +++ b/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_TCP_API_utest.c @@ -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 ); } /** diff --git a/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_privates_utest.c b/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_privates_utest.c index 53ef4625a..8c7304893 100644 --- a/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_privates_utest.c +++ b/test/unit-test/FreeRTOS_Sockets/FreeRTOS_Sockets_privates_utest.c @@ -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; @@ -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 );