From 670dd1704445d02b7a5af488bdb88559c0712cf1 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sat, 15 Jan 2011 22:50:34 +0100 Subject: Test double ssh_disconnect --- tests/client/torture_connect.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/client/torture_connect.c b/tests/client/torture_connect.c index 92fb721..24ee0d2 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(); -- cgit