Merge pull request #9288 from michalpasztamobica/gemalto_crinterion_test_updates

Gemalto Crinterion UDP test adjustments
pull/10931/head
Cruz Monrreal 2019-01-16 22:06:45 -06:00 committed by GitHub
commit bfc46467d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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;
}

View File

@ -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());