mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
tests: We should only init and finalize libssh once
This should fix a segfault with gcrypt. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user