Skip to content

Commit 5f293bf

Browse files
committed
tests: add test_wolfssl_client_server_no_fail(_ex) to set client cb
1 parent cff580b commit 5f293bf

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

tests/api.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5687,8 +5687,6 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
56875687
}
56885688
#endif /* defined(OPENSSL_EXTRA) && !defined(NO_SESSION_CACHE) && !defined(WOLFSSL_TLS13) */
56895689

5690-
typedef int (*cbType)(WOLFSSL_CTX *ctx, WOLFSSL *ssl);
5691-
56925690
static int test_client_nofail(void* args, cbType cb)
56935691
{
56945692
#if !defined(NO_WOLFSSL_CLIENT)
@@ -5931,8 +5929,8 @@ static int test_client_nofail(void* args, cbType cb)
59315929
return 0;
59325930
}
59335931

5934-
void test_wolfSSL_client_server_nofail(callback_functions* client_cb,
5935-
callback_functions* server_cb)
5932+
void test_wolfSSL_client_server_nofail_ex(callback_functions* client_cb,
5933+
callback_functions* server_cb, cbType client_on_handshake)
59365934
{
59375935
func_args client_args;
59385936
func_args server_args;
@@ -5961,7 +5959,7 @@ void test_wolfSSL_client_server_nofail(callback_functions* client_cb,
59615959

59625960
start_thread(test_server_nofail, &server_args, &serverThread);
59635961
wait_tcp_ready(&server_args);
5964-
test_client_nofail(&client_args, NULL);
5962+
test_client_nofail(&client_args, client_on_handshake);
59655963
join_thread(serverThread);
59665964

59675965
client_cb->return_code = client_args.return_code;
@@ -5974,6 +5972,13 @@ void test_wolfSSL_client_server_nofail(callback_functions* client_cb,
59745972
#endif
59755973
}
59765974

5975+
void test_wolfSSL_client_server_nofail(callback_functions* client_cb,
5976+
callback_functions* server_cb)
5977+
{
5978+
test_wolfSSL_client_server_nofail_ex(client_cb, server_cb, NULL);
5979+
}
5980+
5981+
59775982
#if defined(OPENSSL_EXTRA) && !defined(NO_SESSION_CACHE) && \
59785983
!defined(WOLFSSL_TLS13) && !defined(NO_WOLFSSL_CLIENT)
59795984
static void test_client_reuse_WOLFSSLobj(void* args, void *cb, void* server_args)

wolfssl/test.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ typedef THREAD_RETURN WOLFSSL_THREAD THREAD_FUNC(void*);
636636
void start_thread(THREAD_FUNC fun, func_args* args, THREAD_TYPE* thread);
637637
void join_thread(THREAD_TYPE thread);
638638

639+
typedef int (*cbType)(WOLFSSL_CTX *ctx, WOLFSSL *ssl);
640+
641+
void test_wolfSSL_client_server_nofail_ex(callback_functions* client_cb,
642+
callback_functions* server_cb, cbType client_on_handshake);
639643
void test_wolfSSL_client_server_nofail(callback_functions* client_cb,
640644
callback_functions* server_cb);
641645

0 commit comments

Comments
 (0)