From: Michal Nowak Date: Tue, 2 Jun 2020 16:21:13 +0000 (+0200) Subject: Associate unit test data dir with a more specific variable X-Git-Tag: v9.17.2~23^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=eddece78419fda50e28419794365b3c9da69c9ff;p=thirdparty%2Fbind9.git Associate unit test data dir with a more specific variable Having 'TESTS', the Automake variable and 'TESTS' the unit test data dir seems confusing, lets rename the latter to to 'TESTS_DIR'. --- diff --git a/Makefile.tests b/Makefile.tests index 3ff781df53b..2d39eb8f258 100644 --- a/Makefile.tests +++ b/Makefile.tests @@ -3,7 +3,7 @@ AM_CPPFLAGS += \ $(CMOCKA_CFLAGS) \ - -DTESTS=\"$(abs_srcdir)\" \ + -DTESTS_DIR=\"$(abs_srcdir)\" \ -DNAMED_PLUGINDIR=\"$(libdir)/named\" LDADD = \ diff --git a/lib/dns/tests/dnstest.c b/lib/dns/tests/dnstest.c index b1e70080e7e..780605dd2c5 100644 --- a/lib/dns/tests/dnstest.c +++ b/lib/dns/tests/dnstest.c @@ -179,7 +179,7 @@ dns_test_begin(FILE *logfile, bool start_managers) { * that access test data files must first chdir to the proper * location. */ - if (chdir(TESTS) == -1) { + if (chdir(TESTS_DIR) == -1) { CHECK(ISC_R_FAILURE); } diff --git a/lib/irs/tests/resconf_test.c b/lib/irs/tests/resconf_test.c index b12115b368e..3ee928d5c89 100644 --- a/lib/irs/tests/resconf_test.c +++ b/lib/irs/tests/resconf_test.c @@ -39,7 +39,7 @@ setup_test(void) { * that access test data files must first chdir to the proper * location. */ - assert_return_code(chdir(TESTS), 0); + assert_return_code(chdir(TESTS_DIR), 0); } /* test irs_resconf_load() */ diff --git a/lib/isc/tests/file_test.c b/lib/isc/tests/file_test.c index d24fe3c5049..75daddd5e34 100644 --- a/lib/isc/tests/file_test.c +++ b/lib/isc/tests/file_test.c @@ -57,7 +57,7 @@ isc_file_sanitize_test(void **state) { UNUSED(state); - assert_return_code(chdir(TESTS), 0); + assert_return_code(chdir(TESTS_DIR), 0); result = isc_file_sanitize("testdata/file", NAME, "test", buf, 1024); assert_int_equal(result, ISC_R_SUCCESS); @@ -93,7 +93,7 @@ isc_file_template_test(void **state) { UNUSED(state); - assert_return_code(chdir(TESTS), 0); + assert_return_code(chdir(TESTS_DIR), 0); result = isc_file_template("/absolute/path", "file-XXXXXXXX", buf, sizeof(buf)); diff --git a/lib/ns/tests/nstest.c b/lib/ns/tests/nstest.c index 7a70d536d6b..e3a6990fc99 100644 --- a/lib/ns/tests/nstest.c +++ b/lib/ns/tests/nstest.c @@ -315,7 +315,7 @@ ns_test_begin(FILE *logfile, bool start_managers) { * that access test data files must first chdir to the proper * location. */ - if (chdir(TESTS) == -1) { + if (chdir(TESTS_DIR) == -1) { CHECK(ISC_R_FAILURE); }