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.
As mut['mcu'] can be "None" on unknown targets, the detect_targets script crashes when one of these boards is connected.
This happens when "mbed-cli detect -vv" is ran when a STEVAL-3DP001V1 board is connected. Which does not provide a html file with a target_id, and thus cannot be looked up in the mbedls platform database.
http://www.st.com/en/evaluation-tools/steval-3dp001v1.html
- Modified the expected error code in some of the test cases. The error
message is now issued by the JSON validator.
- Stop validation code being called if no application configuration is
given to validate.
- Change test mock code to check for specific calls, instead of number of
calls.
- Derive absolute paths for JSON schema files before loading them, which
seems to work better with the URI path resolution of the schema parser.
- Moved all common definitions from schema_app and schema_lib into a
separate definitions file.
- Changed the calling code to resolve multiple schema files correctly.
- Removed the config_path setting from schema and moved the addition of the
config_path value after the validation is done.
- Altered the macro validation regex to be more lenient. Now verifies that
if '=' is used in the macro definition that something comes after it.
- Added app and lib JSON schema definition files which specify the valid
keys and values that can be used in mbed library and application
configuration files. The primary different between the app and lib
schema is that the lib config requires a name key.
- Modified the expected error code in some of the test cases. The error
message is now issued by the JSON validator.
- Added some validation code to the config script which checks the
validity of the mbed_app.json file when it is initially loaded.
- Added some validation code to config script which checks each of the
mbed_lib.json scripts when they are loaded.
- Removed manual checks for allowable config keys from within the mbed_app
and mbed_lib json files.
- Removed the check_dict_types() function which was no longer being
called.
We currently don't have a mechanism for selecting tests based on the
available ram/heap, so the best solution right now is to disable these
tests specifically for this target.