aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-09-06 09:14:21 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-09-06 09:16:54 +0200
commitae1f87e37ae706a9ed84f996ed48b7a7fe2aa50b (patch)
tree6fc958d29976e6a720b72c17aeed88b5f27f17e1 /tests
parent3105b3c20557f4a30c0f752ef572b7734f4f00ed (diff)
downloadlibssh-ae1f87e37ae706a9ed84f996ed48b7a7fe2aa50b.tar.gz
libssh-ae1f87e37ae706a9ed84f996ed48b7a7fe2aa50b.tar.xz
libssh-ae1f87e37ae706a9ed84f996ed48b7a7fe2aa50b.zip
options: Fix NULL value handling.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/torture_options.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/unittests/torture_options.c b/tests/unittests/torture_options.c
index 3a6d9f4..2351694 100644
--- a/tests/unittests/torture_options.c
+++ b/tests/unittests/torture_options.c
@@ -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);
}