Skip to content

Commit 6adc244

Browse files
author
Antti Kauppila
committed
DNS manual cleanup mechanism added
1 parent d0b5ba6 commit 6adc244

21 files changed

+56
-2
lines changed

TESTS/netsocket/dns/asynchronous_dns.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int result_exp_timeout;
3232

3333
void ASYNCHRONOUS_DNS()
3434
{
35+
nsapi_dns_reset();
3536
do_asynchronous_gethostbyname(dns_test_hosts, 1, &result_ok, &result_no_mem, &result_dns_failure, &result_exp_timeout);
3637

3738
TEST_ASSERT_EQUAL(1, result_ok);

TESTS/netsocket/dns/asynchronous_dns_cache.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ void ASYNCHRONOUS_DNS_CACHE()
4141
Ticker ticker;
4242
ticker.attach_us(&test_dns_query_ticker, 100);
4343

44+
nsapi_dns_reset();
45+
4446
for (unsigned int i = 0; i < 5; i++) {
4547
int started_us = ticker_us;
4648

TESTS/netsocket/dns/asynchronous_dns_cancel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void ASYNCHRONOUS_DNS_CANCEL()
2929
dns_application_data *data = new dns_application_data[MBED_CONF_APP_DNS_TEST_HOSTS_NUM];
3030

3131
int count = 0;
32+
nsapi_dns_reset();
3233

3334
for (unsigned int i = 0; i < MBED_CONF_APP_DNS_TEST_HOSTS_NUM; i++) {
3435
data[i].value_set = false;

TESTS/netsocket/dns/asynchronous_dns_external_event_queue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static nsapi_error_t event_queue_call(int delay, mbed::Callback<void()> func)
5454
void ASYNCHRONOUS_DNS_EXTERNAL_EVENT_QUEUE()
5555
{
5656
// Ensures that cache does not contain entries
57+
nsapi_dns_reset();
5758
do_asynchronous_gethostbyname(dns_test_hosts, MBED_CONF_NSAPI_DNS_CACHE_SIZE, &result_ok, &result_no_mem,
5859
&result_dns_failure, &result_exp_timeout);
5960

TESTS/netsocket/dns/asynchronous_dns_invalid_host.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ int result_exp_timeout;
3333
void ASYNCHRONOUS_DNS_INVALID_HOST()
3434
{
3535
// Ensures that cache does not contain entries
36+
nsapi_dns_reset();
3637
do_asynchronous_gethostbyname(dns_test_hosts_second, MBED_CONF_NSAPI_DNS_CACHE_SIZE, &result_ok, &result_no_mem,
3738
&result_dns_failure, &result_exp_timeout);
3839

TESTS/netsocket/dns/asynchronous_dns_non_async_and_async.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ void ASYNCHRONOUS_DNS_NON_ASYNC_AND_ASYNC()
2929
dns_application_data data;
3030
data.semaphore = &semaphore;
3131

32+
nsapi_dns_reset();
33+
3234
// Initiate
3335
nsapi_error_t err = get_interface()->gethostbyname_async(dns_test_hosts_second[0],
3436
mbed::Callback<void(nsapi_error_t, SocketAddress *)>(hostbyname_cb, (void *) &data));

TESTS/netsocket/dns/asynchronous_dns_simultaneous.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int result_exp_timeout;
3232

3333
void ASYNCHRONOUS_DNS_SIMULTANEOUS()
3434
{
35+
nsapi_dns_reset();
3536
do_asynchronous_gethostbyname(dns_test_hosts_second, MBED_CONF_APP_DNS_SIMULT_QUERIES + 1, &result_ok, &result_no_mem,
3637
&result_dns_failure, &result_exp_timeout);
3738

TESTS/netsocket/dns/asynchronous_dns_simultaneous_cache.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int result_exp_timeout;
3232

3333
void ASYNCHRONOUS_DNS_SIMULTANEOUS_CACHE()
3434
{
35+
nsapi_dns_reset();
3536
do_asynchronous_gethostbyname(dns_test_hosts_second, MBED_CONF_APP_DNS_SIMULT_QUERIES + 1, &result_ok, &result_no_mem,
3637
&result_dns_failure, &result_exp_timeout);
3738

TESTS/netsocket/dns/asynchronous_dns_simultaneous_repeat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int result_exp_timeout;
3232

3333
void ASYNCHRONOUS_DNS_SIMULTANEOUS_REPEAT()
3434
{
35-
35+
nsapi_dns_reset();
3636
for (int i = 0; i < 10; i++) {
3737
do_asynchronous_gethostbyname(dns_test_hosts, MBED_CONF_APP_DNS_SIMULT_QUERIES + 1, &result_ok, &result_no_mem,
3838
&result_dns_failure, &result_exp_timeout);

TESTS/netsocket/dns/asynchronous_dns_timeouts.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static nsapi_error_t event_queue_call(int delay, mbed::Callback<void()> func)
5050
void ASYNCHRONOUS_DNS_TIMEOUTS()
5151
{
5252
// Ensures that cache does not contain entries
53+
nsapi_dns_reset();
5354
do_asynchronous_gethostbyname(dns_test_hosts, MBED_CONF_NSAPI_DNS_CACHE_SIZE, &result_ok, &result_no_mem,
5455
&result_dns_failure, &result_exp_timeout);
5556

0 commit comments

Comments
 (0)