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>
This commit is contained in:
Tomás González 2024-02-01 11:12:20 +00:00 committed by Sam Berry
parent 3e419b06da
commit 1fb69a9e91

View File

@ -551,7 +551,10 @@ int mbedtls_test_mock_tcp_recv_msg(void *ctx,
* happen in test environment, unless forced manually. */ * 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; return (msg_len > INT_MAX) ? INT_MAX : (int) msg_len;
} }