Skip to content

Commit

Permalink
Repairing tu again
Browse files Browse the repository at this point in the history
  • Loading branch information
htibosch committed Sep 29, 2023
1 parent c05141f commit a73a8c1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
42 changes: 28 additions & 14 deletions test/unit-test/FreeRTOS_IPv4/FreeRTOS_IPv4_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ void test_prvAllowIPPacketIPv4_NotMatchingIP( void )
pxIPHeader->ucVersionHeaderLength = 0x45;
pxIPHeader->ulDestinationIPAddress = pxEndpoint->ipv4_settings.ulIPAddress + 1;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */
FreeRTOS_IsNetworkUp_ExpectAndReturn( pdTRUE );

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );
Expand Down Expand Up @@ -300,7 +301,8 @@ void test_prvAllowIPPacketIPv4_SourceIPBrdCast_DestIPMatch( void )

pxIPHeader->ulSourceIPAddress = 0xFFFFFFFF;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( pxEndpoint );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( pxEndpoint ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( pxEndpoint ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -339,7 +341,8 @@ void test_prvAllowIPPacketIPv4_SourceIPBrdCast_DestIPBrdCast( void )

pxIPHeader->ulSourceIPAddress = 0xFFFFFFFF;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -378,7 +381,8 @@ void test_prvAllowIPPacketIPv4_SourceIPBrdCast_DestIPLLMNR( void )

pxIPHeader->ulSourceIPAddress = 0xFFFFFFFF;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -413,7 +417,8 @@ void test_prvAllowIPPacketIPv4_SourceIPBrdCast_NoLocalIP( void )

pxIPHeader->ulSourceIPAddress = 0xFFFFFFFF;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */
FreeRTOS_IsNetworkUp_ExpectAndReturn( pdFALSE );

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );
Expand Down Expand Up @@ -450,7 +455,8 @@ void test_prvAllowIPPacketIPv4_DestMACBrdCast_DestIPUnicast( void )

memcpy( pxIPPacket->xEthernetHeader.xDestinationAddress.ucBytes, xBroadcastMACAddress.ucBytes, sizeof( MACAddress_t ) );

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */
FreeRTOS_IsNetworkUp_ExpectAndReturn( pdTRUE );

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );
Expand Down Expand Up @@ -486,7 +492,8 @@ void test_prvAllowIPPacketIPv4_SrcMACBrdCast( void )

memcpy( pxIPPacket->xEthernetHeader.xSourceAddress.ucBytes, xBroadcastMACAddress.ucBytes, sizeof( MACAddress_t ) );

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -523,7 +530,8 @@ void test_prvAllowIPPacketIPv4_SrcMACBrdCastDestMACBrdCast( void )
memcpy( pxIPPacket->xEthernetHeader.xSourceAddress.ucBytes, xBroadcastMACAddress.ucBytes, sizeof( MACAddress_t ) );
memcpy( pxIPPacket->xEthernetHeader.xDestinationAddress.ucBytes, xBroadcastMACAddress.ucBytes, sizeof( MACAddress_t ) );

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -565,7 +573,8 @@ void test_prvAllowIPPacketIPv4_SrcIPAddrIsMulticast( void )

pxIPHeader->ulSourceIPAddress = FreeRTOS_htonl( 0xE0000000 + 1 );

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -606,7 +615,8 @@ void test_prvAllowIPPacketIPv4_IncorrectChecksum( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

FreeRTOS_FindEndPointOnMAC_ExpectAnyArgsAndReturn( NULL );

Expand Down Expand Up @@ -651,7 +661,8 @@ void test_prvAllowIPPacketIPv4_IncorrectProtocolChecksum( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

FreeRTOS_FindEndPointOnMAC_ExpectAnyArgsAndReturn( NULL );

Expand Down Expand Up @@ -697,7 +708,8 @@ void test_prvAllowIPPacketIPv4_HappyPath( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

FreeRTOS_FindEndPointOnMAC_ExpectAnyArgsAndReturn( NULL );

Expand Down Expand Up @@ -741,7 +753,8 @@ void test_prvAllowIPPacketIPv4_LoopbackHappyPath( void )

memcpy( pxIPPacket->xEthernetHeader.xDestinationAddress.ucBytes, xMACAddress.ucBytes, sizeof( MACAddress_t ) );

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

FreeRTOS_FindEndPointOnMAC_ExpectAnyArgsAndReturn( pxEndpoint );

Expand Down Expand Up @@ -784,7 +797,8 @@ void test_prvAllowIPPacketIPv4_DestMacBroadcastIPNotBroadcast( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ void test_prvAllowIPPacketIPv4_BroadcastSourceIP( void )

pxIPHeader->ulSourceIPAddress = 0xFFFFFFFF;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -148,7 +149,8 @@ void test_prvAllowIPPacketIPv4_BufferLengthLessThanMinimum( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -194,7 +196,8 @@ void test_prvAllowIPPacketIPv4_UDPCheckSumZero( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -246,7 +249,8 @@ void test_prvAllowIPPacketIPv4_UDP_HappyPath( void )
/* Non-zero checksum. */
pxProtPack->xUDPPacket.xUDPHeader.usChecksum = 0xFF12;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down Expand Up @@ -292,7 +296,8 @@ void test_prvAllowIPPacketIPv4_TCP_HappyPath( void )

pxIPHeader->ulSourceIPAddress = 0xC0C00101;

FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL );
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* from xBadIPv4Loopback() */
FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); /* From prvAllowIPPacketIPv4() */

eResult = prvAllowIPPacketIPv4( pxIPPacket, pxNetworkBuffer, uxHeaderLength );

Expand Down

0 comments on commit a73a8c1

Please sign in to comment.