Skip to content

Commit

Permalink
Merge pull request #126 from expressvpn/fix-compiler-warnings
Browse files Browse the repository at this point in the history
Fix multiple compiler warnings in tests
  • Loading branch information
expressvpn-tom-l authored Oct 13, 2023
2 parents 17fc115 + 0522e3b commit 91129f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/he/test_conn.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* *
/**
* Lightway Core
* Copyright (C) 2021 Express VPN International Ltd.
*
Expand Down Expand Up @@ -575,7 +575,7 @@ void test_send_keepalive_error_when_not_connected(void) {
}

// Stub function for writing a he_msg_ping_t to wolfssl
static int wolfSSL_write_ping_stub(WOLFSSL *ssl, const void *data, int sz) {
static int wolfSSL_write_ping_stub(WOLFSSL *ssl, const void *data, int sz, int num_calls) {
TEST_ASSERT_EQUAL_PTR(conn.wolf_ssl, ssl);
TEST_ASSERT_NOT_NULL(data);
TEST_ASSERT_GREATER_OR_EQUAL(sizeof(he_msg_ping_t), sz);
Expand Down
4 changes: 2 additions & 2 deletions test/he/test_msg_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void test_msg_handler_pong(void) {

he_msg_pong_t *pong = (he_msg_pong_t *)empty_data;
pong->id = htons(42);
ret = he_handle_msg_pong(conn, pong, sizeof(he_msg_pong_t));
ret = he_handle_msg_pong(conn, (uint8_t *)pong, sizeof(he_msg_pong_t));
TEST_ASSERT_EQUAL(HE_SUCCESS, ret);
}

Expand All @@ -193,7 +193,7 @@ void test_msg_handler_pong_mismatch_id(void) {

he_msg_pong_t *pong = (he_msg_pong_t *)empty_data;
pong->id = htons(999);
ret = he_handle_msg_pong(conn, pong, sizeof(he_msg_pong_t));
ret = he_handle_msg_pong(conn, (uint8_t *)pong, sizeof(he_msg_pong_t));
TEST_ASSERT_EQUAL(HE_SUCCESS, ret);
}

Expand Down
5 changes: 3 additions & 2 deletions test/he/test_ssl_ctx.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* *
/**
* Lightway Core
* Copyright (C) 2021 Express VPN International Ltd.
*
Expand Down Expand Up @@ -949,7 +949,8 @@ void test_he_ssl_ctx_is_ca_set_set_ctx_null(void) {
}

void test_he_ssl_ctx_set_server_cert_key_files_ctx_null(void) {
he_return_code_t res = he_ssl_ctx_set_server_cert_key_files(NULL, fake_cert, fake_cert);
he_return_code_t res =
he_ssl_ctx_set_server_cert_key_files(NULL, (const char *)fake_cert, (const char *)fake_cert);
TEST_ASSERT_EQUAL(HE_ERR_NULL_POINTER, res);
}

Expand Down

0 comments on commit 91129f9

Please sign in to comment.