From: Florian Forster Date: Thu, 30 Nov 2017 08:33:50 +0000 (+0100) Subject: network_parse_test.c: Only test security features if libgcrypt is available. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4b5072913bf8da67ac39f26fccb94c3b1a8944d8;p=collectd.git network_parse_test.c: Only test security features if libgcrypt is available. Fixes: #2583 --- diff --git a/src/libcollectdclient/network_parse_test.c b/src/libcollectdclient/network_parse_test.c index 9efd4bd8..07010fbd 100644 --- a/src/libcollectdclient/network_parse_test.c +++ b/src/libcollectdclient/network_parse_test.c @@ -412,6 +412,7 @@ static int test_parse_values() { return ret; } +#if HAVE_GCRYPT_H static int test_verify_sha256() { int ret = 0; @@ -441,7 +442,9 @@ static int test_verify_sha256() { return ret; } +#endif +#if HAVE_GCRYPT_H static int test_decrypt_aes256() { char const *iv_str = "4cbe2a747c9f9dcfa0e66f0c2fa74875"; uint8_t iv[16] = {0}; @@ -480,12 +483,11 @@ static int test_decrypt_aes256() { return 0; } +#endif int main(void) { int ret = 0; - printf("libcollectdclient/server_test.c\n"); - int status; if ((status = test_network_parse())) { ret = status; @@ -500,12 +502,14 @@ int main(void) { ret = status; } +#if HAVE_GCRYPT_H if ((status = test_verify_sha256())) { ret = status; } if ((status = test_decrypt_aes256())) { ret = status; } +#endif return ret; }