Skip to content

Commit

Permalink
test_suite_ssl: improve variable naming in ssl_set_hostname_twice
Browse files Browse the repository at this point in the history
Signed-off-by: Pengyu Lv <[email protected]>
  • Loading branch information
lpy4105 committed Sep 21, 2023
1 parent 5edb942 commit 9d87a38
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/suites/test_suite_ssl.function
Original file line number Diff line number Diff line change
Expand Up @@ -1146,21 +1146,21 @@ exit:
/* END_CASE */

/* BEGIN_CASE depends_on:MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED */
void ssl_set_hostname_twice(char *hostname0, char *hostname1)
void ssl_set_hostname_twice(char *input_hostname0, char *input_hostname1)
{
const char *hostname;
const char *output_hostname;
mbedtls_ssl_context ssl;

mbedtls_ssl_init(&ssl);
USE_PSA_INIT();

TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, hostname0) == 0);
hostname = mbedtls_ssl_get_hostname(&ssl);
TEST_ASSERT(strcmp(hostname0, hostname) == 0);
TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, input_hostname0) == 0);
output_hostname = mbedtls_ssl_get_hostname(&ssl);
TEST_ASSERT(strcmp(input_hostname0, output_hostname) == 0);

TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, hostname1) == 0);
hostname = mbedtls_ssl_get_hostname(&ssl);
TEST_ASSERT(strcmp(hostname1, hostname) == 0);
TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, input_hostname1) == 0);
output_hostname = mbedtls_ssl_get_hostname(&ssl);
TEST_ASSERT(strcmp(input_hostname1, output_hostname) == 0);

exit:
mbedtls_ssl_free(&ssl);
Expand Down

0 comments on commit 9d87a38

Please sign in to comment.