Skip to content

Commit 2e96145

Browse files
authored
Merge pull request #11871 from AriParkkila/test-udpechotest-timeout
TESTS: Add socket.set_timeout in udpsocket_echotest
2 parents cb54f50 + ed75443 commit 2e96145

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

TESTS/netsocket/udp/udpsocket_echotest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace {
2929
static const int SIGNAL_SIGIO_RX = 0x1;
3030
static const int SIGNAL_SIGIO_TX = 0x2;
3131
static const int SIGIO_TIMEOUT = 5000; //[ms]
32+
static const int SOCKET_TIMEOUT = (10 * 1000); //[ms]
3233
static const int RETRIES = 2;
3334

3435
static const double EXPECTED_LOSS_RATIO = 0.0;
@@ -70,6 +71,7 @@ void UDPSOCKET_ECHOTEST()
7071
UDPSocket sock;
7172
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(NetworkInterface::get_default_instance()));
7273

74+
sock.set_timeout(SOCKET_TIMEOUT);
7375
int recvd;
7476
int sent;
7577
int packets_sent = 0;

0 commit comments

Comments
 (0)