Skip to content

Commit

Permalink
tests/ssl_helpers: Check that message queue is popped
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tgonzalezorlandoarm authored and sezrab committed Jul 31, 2024
1 parent 9aa9120 commit a526528
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/src/test_helpers/ssl_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,10 @@ int mbedtls_test_mock_tcp_recv_msg(void *ctx,
* 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;
}
Expand Down

0 comments on commit a526528

Please sign in to comment.