From: Ondřej Surý Date: Tue, 18 Jun 2019 12:48:00 +0000 (+0200) Subject: Fix spurious lib/dns/tests/update_test errors on macOS X-Git-Tag: v9.15.2~47^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6713c6703e2f551bb192595c9496ec6375d0b710;p=thirdparty%2Fbind9.git Fix spurious lib/dns/tests/update_test errors on macOS lib/dns/tests/update_test was failing on macOS on random occasions. It turned out this was a linker problem - it preferred isc_stdtime_get() from libisc instead of the local version in lib/dns/tests/update_test.c. Fix by including the original .c file in the unit test. This has two benefits: a) linking order may no longer cause issues as symbols found in the same compilation unit are always preferred, b) it allows writing tests for static functions in lib/dns/update.c. --- diff --git a/lib/dns/tests/update_test.c b/lib/dns/tests/update_test.c index 70d6a6cb9a2..168d1be99e5 100644 --- a/lib/dns/tests/update_test.c +++ b/lib/dns/tests/update_test.c @@ -32,6 +32,13 @@ #include "dnstest.h" +/* + * Fix the linking order problem for overridden isc_stdtime_get() by making + * everything local. This also allows static functions from update.c to be + * tested. + */ +#include "../update.c" + static int _setup(void **state) { isc_result_t result;