Skip to content

Fixes NUCLEO_F746ZG gethostbyname test compiled with IAR #5689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions TESTS/netsocket/gethostbyname/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,18 @@

using namespace utest::v1;

namespace {
// Hostname for testing against
// Must have A and AAAA records
#ifndef MBED_DNS_TEST_HOST
#define MBED_DNS_TEST_HOST "connector.mbed.com"
#endif


const char *DNS_TEST_HOST = "connector.mbed.com";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi
Please check #5576
I would like to be able to define this host name with MBED app json file.
Thx

// Address info from stack
const char *ip_literal;
nsapi_version_t ip_pref;
const char *ip_pref_repr;

// Network setup
NetworkInterface *net;
}

void net_bringup() {
net = MBED_CONF_APP_OBJECT_CONSTRUCTION;
Expand All @@ -59,9 +57,9 @@ void net_bringup() {
// DNS tests
void test_dns_query() {
SocketAddress addr;
int err = net->gethostbyname(MBED_DNS_TEST_HOST, &addr);
int err = net->gethostbyname(DNS_TEST_HOST, &addr);
printf("DNS: query \"%s\" => \"%s\"\n",
MBED_DNS_TEST_HOST, addr.get_ip_address());
DNS_TEST_HOST, addr.get_ip_address());

TEST_ASSERT_EQUAL(0, err);
TEST_ASSERT((bool)addr);
Expand All @@ -70,9 +68,9 @@ void test_dns_query() {

void test_dns_query_pref() {
SocketAddress addr;
int err = net->gethostbyname(MBED_DNS_TEST_HOST, &addr, ip_pref);
int err = net->gethostbyname(DNS_TEST_HOST, &addr, ip_pref);
printf("DNS: query %s \"%s\" => \"%s\"\n",
ip_pref_repr, MBED_DNS_TEST_HOST, addr.get_ip_address());
ip_pref_repr, DNS_TEST_HOST, addr.get_ip_address());

TEST_ASSERT_EQUAL(0, err);
TEST_ASSERT((bool)addr);
Expand Down