diff --git a/tests/unittests/torture_threads_buffer.c b/tests/unittests/torture_threads_buffer.c index 11252eac..e3cebdc9 100644 --- a/tests/unittests/torture_threads_buffer.c +++ b/tests/unittests/torture_threads_buffer.c @@ -589,8 +589,14 @@ int torture_run_tests(void) cmocka_unit_test(torture_mixed), }; + /* + * If the library is statically linked, ssh_init() is not called + * automatically + */ + ssh_init(); torture_filter_tests(tests); rc = cmocka_run_group_tests(tests, NULL, NULL); + ssh_finalize(); return rc; } diff --git a/tests/unittests/torture_threads_crypto.c b/tests/unittests/torture_threads_crypto.c index 298a4539..12105ae3 100644 --- a/tests/unittests/torture_threads_crypto.c +++ b/tests/unittests/torture_threads_crypto.c @@ -175,7 +175,13 @@ int torture_run_tests(void) cmocka_unit_test(torture_crypto_aes256_cbc), }; + /* + * If the library is statically linked, ssh_init() is not called + * automatically + */ + ssh_init(); rc = cmocka_run_group_tests(tests, NULL, NULL); + ssh_finalize(); return rc; } diff --git a/tests/unittests/torture_threads_init.c b/tests/unittests/torture_threads_init.c index 1b0781e5..8eada0d3 100644 --- a/tests/unittests/torture_threads_init.c +++ b/tests/unittests/torture_threads_init.c @@ -88,8 +88,14 @@ int torture_run_tests(void) cmocka_unit_test(torture_ssh_init), }; + /* + * If the library is statically linked, ssh_init() is not called + * automatically + */ + ssh_init(); torture_filter_tests(tests); rc = cmocka_run_group_tests(tests, NULL, NULL); + ssh_finalize(); return rc; }