Skip to content

Commit aa80d6d

Browse files
author
Mika Leppänen
committed
Updated greentea DNS tests to use default interface
1 parent 5fa2edc commit aa80d6d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

TESTS/netsocket/dns/main.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
* limitations under the License.
1616
*/
1717

18-
#ifndef MBED_CONF_APP_CONNECT_STATEMENT
18+
#define WIFI 2
19+
#if !defined(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE) || \
20+
(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == WIFI && !defined(MBED_CONF_NSAPI_DEFAULT_WIFI_SSID))
1921
#error [NOT_SUPPORTED] No network configuration found for this target.
2022
#endif
2123

@@ -27,8 +29,6 @@
2729
#include "EventQueue.h"
2830
#include "dns_tests.h"
2931

30-
#include MBED_CONF_APP_HEADER_FILE
31-
3232
using namespace utest::v1;
3333

3434
namespace {
@@ -116,12 +116,10 @@ static void net_bringup()
116116
{
117117
MBED_ASSERT(MBED_CONF_APP_DNS_TEST_HOSTS_NUM >= MBED_CONF_NSAPI_DNS_CACHE_SIZE && MBED_CONF_APP_DNS_TEST_HOSTS_NUM >= MBED_CONF_APP_DNS_SIMULT_QUERIES + 1);
118118

119-
net = MBED_CONF_APP_OBJECT_CONSTRUCTION;
120-
int err = MBED_CONF_APP_CONNECT_STATEMENT;
121-
TEST_ASSERT_EQUAL(0, err);
122-
123-
printf("MBED: Connected to network\n");
124-
printf("MBED: IP Address: %s\n", net->get_ip_address());
119+
net = NetworkInterface::get_default_instance();
120+
nsapi_error_t err = net->connect();
121+
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
122+
printf("MBED: IP address is '%s'\n", net->get_ip_address());
125123
}
126124

127125
// Test setup

0 commit comments

Comments
 (0)