diff --git a/libraries/tests/net/helloworld/tcpclient/main.cpp b/libraries/tests/net/helloworld/tcpclient/main.cpp index 02ba6b74fd..4d1d05014f 100644 --- a/libraries/tests/net/helloworld/tcpclient/main.cpp +++ b/libraries/tests/net/helloworld/tcpclient/main.cpp @@ -24,6 +24,11 @@ bool find_substring(const char *first, const char *last, const char *s_first, co } int main() { + TEST_TIMEOUT(20); + TEST_HOSTTEST(default_auto); + TEST_DESCRIPTION(TCP client hello world); + TEST_START("NET_1"); + bool result = false; EthernetInterface eth; eth.init(); //Use DHCP @@ -76,6 +81,5 @@ int main() { sock.close(); eth.disconnect(); - notify_completion(result); - return 0; + TEST_RESULT(result); } diff --git a/libraries/tests/net/helloworld/udpclient/main.cpp b/libraries/tests/net/helloworld/udpclient/main.cpp index 843d906ca2..ecf1970e6b 100644 --- a/libraries/tests/net/helloworld/udpclient/main.cpp +++ b/libraries/tests/net/helloworld/udpclient/main.cpp @@ -10,6 +10,11 @@ namespace { int main() { + TEST_TIMEOUT(20); + TEST_HOSTTEST(default_auto); + TEST_DESCRIPTION(NIST Internet Time Service); + TEST_START("NET_2"); + bool result = false; EthernetInterface eth; eth.init(); //Use DHCP @@ -34,9 +39,11 @@ int main() { if (n > 0) { result = true; const unsigned int timeRes = ntohl(in_buffer_uint); - const float years = timeRes / 60.0 / 60.0 / 24.0 / 365; + const float years = timeRes / 60.0 / 60.0 / 24.0 / 365.0; + const float days = timeRes / 24.0 / 60.0 / 60.0; printf("UDP: Received %d bytes from server %s on port %d\r\n", n, nist.get_address(), nist.get_port()); printf("UDP: %u seconds since 01/01/1900 00:00 GMT ... %s\r\n", timeRes, timeRes > 0 ? "[OK]" : "[FAIL]"); + printf("UDP: %.2f days since 01/01/1900 00:00 GMT ... %s\r\n", days, timeRes > 0 ? "[OK]" : "[FAIL]"); printf("UDP: %.2f years since 01/01/1900 00:00 GMT ... %s\r\n", years, timeRes > YEARS_TO_PASS ? "[OK]" : "[FAIL]"); if (years < YEARS_TO_PASS) { @@ -45,6 +52,5 @@ int main() { } sock.close(); eth.disconnect(); - notify_completion(result); - return 0; + TEST_RESULT(result); }