Skip to content

Testing: Fix multihoming test compilation issues #12731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TESTS/network/multihoming/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void _ifup()
SocketAddress eth_ip_address_if;
LWIP::get_instance().get_ip_address_if(&eth_ip_address_if, interface_name[interface_num]);
printf("IP_if: %s\n", eth_ip_address.get_ip_address());
TEST_ASSERT_EQUAL(eth_ip_address_if, eth_ip_address);
TEST_ASSERT(eth_ip_address_if == eth_ip_address);
interface_num++;

wifi = WiFiInterface::get_default_instance();
Expand Down Expand Up @@ -112,7 +112,7 @@ static void _ifup()
SocketAddress wifi_ip_address_if;
LWIP::get_instance().get_ip_address_if(&wifi_ip_address_if, interface_name[interface_num]);
printf("IP_if: %s\n", STRING_VERIFY(wifi_ip_address_if.get_ip_address()));
TEST_ASSERT_EQUAL(wifi_ip_address_if, wifi_ip_address);
TEST_ASSERT(wifi_ip_address_if == wifi_ip_address);
SocketAddress wifi_netmask;
wifi->get_netmask(&wifi_netmask);
printf("Netmask: %s\n", STRING_VERIFY(wifi_netmask.get_ip_address()));
Expand Down
2 changes: 2 additions & 0 deletions TESTS/network/multihoming/multihoming_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "nsapi_dns.h"
#include "mbed_trace.h"

#define TRACE_GROUP "GRNT"

#ifndef MULTIHOMING_TESTS_H
#define MULTIHOMING_TESTS_H

Expand Down
4 changes: 2 additions & 2 deletions features/netsocket/SocketAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SocketAddress::SocketAddress(const SocketAddress &addr) : _addr(addr._addr), _po

bool SocketAddress::set_ip_address(const char *addr)
{
_ip_address.reset();
_ip_address = nullptr;

if (addr && stoip4(addr, strlen(addr), _addr.bytes)) {
_addr.version = NSAPI_IPv4;
Expand Down Expand Up @@ -73,7 +73,7 @@ void SocketAddress::set_ip_bytes(const void *bytes, nsapi_version_t version)

void SocketAddress::set_addr(const nsapi_addr_t &addr)
{
_ip_address.reset();
_ip_address = nullptr;
_addr = addr;
}

Expand Down