diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2018-11-12 11:17:20 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-11-30 18:57:39 +0100 |
commit | 7b0c80b475d79040822c98548df2feb3f3f701de (patch) | |
tree | 84f7100f2e1f53ce31be3b27bad06dddc9fb7151 | |
parent | d5bc9a1aceb4c4286ac4bb368dc015ffbdb1af3c (diff) | |
download | libssh-7b0c80b475d79040822c98548df2feb3f3f701de.tar.gz libssh-7b0c80b475d79040822c98548df2feb3f3f701de.tar.xz libssh-7b0c80b475d79040822c98548df2feb3f3f701de.zip |
tests: Test calling ssh_init() after ssh_finalize()
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit c413834764707df1316790d4182aea4135589108)
-rw-r--r-- | tests/unittests/torture_init.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unittests/torture_init.c b/tests/unittests/torture_init.c index 1713b7b9..6a97a182 100644 --- a/tests/unittests/torture_init.c +++ b/tests/unittests/torture_init.c @@ -16,10 +16,27 @@ static void torture_ssh_init(void **state) { assert_int_equal(rc, SSH_OK); } +static void torture_ssh_init_after_finalize(void **state) { + + int rc; + + (void) state; + + rc = ssh_init(); + assert_int_equal(rc, SSH_OK); + rc = ssh_finalize(); + assert_int_equal(rc, SSH_OK); + rc = ssh_init(); + assert_int_equal(rc, SSH_OK); + rc = ssh_finalize(); + assert_int_equal(rc, SSH_OK); +} + int torture_run_tests(void) { int rc; struct CMUnitTest tests[] = { cmocka_unit_test(torture_ssh_init), + cmocka_unit_test(torture_ssh_init_after_finalize), }; torture_filter_tests(tests); |