Skip to content

Commit

Permalink
FreeRTOS_DNS_utest.c: Fix size to copy when copying pointers instead …
Browse files Browse the repository at this point in the history
…of target
  • Loading branch information
anordal committed Jun 3, 2024
1 parent 2b31142 commit c98731f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/unit-test/FreeRTOS_DNS/FreeRTOS_DNS_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,17 +829,16 @@ void test_FreeRTOS_getaddrinfo_a_IPv6AddressFound( void )
void test_FreeRTOS_getaddrinfo_a_IPv4DomainCacheFound( void )
{
BaseType_t xReturn;
struct freertos_addrinfo xAddress, * pxAddress = &xAddress;
struct freertos_addrinfo * pxAddress;
struct freertos_addrinfo xExpectedAddress, * pxExpectedAddress = &xExpectedAddress;

memset( &xAddress, 0, sizeof( struct freertos_addrinfo ) );
memset( &xExpectedAddress, 0, sizeof( struct freertos_addrinfo ) );

xExpectedAddress.ai_family = FREERTOS_AF_INET4;

FreeRTOS_inet_addr_ExpectAndReturn( GOOD_ADDRESS, 0 );
Prepare_CacheLookup_ExpectAndReturn( GOOD_ADDRESS, FREERTOS_AF_INET4, &pxAddress, DOTTED_IPV4_ADDRESS_UINT32 );
Prepare_CacheLookup_ReturnMemThruPtr_ppxAddressInfo( &pxExpectedAddress, sizeof( struct freertos_addrinfo ) );
Prepare_CacheLookup_ReturnMemThruPtr_ppxAddressInfo( &pxExpectedAddress, sizeof( struct freertos_addrinfo * ) );

xReturn = FreeRTOS_getaddrinfo_a( GOOD_ADDRESS, "Service", NULL, &pxAddress, dns_callback, NULL, 0U );

Expand Down

0 comments on commit c98731f

Please sign in to comment.