Skip to content

Commit

Permalink
FreeRTOS_ND_utest::test_SendPingRequestIPv6_Assert: Rm failing but re…
Browse files Browse the repository at this point in the history
…dundant test

Gcc 11 AddressSanitizer says:

    ==7143==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/asan/asan_descriptions.cpp:80 "((0 && "Address is not in memory and not in shadow?")) != (0)" (0x0, 0x0)
    #0 0x7ff6c812f9a8 in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cpp:74
    FreeRTOS#1 0x7ff6c815032e in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:78
    FreeRTOS#2 0x7ff6c809fa77 in GetShadowKind ../../../../src/libsanitizer/asan/asan_descriptions.cpp:80
    FreeRTOS#3 0x7ff6c809fa77 in __asan::GetShadowAddressInformation(unsigned long, __asan::ShadowAddressDescription*) ../../../../src/libsanitizer/asan/asan_descriptions.cpp:96
    FreeRTOS#4 0x7ff6c809fa77 in __asan::GetShadowAddressInformation(unsigned long, __asan::ShadowAddressDescription*) ../../../../src/libsanitizer/asan/asan_descriptions.cpp:93
    FreeRTOS#5 0x7ff6c80a1296 in __asan::AddressDescription::AddressDescription(unsigned long, unsigned long, bool) ../../../../src/libsanitizer/asan/asan_descriptions.cpp:441
    FreeRTOS#6 0x7ff6c80a3a84 in __asan::ErrorGeneric::ErrorGeneric(unsigned int, unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long) ../../../../src/libsanitizer/asan/asan_errors.cpp:389
    FreeRTOS#7 0x7ff6c812efc5 in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) ../../../../src/libsanitizer/asan/asan_report.cpp:476
    FreeRTOS#8 0x7ff6c80abc44 in __interceptor_memset ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:799
    FreeRTOS#9 0x55f2e38a3620 in FreeRTOS_SendPingRequestIPv6 build/u22/Annexed_TCP_Sources/FreeRTOS_ND.c:768
    FreeRTOS#10 0x55f2e3893053 in test_SendPingRequestIPv6_Assert test/unit-test/FreeRTOS_ND/FreeRTOS_ND_utest.c:1065
    FreeRTOS#11 0x55f2e389c5dd in run_test build/u22/FreeRTOS_ND_utest_runner.c:201
    FreeRTOS#12 0x55f2e389ca84 in main build/u22/FreeRTOS_ND_utest_runner.c:252
    FreeRTOS#13 0x7ff6c6bcbd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    FreeRTOS#14 0x7ff6c6bcbe3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    FreeRTOS#15 0x55f2e38873d4 in _start (build/u22/bin/tests/FreeRTOS_ND_utest+0x233d4

The test was unneeded for coverage. Let's remove.
  • Loading branch information
anordal committed May 28, 2024
1 parent 1422de0 commit 4619c9f
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions test/unit-test/FreeRTOS_ND/FreeRTOS_ND_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,41 +1033,6 @@ void test_SendPingRequestIPv6_NULL_Buffer( void )
TEST_ASSERT_EQUAL( xReturn, pdFAIL );
}

/**
* @brief This function handles sending and IPv6 ping request
* assert as pxEndPoint->bits.bIPv6 is not set.
*/
void test_SendPingRequestIPv6_Assert( void )
{
NetworkEndPoint_t xEndPoint, * pxEndPoint = &xEndPoint;
NetworkBufferDescriptor_t xNetworkBuffer, * pxNetworkBuffer = &xNetworkBuffer;
uint8_t ucEthernetBuffer[ 1500 ] = { 0 };
IPv6_Address_t xIPAddress;
size_t uxNumberOfBytesToSend = 100;
BaseType_t xReturn;
uint16_t usSequenceNumber = 1;

xNetworkBuffer.pucEthernetBuffer = ucEthernetBuffer;
( void ) memcpy( xIPAddress.ucBytes, xDefaultIPAddress.ucBytes, ipSIZE_OF_IPv6_ADDRESS );

pxEndPoint->bits.bIPv6 = 1;
FreeRTOS_FindEndPointOnIP_IPv6_ExpectAnyArgsAndReturn( NULL );
xIPv6_GetIPType_ExpectAnyArgsAndReturn( eIPv6_Global );

FreeRTOS_FirstEndPoint_ExpectAnyArgsAndReturn( pxEndPoint );
xIPv6_GetIPType_ExpectAnyArgsAndReturn( eIPv6_Global );


uxGetNumberOfFreeNetworkBuffers_ExpectAndReturn( 4U );
pxGetNetworkBufferWithDescriptor_ExpectAnyArgsAndReturn( pxNetworkBuffer );
xSendEventStructToIPTask_IgnoreAndReturn( pdPASS );

xReturn = FreeRTOS_SendPingRequestIPv6( &xIPAddress, uxNumberOfBytesToSend, 0 );

/*Returns ping sequence number */
TEST_ASSERT_EQUAL( xReturn, usSequenceNumber );
}

/**
* @brief This function handles sending and IPv6 ping request
* and returning the sequence number in case of success.
Expand Down

0 comments on commit 4619c9f

Please sign in to comment.