From 17f396ffab3a5ad9d9984344cde6793685cf81be Mon Sep 17 00:00:00 2001 From: Lee Hambley Date: Fri, 28 Oct 2011 22:52:03 +0200 Subject: Improve ssh_options_get(ssh_session, enum ssh_options_e, char**). * Use SSH_ERROR and SSH_OK instead of `-1` and `0`. * Re-factor for code duplication * No longer call `ssh_set_error_invalid(ssh_session)` when the ssh_session is NULL. --- tests/unittests/torture_options.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/unittests/torture_options.c b/tests/unittests/torture_options.c index 3830981..b90d163 100644 --- a/tests/unittests/torture_options.c +++ b/tests/unittests/torture_options.c @@ -83,7 +83,7 @@ static void torture_options_get_user(void **state) { char* user = NULL; int rc; rc = ssh_options_set(session, SSH_OPTIONS_USER, "magicaltrevor"); - assert_true(rc == 0); + assert_true(rc == SSH_OK); rc = ssh_options_get(session, SSH_OPTIONS_USER, &user); assert_string_equal(user, "magicaltrevor"); } @@ -98,7 +98,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 == -1); + assert_true(rc == SSH_ERROR); assert_true(session->fd == SSH_INVALID_SOCKET); } @@ -161,14 +161,14 @@ static void torture_options_get_identity(void **state) { rc = ssh_options_set(session, SSH_OPTIONS_ADD_IDENTITY, "identity1"); assert_true(rc == 0); rc = ssh_options_get(session, SSH_OPTIONS_IDENTITY, &identity); - assert_true(rc == 0); + assert_true(rc == SSH_OK); assert_string_equal(identity, "identity1"); rc = ssh_options_set(session, SSH_OPTIONS_IDENTITY, "identity2"); assert_true(rc == 0); assert_string_equal(session->identity->root->data, "identity2"); rc = ssh_options_get(session, SSH_OPTIONS_IDENTITY, &identity); - assert_true(rc == 0); + assert_true(rc == SSH_OK); assert_string_equal(identity, "identity2"); } -- cgit