diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-05-07 08:32:18 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-05-07 08:33:32 +0200 |
commit | 72f6b34dbc7fd8d2d48206ed807c2e5bd3f24419 (patch) | |
tree | a81371bd085b4623c47851ac33bab062725ea0ef /tests | |
parent | 816234350d45ad5743d4cedecc0ed48cc683ed4f (diff) | |
download | libssh-72f6b34dbc7fd8d2d48206ed807c2e5bd3f24419.tar.gz libssh-72f6b34dbc7fd8d2d48206ed807c2e5bd3f24419.tar.xz libssh-72f6b34dbc7fd8d2d48206ed807c2e5bd3f24419.zip |
tests: We should only init and finalize libssh once
This should fix a segfault with gcrypt.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/client/torture_algorithms.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index ce7d36ad..76ea2cef 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -56,8 +56,6 @@ static int session_setup(void **state) { rc = setuid(pwd->pw_uid); assert_return_code(rc, errno); - ssh_init(); - s->ssh.session = ssh_new(); assert_non_null(s->ssh.session); @@ -74,8 +72,6 @@ static int session_teardown(void **state) ssh_disconnect(s->ssh.session); ssh_free(s->ssh.session); - ssh_finalize(); - return 0; } @@ -467,8 +463,12 @@ int torture_run_tests(void) { #endif }; + ssh_init(); + torture_filter_tests(tests); rc = cmocka_run_group_tests(tests, sshd_setup, sshd_teardown); + ssh_finalize(); + return rc; } |