]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Associate unit test data dir with a more specific variable
authorMichal Nowak <mnowak@isc.org>
Tue, 2 Jun 2020 16:21:13 +0000 (18:21 +0200)
committerMichal Nowak <mnowak@isc.org>
Thu, 4 Jun 2020 10:56:57 +0000 (12:56 +0200)
Having 'TESTS', the Automake variable and 'TESTS' the unit test data dir
seems confusing, lets rename the latter to to 'TESTS_DIR'.

Makefile.tests
lib/dns/tests/dnstest.c
lib/irs/tests/resconf_test.c
lib/isc/tests/file_test.c
lib/ns/tests/nstest.c

index 3ff781df53bc2e8293380b8275b9c707a681ba6c..2d39eb8f2586e6edf18ab60fed1b6bc222a80149 100644 (file)
@@ -3,7 +3,7 @@
 
 AM_CPPFLAGS +=                                 \
        $(CMOCKA_CFLAGS)                        \
-       -DTESTS=\"$(abs_srcdir)\"               \
+       -DTESTS_DIR=\"$(abs_srcdir)\"           \
        -DNAMED_PLUGINDIR=\"$(libdir)/named\"
 
 LDADD =                        \
index b1e70080e7e7435dac2d558ed551290c50a33a4b..780605dd2c5effc0b51cf17b877c56d6e238bf17 100644 (file)
@@ -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);
        }
 
index b12115b368ec8fe350adfbc2acc3f225590fc580..3ee928d5c895e00ad7e4cb198496459596ba59b7 100644 (file)
@@ -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() */
index d24fe3c504957f331e15af60a81e9f5eada6b773..75daddd5e3418d0e09585c09bd29250d66a41e04 100644 (file)
@@ -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));
index 7a70d536d6b21497c949a0ed919accfba3456e0f..e3a6990fc99d3afd0d7c77bc0f5d81499230f996 100644 (file)
@@ -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);
        }