mbed-os/TESTS/netsocket
Wolfgang Betz 8ec9f6b430 Correct test `socket_sigio`
A call to

    `TCPSocket::recv(void *data, nsapi_size_t size)`

returns, following the mbed documentation, the number of received bytes on
success, and a negative error code on failure.

So in case of success, the return value depends on both the value of parameter
`size` but also on the amount of data already available. This means, that the
value returned can be lower than or equal to the `size` of the `data` buffer
passed as argument to the call.

Therefore, in the cases of `test_tcp_hello_world()` & `find_substring()`
(i.e. test `socket_sigio`), the calls to `TCPSocket::recv()` might return from
one byte up to `sizeof(buffer) - 1` (i.e. 511) bytes for each single call,
while the tests expect to receive the whole response string with a single call.

This commit applies a fix to this situation by implementing a receive loop
which exits once there is no data anymore available to be read from the socket.
2018-02-02 10:29:46 +01:00
..
connectivity Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
gethostbyname tests-netsocket-gethostbyname 2017-12-04 17:55:07 +01:00
host_tests Add netsocket tests 2017-09-20 18:27:58 -05:00
ip_parsing Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
socket_sigio Correct test `socket_sigio` 2018-02-02 10:29:46 +01:00
tcp_echo ESP8266 test config and tcp_echo test fix for ESP8266 2018-01-08 14:18:06 -06:00
tcp_echo_parallel Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
tcp_hello_world Fix tcp_hello_world test to receive all the data from http response 2018-01-08 14:18:06 -06:00
tcp_packet_pressure Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
tcp_packet_pressure_parallel Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
udp_dtls_handshake Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
udp_echo tests-netsocket-udp_echo 2017-12-04 17:55:08 +01:00
udp_echo_parallel Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
udp_packet_pressure Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
udp_packet_pressure_parallel Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00