mirror of https://github.com/wolfSSL/wolfssh.git
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.pull/162/head
parent
63423e7431
commit
09b4c60c83
10
tests/api.c
10
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);
|
||||
|
|
Loading…
Reference in New Issue