Merge pull request #11871 from AriParkkila/test-udpechotest-timeout

TESTS: Add socket.set_timeout in udpsocket_echotest
pull/11901/head
Martin Kojtal 2019-11-16 07:55:53 +01:00 committed by GitHub
commit 2e96145b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,7 @@ namespace {
static const int SIGNAL_SIGIO_RX = 0x1;
static const int SIGNAL_SIGIO_TX = 0x2;
static const int SIGIO_TIMEOUT = 5000; //[ms]
static const int SOCKET_TIMEOUT = (10 * 1000); //[ms]
static const int RETRIES = 2;
static const double EXPECTED_LOSS_RATIO = 0.0;
@ -70,6 +71,7 @@ void UDPSOCKET_ECHOTEST()
UDPSocket sock;
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(NetworkInterface::get_default_instance()));
sock.set_timeout(SOCKET_TIMEOUT);
int recvd;
int sent;
int packets_sent = 0;