Modify multihoming tests to use get_ip_address_if

pull/12063/head
Michal Paszta 2019-12-10 07:46:53 +02:00
parent d5d04ebb90
commit 92e237414e
1 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#include "utest.h"
#include "utest/utest_stack_trace.h"
#include "multihoming_tests.h"
#include "LWIPStack.h"
using namespace utest::v1;
@ -77,6 +78,10 @@ static void _ifup()
SocketAddress eth_ip_address;
eth->get_ip_address(&eth_ip_address);
printf("MBED: IP address is '%s' interface name %s\n", eth_ip_address.get_ip_address(), interface_name[interface_num]);
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);
interface_num++;
wifi = WiFiInterface::get_default_instance();
@ -104,6 +109,10 @@ static void _ifup()
SocketAddress wifi_ip_address;
wifi->get_ip_address(&wifi_ip_address);
printf("IP: %s\n", STRING_VERIFY(wifi_ip_address.get_ip_address()));
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);
SocketAddress wifi_netmask;
wifi->get_netmask(&wifi_netmask);
printf("Netmask: %s\n", STRING_VERIFY(wifi_netmask.get_ip_address()));