aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlberto Aguirre <albaguirre@gmail.com>2018-03-02 12:56:47 -0600
committerAndreas Schneider <asn@cryptomilk.org>2018-03-11 22:54:47 +0100
commitdd20253fec90fa02229e6739842208b60ed0b25d (patch)
treea317b606acc5f6b8d1dd94e6e0e2be80e769b446 /tests
parent85ab4ee53a59d2883a5d0e41ad76d0ed9fbd9fca (diff)
downloadlibssh-dd20253fec90fa02229e6739842208b60ed0b25d.tar.gz
libssh-dd20253fec90fa02229e6739842208b60ed0b25d.tar.xz
libssh-dd20253fec90fa02229e6739842208b60ed0b25d.zip
tests: fix OSX build errors when enabling tests
Fix OSX build error about embedding a directive within macro arguments. Apparently, snprintf is implemented as a macro on that platform. Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/torture.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/torture.c b/tests/torture.c
index e442b8db..48a70d65 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -681,16 +681,24 @@ static void torture_setup_create_sshd_config(void **state)
}
assert_non_null(sftp_server);
+#ifdef HAVE_DSA
snprintf(sshd_config, sizeof(sshd_config),
config_string,
-#ifdef HAVE_DSA
dsa_hostkey,
-#endif
rsa_hostkey,
ecdsa_hostkey,
trusted_ca_pubkey,
sftp_server,
s->srv_pidfile);
+#else
+ snprintf(sshd_config, sizeof(sshd_config),
+ config_string,
+ rsa_hostkey,
+ ecdsa_hostkey,
+ trusted_ca_pubkey,
+ sftp_server,
+ s->srv_pidfile);
+#endif
torture_write_file(s->srv_config, sshd_config);
}