tests/ssl_helpers: Check that message queue is popped
mbedtls_test_mock_tcp_recv_msg is currently popping a message
queue and does not check if this was done correctly.
This extra check makes the test more complete/robust.
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
diff --git a/tests/src/test_helpers/ssl_helpers.c b/tests/src/test_helpers/ssl_helpers.c
index 255849f..16fa38a 100644
--- a/tests/src/test_helpers/ssl_helpers.c
+++ b/tests/src/test_helpers/ssl_helpers.c
@@ -551,7 +551,10 @@
* happen in test environment, unless forced manually. */
}
}
- mbedtls_test_ssl_message_queue_pop_info(queue, buf_len);
+ ret = mbedtls_test_ssl_message_queue_pop_info(queue, buf_len);
+ if (ret < 0) {
+ return ret;
+ }
return (msg_len > INT_MAX) ? INT_MAX : (int) msg_len;
}