aboutsummaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-05-31 09:17:54 +0200
committerAndreas Schneider <asn@cynapses.org>2010-05-31 09:17:54 +0200
commit560e93803804224c137d8dee6eae99ab2296734a (patch)
treedaa9044a35ff95fda19d2c6d84925bde1cac24a1 /tests/unittests
parent2a5d71971c9108d7b8e866c9f2364d4613bc22cb (diff)
downloadlibssh-560e93803804224c137d8dee6eae99ab2296734a.tar.gz
libssh-560e93803804224c137d8dee6eae99ab2296734a.tar.xz
libssh-560e93803804224c137d8dee6eae99ab2296734a.zip
misc: Move size check down in ssh_path_expand_escape().
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/torture_misc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c
index 5996bd9..e916107 100644
--- a/tests/unittests/torture_misc.c
+++ b/tests/unittests/torture_misc.c
@@ -117,6 +117,18 @@ START_TEST (torture_path_expand_escape)
}
END_TEST
+START_TEST (torture_path_expand_known_hosts)
+{
+ char *tmp;
+
+ ssh_options_set(session, SSH_OPTIONS_SSH_DIR, "/home/guru/.ssh");
+
+ tmp = ssh_path_expand_escape(session, "%d/known_hosts");
+ ck_assert_str_eq(tmp, "/home/guru/.ssh/known_hosts");
+ free(tmp);
+}
+END_TEST
+
Suite *torture_make_suite(void) {
Suite *s = suite_create("libssh_misc");
@@ -127,6 +139,8 @@ Suite *torture_make_suite(void) {
torture_create_case(s, "torture_path_expand_tilde", torture_path_expand_tilde);
torture_create_case_fixture(s, "torture_path_expand_escape",
torture_path_expand_escape, setup, teardown);
+ torture_create_case_fixture(s, "torture_path_expand_known_hosts",
+ torture_path_expand_known_hosts, setup, teardown);
return s;
}