tests: pin the get_fd invalid-socket sentinel

test_wolfSSH_set_fd() compares the NULL return of wolfSSH_get_fd()
against the platform invalid-socket sentinel, the value wolfSSH_new()
initializes rfd/wfd to. The old check only asserted the result was not
WS_SUCCESS, which the previous WS_BAD_ARGUMENT return also satisfied.
pull/1235/head
John Safranek 2026-09-10 17:29:00 -07:00 committed by Paul Adelsbach
parent ed633eac0c
commit 28bf47d2a0
1 changed files with 5 additions and 1 deletions

View File

@ -238,7 +238,11 @@ static void test_wolfSSH_set_fd(void)
AssertIntNE(WS_SUCCESS, wolfSSH_set_fd(NULL, fd));
check = wolfSSH_get_fd(NULL);
AssertFalse(WS_SUCCESS == check);
#ifdef USE_WINDOWS_API
AssertTrue(INVALID_SOCKET == check);
#else
AssertTrue(-1 == check);
#endif
AssertIntEQ(WS_SUCCESS, wolfSSH_set_fd(ssh, fd));
check = wolfSSH_get_fd(ssh);