Fix netsocket tests for IAR

Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
pull/11220/head
Teppo Järvelin 2019-08-15 15:26:36 +03:00
parent 6a17d74b55
commit 65bf17eff5
3 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ static void _ifup()
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address());
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address() ? net->get_ip_address() : "null");
}
static void _ifdown()

View File

@ -94,7 +94,7 @@ static void _ifup()
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("MBED: TLSClient IP address is '%s'\n", net->get_ip_address());
printf("MBED: TLSClient IP address is '%s'\n", net->get_ip_address() ? net->get_ip_address() : "null");
}
static void _ifdown()

View File

@ -59,7 +59,7 @@ static void _ifup()
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("MBED: UDPClient IP address is '%s'\n", net->get_ip_address());
printf("MBED: UDPClient IP address is '%s'\n", net->get_ip_address() ? net->get_ip_address() : "null");
}
static void _ifdown()