From 154f2ca6f6b3c01679e4cdb61ab70ff4eb050fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 12 Sep 2019 14:25:57 +0200 Subject: [PATCH] Tweak lib/dns/tests/tkey_test requirements Currently, the lib/dns/tests/tkey_test unit test is only run when the linker supports the --wrap option. However, linker support for that option is only needed for static builds. As a result, the unit test mentioned before is not being run everywhere it can be run as even for builds done using --with-libtool, the test is not run unless the linker supports the --wrap option. Tweak preprocessor directives in lib/dns/tests/tkey_test.c so that this test is run: - for all builds using --with-libtool, - for static builds done using a linker supporting the --wrap option. --- lib/dns/tests/tkey_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/dns/tests/tkey_test.c b/lib/dns/tests/tkey_test.c index 5b91aa0a02..f89611206e 100644 --- a/lib/dns/tests/tkey_test.c +++ b/lib/dns/tests/tkey_test.c @@ -27,7 +27,7 @@ #include -#if LD_WRAP +#if defined(USE_LIBTOOL) || LD_WRAP static isc_mem_t mock_mctx = { .impmagic = 0, .magic = ISCAPI_MCTX_MAGIC, @@ -167,11 +167,11 @@ dns_tkeyctx_destroy_test(void **state) { assert_non_null(tctx); dns_tkeyctx_destroy(&tctx); } -#endif /* LD_WRAP */ +#endif /* defined(USE_LIBTOOL) || LD_WRAP */ int main(void) { -#if LD_WRAP +#if defined(USE_LIBTOOL) || LD_WRAP const struct CMUnitTest tkey_tests[] = { cmocka_unit_test_teardown(dns_tkeyctx_create_test, _teardown), cmocka_unit_test_setup(dns_tkeyctx_destroy_test, _setup), @@ -187,9 +187,9 @@ main(void) { #endif }; return (cmocka_run_group_tests(tkey_tests, NULL, NULL)); -#else /* LD_WRAP */ - print_message("1..0 # Skip tkey_test requires LD_WRAP\n"); -#endif /* LD_WRAP */ +#else /* defined(USE_LIBTOOL) || LD_WRAP */ + print_message("1..0 # Skip tkey_test requires libtool or LD_WRAP\n"); +#endif /* defined(USE_LIBTOOL) || LD_WRAP */ } #else /* CMOCKA */