From 09b4c60c83d2a21314a098aee04c04d6e20f20a4 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 26 Apr 2019 09:41:13 -0700 Subject: [PATCH] fd Fix The API test assert was using an int comparison. Revised to use a local check value and just use an AssertTrue for the comparison. --- tests/api.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/api.c b/tests/api.c index 33e3928..d5db677 100644 --- a/tests/api.c +++ b/tests/api.c @@ -131,17 +131,19 @@ static void test_wolfSSH_set_fd(void) { WOLFSSH_CTX* ctx; WOLFSSH* ssh; - WS_SOCKET_T fd = 23; + WS_SOCKET_T fd = 23, check; AssertNotNull(ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL)); AssertNotNull(ssh = wolfSSH_new(ctx)); AssertIntNE(WS_SUCCESS, wolfSSH_set_fd(NULL, fd)); - AssertIntNE(WS_SUCCESS, wolfSSH_get_fd(NULL)); + check = wolfSSH_get_fd(NULL); + AssertFalse(WS_SUCCESS == check); AssertIntEQ(WS_SUCCESS, wolfSSH_set_fd(ssh, fd)); - AssertIntEQ(fd, wolfSSH_get_fd(ssh)); - AssertIntNE(0, wolfSSH_get_fd(ssh)); + check = wolfSSH_get_fd(ssh); + AssertTrue(fd == check); + AssertTrue(0 != check); wolfSSH_free(ssh); wolfSSH_CTX_free(ctx);