diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-01-15 22:50:34 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-01-15 22:50:34 +0100 |
commit | 670dd1704445d02b7a5af488bdb88559c0712cf1 (patch) | |
tree | 3277bce58b889f7b414ec5fd8ef98f6870cd9d00 /tests/client | |
parent | b945cbca52a39e48c8d40503134c3f0ce77e26d9 (diff) | |
download | libssh-670dd1704445d02b7a5af488bdb88559c0712cf1.tar.gz libssh-670dd1704445d02b7a5af488bdb88559c0712cf1.tar.xz libssh-670dd1704445d02b7a5af488bdb88559c0712cf1.zip |
Test double ssh_disconnect
Diffstat (limited to 'tests/client')
-rw-r--r-- | tests/client/torture_connect.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/client/torture_connect.c b/tests/client/torture_connect.c index 92fb7210..24ee0d23 100644 --- a/tests/client/torture_connect.c +++ b/tests/client/torture_connect.c @@ -73,11 +73,21 @@ static void torture_connect_double(void **state) { } +static void torture_connect_failure(void **state){ + /* + * The intent of this test is to check that a fresh + * ssh_new/ssh_disconnect/ssh_free sequence doesn't crash/leak + * and the behavior of a double ssh_disconnect + */ + ssh_session session = *state; + ssh_disconnect(session); +} int torture_run_tests(void) { int rc; const UnitTest tests[] = { unit_test_setup_teardown(torture_connect_nonblocking, setup, teardown), unit_test_setup_teardown(torture_connect_double, setup, teardown), + unit_test_setup_teardown(torture_connect_failure, setup, teardown), }; ssh_init(); |