From c9bdb9a01ed47698926899d9102ca758a1f4a0f5 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 10 Dec 2018 20:08:49 +0100 Subject: [PATCH] tests: Do not segfault when built without ZLIB Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/unittests/torture_config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unittests/torture_config.c b/tests/unittests/torture_config.c index c22ae3e0..93a90137 100644 --- a/tests/unittests/torture_config.c +++ b/tests/unittests/torture_config.c @@ -279,10 +279,15 @@ static void torture_config_new(void **state) assert_string_equal(session->opts.global_knownhosts, GLOBAL_KNOWN_HOSTS); assert_int_equal(session->opts.timeout, 30); assert_string_equal(session->opts.bindaddr, BIND_ADDRESS); +#ifdef WITH_ZLIB assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S], "zlib@openssh.com,zlib"); assert_string_equal(session->opts.wanted_methods[SSH_COMP_S_C], "zlib@openssh.com,zlib"); +#else + assert_null(session->opts.wanted_methods[SSH_COMP_C_S]); + assert_null(session->opts.wanted_methods[SSH_COMP_S_C]); +#endif /* WITH_ZLIB */ assert_int_equal(session->opts.StrictHostKeyChecking, 0); assert_int_equal(session->opts.gss_delegate_creds, 1); assert_string_equal(session->opts.gss_server_identity, "example.com");