Skip to content

Commit 2cd10fc

Browse files
authored
Merge pull request #11421 from tymoteuszblochmobica/dns_cache
Dns synchronous cache fix
2 parents 91515fe + 126ac1e commit 2cd10fc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

TESTS/netsocket/dns/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Case cases[] = {
187187
Case("ASYNCHRONOUS_DNS", ASYNCHRONOUS_DNS),
188188
Case("ASYNCHRONOUS_DNS_SIMULTANEOUS", ASYNCHRONOUS_DNS_SIMULTANEOUS),
189189
Case("ASYNCHRONOUS_DNS_SIMULTANEOUS_CACHE", ASYNCHRONOUS_DNS_SIMULTANEOUS_CACHE),
190+
Case("SYNCHRONOUS_DNS_CACHE", SYNCHRONOUS_DNS_CACHE),
190191
#ifndef MBED_CONF_CELLULAR_OFFLOAD_DNS_QUERIES
191192
Case("ASYNCHRONOUS_DNS_CACHE", ASYNCHRONOUS_DNS_CACHE),
192193
#endif

TESTS/netsocket/dns/synchronous_dns_cache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void SYNCHRONOUS_DNS_CACHE()
4040
for (unsigned int i = 0; i < 5; i++) {
4141
SocketAddress address;
4242
int started_us = ticker_us;
43-
nsapi_error_t err = get_interface()->gethostbyname(dns_test_hosts_second[0], &address);
43+
nsapi_error_t err = get_interface()->gethostbyname(dns_test_hosts[0], &address);
4444

4545
int delay_ms = (ticker_us - started_us) / 1000;
4646

@@ -49,6 +49,6 @@ void SYNCHRONOUS_DNS_CACHE()
4949
TEST_ASSERT_TRUE(i == 0 || delay_ms <= delay_first);
5050

5151
printf("DNS: query \"%s\" => \"%s\", time %i ms\n",
52-
dns_test_hosts_second[0], address.get_ip_address(), delay_ms);
52+
dns_test_hosts[0], address.get_ip_address(), delay_ms);
5353
}
5454
}

0 commit comments

Comments
 (0)