From 3f538b3ddd237c04ccdf774b6274bdbbdee0e6e7 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 2 Jan 2011 17:25:51 +0100 Subject: Call ssh_init()/ssh_finalize bf/af each testcase --- tests/unittests/torture_buffer.c | 6 +++++- tests/unittests/torture_callbacks.c | 6 +++++- tests/unittests/torture_keyfiles.c | 7 ++++++- tests/unittests/torture_list.c | 6 +++++- tests/unittests/torture_misc.c | 6 +++++- tests/unittests/torture_options.c | 6 +++++- 6 files changed, 31 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/unittests/torture_buffer.c b/tests/unittests/torture_buffer.c index cb5fc701..8215cd40 100644 --- a/tests/unittests/torture_buffer.c +++ b/tests/unittests/torture_buffer.c @@ -85,11 +85,15 @@ static void torture_buffer_prepend(void **state) { } int torture_run_tests(void) { + int rc; const UnitTest tests[] = { unit_test_setup_teardown(torture_growing_buffer, setup, teardown), unit_test_setup_teardown(torture_growing_buffer_shifting, setup, teardown), unit_test_setup_teardown(torture_buffer_prepend, setup, teardown), }; - return run_tests(tests); + ssh_init(); + rc=run_tests(tests); + ssh_finalize(); + return rc; } diff --git a/tests/unittests/torture_callbacks.c b/tests/unittests/torture_callbacks.c index c199f1a0..97991899 100644 --- a/tests/unittests/torture_callbacks.c +++ b/tests/unittests/torture_callbacks.c @@ -58,10 +58,14 @@ static void torture_callbacks_exists(void **state) { } int torture_run_tests(void) { + int rc; const UnitTest tests[] = { unit_test_setup_teardown(torture_callbacks_size, setup, teardown), unit_test_setup_teardown(torture_callbacks_exists, setup, teardown), }; - return run_tests(tests); + ssh_init(); + rc=run_tests(tests); + ssh_finalize(); + return rc; } diff --git a/tests/unittests/torture_keyfiles.c b/tests/unittests/torture_keyfiles.c index 47eb7b42..6e801c35 100644 --- a/tests/unittests/torture_keyfiles.c +++ b/tests/unittests/torture_keyfiles.c @@ -232,6 +232,7 @@ static void torture_privatekey_from_file_passphrase(void **state) { } int torture_run_tests(void) { + int rc; const UnitTest tests[] = { unit_test_setup_teardown(torture_pubkey_from_file, setup_rsa_key, @@ -245,5 +246,9 @@ int torture_run_tests(void) { setup_both_keys_passphrase, teardown), }; - return run_tests(tests); + + ssh_init(); + rc=run_tests(tests); + ssh_finalize(); + return rc; } diff --git a/tests/unittests/torture_list.c b/tests/unittests/torture_list.c index 2f5894c5..75f41825 100644 --- a/tests/unittests/torture_list.c +++ b/tests/unittests/torture_list.c @@ -77,11 +77,15 @@ static void torture_ssh_list_prepend(void **state) { } int torture_run_tests(void) { + int rc; const UnitTest tests[] = { unit_test(torture_ssh_list_new), unit_test(torture_ssh_list_append), unit_test(torture_ssh_list_prepend), }; - return run_tests(tests); + ssh_init(); + rc=run_tests(tests); + ssh_finalize(); + return rc; } diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c index e7562334..9df70bbc 100644 --- a/tests/unittests/torture_misc.c +++ b/tests/unittests/torture_misc.c @@ -157,6 +157,7 @@ static void torture_path_expand_known_hosts(void **state) { } int torture_run_tests(void) { + int rc; const UnitTest tests[] = { unit_test(torture_get_user_home_dir), unit_test(torture_basename), @@ -171,5 +172,8 @@ int torture_run_tests(void) { unit_test_setup_teardown(torture_path_expand_known_hosts, setup, teardown), }; - return run_tests(tests); + ssh_init(); + rc=run_tests(tests); + ssh_finalize(); + return rc; } diff --git a/tests/unittests/torture_options.c b/tests/unittests/torture_options.c index 4d20c216..d5da8288 100644 --- a/tests/unittests/torture_options.c +++ b/tests/unittests/torture_options.c @@ -119,6 +119,7 @@ static void torture_options_set_identity(void **state) { } int torture_run_tests(void) { + int rc; const UnitTest tests[] = { unit_test_setup_teardown(torture_options_set_host, setup, teardown), unit_test_setup_teardown(torture_options_set_port, setup, teardown), @@ -127,5 +128,8 @@ int torture_run_tests(void) { unit_test_setup_teardown(torture_options_set_identity, setup, teardown), }; - return run_tests(tests); + ssh_init(); + rc=run_tests(tests); + ssh_finalize(); + return rc; } -- cgit v1.2.3