Skip to content

Commit 255086b

Browse files
committed
fix API test warning, comparison of unsigned expression < 0 is always false
1 parent d36538c commit 255086b

1 file changed

Lines changed: 28 additions & 24 deletions

File tree

tests/api.c

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45183,30 +45183,34 @@ static int test_wolfSSL_cert_cb_dyn_ciphers(void)
4518345183
#endif
4518445184
};
4518545185
size_t i;
45186-
45187-
for (i = 0; i < sizeof(test_params)/sizeof(*test_params); i++) {
45188-
printf("\tTesting %s ciphers with %s sigalgs\n",
45189-
test_params[i].client_ciphers, test_params[i].client_sigalgs);
45190-
45191-
XMEMSET(&func_cb_client, 0, sizeof(func_cb_client));
45192-
XMEMSET(&func_cb_server, 0, sizeof(func_cb_server));
45193-
45194-
test_wolfSSL_cert_cb_dyn_ciphers_client_cipher =
45195-
test_params[i].client_ciphers;
45196-
test_wolfSSL_cert_cb_dyn_ciphers_client_sigalgs =
45197-
test_params[i].client_sigalgs;
45198-
func_cb_client.method = test_params[i].client_meth;
45199-
func_cb_client.caPemFile = test_params[i].client_ca;
45200-
func_cb_client.ctx_ready =
45201-
test_wolfSSL_cert_cb_dyn_ciphers_client_ctx_ready;
45202-
45203-
func_cb_server.ctx_ready =
45204-
test_wolfSSL_cert_cb_dyn_ciphers_server_ctx_ready;
45205-
func_cb_server.ssl_ready = certClearCb; /* Reuse from previous test */
45206-
func_cb_server.method = test_params[i].server_meth;
45207-
45208-
ExpectIntEQ(test_wolfSSL_client_server_nofail_memio(&func_cb_client,
45209-
&func_cb_server, NULL), TEST_SUCCESS);
45186+
size_t testCount = sizeof(test_params)/sizeof(*test_params);
45187+
45188+
if (testCount > 0) {
45189+
for (i = 0; i < testCount; i++) {
45190+
printf("\tTesting %s ciphers with %s sigalgs\n",
45191+
test_params[i].client_ciphers,
45192+
test_params[i].client_sigalgs);
45193+
45194+
XMEMSET(&func_cb_client, 0, sizeof(func_cb_client));
45195+
XMEMSET(&func_cb_server, 0, sizeof(func_cb_server));
45196+
45197+
test_wolfSSL_cert_cb_dyn_ciphers_client_cipher =
45198+
test_params[i].client_ciphers;
45199+
test_wolfSSL_cert_cb_dyn_ciphers_client_sigalgs =
45200+
test_params[i].client_sigalgs;
45201+
func_cb_client.method = test_params[i].client_meth;
45202+
func_cb_client.caPemFile = test_params[i].client_ca;
45203+
func_cb_client.ctx_ready =
45204+
test_wolfSSL_cert_cb_dyn_ciphers_client_ctx_ready;
45205+
45206+
func_cb_server.ctx_ready =
45207+
test_wolfSSL_cert_cb_dyn_ciphers_server_ctx_ready;
45208+
func_cb_server.ssl_ready = certClearCb; /* Reuse from prev test */
45209+
func_cb_server.method = test_params[i].server_meth;
45210+
45211+
ExpectIntEQ(test_wolfSSL_client_server_nofail_memio(&func_cb_client,
45212+
&func_cb_server, NULL), TEST_SUCCESS);
45213+
}
4521045214
}
4521145215
#endif
4521245216
return EXPECT_RESULT();

0 commit comments

Comments
 (0)