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.
This commit is contained in:
Ondřej Surý
2019-06-18 14:48:00 +02:00
parent 695c997e6f
commit 6713c6703e

View File

@@ -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;