The API test assert was using an int comparison. Revised to use a local
check value and just use an AssertTrue for the comparison.
pull/162/head
John Safranek 2019-04-26 09:41:13 -07:00
parent 63423e7431
commit 09b4c60c83
1 changed files with 6 additions and 4 deletions

View File

@ -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);