1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

options: Fix NULL value handling.

This commit is contained in:
Andreas Schneider
2011-09-06 09:14:21 +02:00
parent 3105b3c205
commit ae1f87e37a
2 changed files with 67 additions and 39 deletions

View File

@ -46,12 +46,10 @@ static void torture_options_set_port(void **state) {
assert_true(session->port == 23);
rc = ssh_options_set(session, SSH_OPTIONS_PORT_STR, "five");
assert_true(rc == 0);
assert_true(session->port == 0);
assert_true(rc == -1);
rc = ssh_options_set(session, SSH_OPTIONS_PORT, NULL);
assert_true(rc == 0);
assert_true(session->port == 22);
assert_true(rc == -1);
}
static void torture_options_set_fd(void **state) {
@ -64,7 +62,7 @@ static void torture_options_set_fd(void **state) {
assert_true(session->fd == fd);
rc = ssh_options_set(session, SSH_OPTIONS_FD, NULL);
assert_true(rc == 0);
assert_true(rc == -1);
assert_true(session->fd == SSH_INVALID_SOCKET);
}