Skip to content

Commit e53b69b

Browse files
authored
Merge pull request #12548 from VeijoPesonen/fix_tests-integration-fs
tests-integration-net-single: fix build error
2 parents 744889a + 9dbd5ed commit e53b69b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

TESTS/integration/COMMON/download_test.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,17 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
8484
TEST_ASSERT_MESSAGE((MAX_THREADS * RECV_BUF_SIZE) >= buff_size, "Cannot test with the requested buffer size");
8585

8686
/* setup TCP socket */
87-
TCPSocket tcpsocket(interface);
87+
TCPSocket tcpsocket;
88+
SocketAddress tcp_addr;
89+
90+
interface->gethostbyname(dl_host, &tcp_addr);
91+
tcp_addr.set_port(80);
92+
93+
nsapi_error_t err = tcpsocket.open(interface);
94+
TEST_ASSERT_EQUAL_INT_MESSAGE(NSAPI_ERROR_OK, err, "unable to open socket");
8895

8996
for (int tries = 0; tries < MAX_RETRIES; tries++) {
90-
result = tcpsocket.connect(dl_host, 80);
97+
result = tcpsocket.connect(tcp_addr);
9198
TEST_ASSERT_MESSAGE(result != NSAPI_ERROR_NO_SOCKET, "out of sockets");
9299

93100
if (result == 0) {

0 commit comments

Comments
 (0)