From 6e629e1ba66aa2df389f7718849c3f40ce7d60ad Mon Sep 17 00:00:00 2001 From: Michal Paszta Date: Tue, 8 Jan 2019 11:50:28 +0100 Subject: [PATCH] Gemalto Crinterion UDP test adjustments Adjusting the tests to match the cellular modems ELS61-E2 and BGS2-W requirements. --- TESTS/netsocket/udp/udpsocket_echotest.cpp | 4 ++++ TESTS/netsocket/udp/udpsocket_sendto_timeout.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TESTS/netsocket/udp/udpsocket_echotest.cpp b/TESTS/netsocket/udp/udpsocket_echotest.cpp index 09b27254e6..6ac5c1e624 100644 --- a/TESTS/netsocket/udp/udpsocket_echotest.cpp +++ b/TESTS/netsocket/udp/udpsocket_echotest.cpp @@ -109,6 +109,10 @@ void udpsocket_echotest_nonblock_receiver(void *receive_bytes) wait_ms(WAIT2RECV_TIMEOUT); --retry_cnt; continue; + } else if (recvd < 0) { + printf("sock.recvfrom returned %d\n", recvd); + TEST_FAIL(); + break; } else if (recvd == expt2recv) { break; } diff --git a/TESTS/netsocket/udp/udpsocket_sendto_timeout.cpp b/TESTS/netsocket/udp/udpsocket_sendto_timeout.cpp index 5fdcb39af7..8d17cebb11 100644 --- a/TESTS/netsocket/udp/udpsocket_sendto_timeout.cpp +++ b/TESTS/netsocket/udp/udpsocket_sendto_timeout.cpp @@ -43,12 +43,14 @@ void UDPSOCKET_SENDTO_TIMEOUT() TEST_ASSERT_EQUAL(sizeof(tx_buffer), sent); TEST_ASSERT(timer.read_ms() <= 100); + sock.set_timeout(1000); + timer.reset(); timer.start(); sent = sock.sendto(udp_addr, tx_buffer, sizeof(tx_buffer)); timer.stop(); TEST_ASSERT_EQUAL(sizeof(tx_buffer), sent); - TEST_ASSERT(timer.read_ms() <= 100); + TEST_ASSERT(timer.read_ms() <= 1000); printf("MBED: Time taken: %fs\n", timer.read()); TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close());