Skip to content

Commit ce36104

Browse files
author
Teppo Järvelin
committed
Fix netsocket DNS test 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'.
1 parent 9bf85ef commit ce36104

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TESTS/netsocket/dns/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static void net_bringup()
160160
net = NetworkInterface::get_default_instance();
161161
nsapi_error_t err = net->connect();
162162
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
163-
printf("MBED: IP address is '%s'\n", net->get_ip_address());
163+
printf("MBED: IP address is '%s'\n", net->get_ip_address() ? net->get_ip_address() : "null");
164164
}
165165

166166
static void net_bringdown()

0 commit comments

Comments
 (0)