aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-01-23 14:49:56 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-24 15:15:35 +0100
commit893510db3545305a4b38ed39e839dfdfe66cd908 (patch)
tree0d997ee32faae1796ee056f3778b7ff7fac08a16 /tests
parente989c4afffa154d92fe8c4ae1716ecc6bb4c2fd5 (diff)
downloadlibssh-893510db3545305a4b38ed39e839dfdfe66cd908.tar.gz
libssh-893510db3545305a4b38ed39e839dfdfe66cd908.tar.xz
libssh-893510db3545305a4b38ed39e839dfdfe66cd908.zip
tests: Use assert_ssh_return_code() in config test
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/torture_config.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/unittests/torture_config.c b/tests/unittests/torture_config.c
index 3edc39f2..2639ee67 100644
--- a/tests/unittests/torture_config.c
+++ b/tests/unittests/torture_config.c
@@ -404,34 +404,34 @@ static void torture_config_match(void **state)
/* Without any settings we should get all-matched.com hostname */
ssh_options_set(session, SSH_OPTIONS_HOST, "unmatched");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "all-matched.com");
/* Hostname example does simple hostname matching */
torture_reset_config(session);
ssh_options_set(session, SSH_OPTIONS_HOST, "example");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "example.com");
/* We can match also both hosts from a comma separated list */
torture_reset_config(session);
ssh_options_set(session, SSH_OPTIONS_HOST, "example1");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "exampleN");
torture_reset_config(session);
ssh_options_set(session, SSH_OPTIONS_HOST, "example2");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "exampleN");
/* We can match by user */
torture_reset_config(session);
ssh_options_set(session, SSH_OPTIONS_USER, "guest");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "guest.com");
/* We can combine two options on a single line to match both of them */
@@ -439,7 +439,7 @@ static void torture_config_match(void **state)
ssh_options_set(session, SSH_OPTIONS_USER, "tester");
ssh_options_set(session, SSH_OPTIONS_HOST, "testhost");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "testhost.com");
/* We can also negate conditions */
@@ -447,7 +447,7 @@ static void torture_config_match(void **state)
ssh_options_set(session, SSH_OPTIONS_USER, "not-tester");
ssh_options_set(session, SSH_OPTIONS_HOST, "testhost");
ret = ssh_config_parse_file(session, LIBSSH_TESTCONFIG10);
- assert_true(ret == 0);
+ assert_ssh_return_code(session, ret);
assert_string_equal(session->opts.host, "nonuser-testhost.com");
}