]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix compiler warnings and test failures when building without threads
authorEvan Hunt <each@isc.org>
Sat, 10 Mar 2018 18:33:45 +0000 (10:33 -0800)
committerEvan Hunt <each@isc.org>
Sat, 10 Mar 2018 18:37:22 +0000 (10:37 -0800)
(cherry picked from commit 56353aaf42542efbc50c61d8fe779ceb7d627713)

lib/isc/tests/task_test.c
lib/isc/tests/timer_test.c

index 96e9e5ba1031630db3f44f9c3e91c74ee0c2775d..c4633de4bf12bca0e8eb56ed4a2aed469a0ed704 100644 (file)
  */
 
 static isc_mutex_t lock;
-static isc_condition_t cv;
 int counter = 0;
 static int active[10];
 static isc_boolean_t done = ISC_FALSE;
 
+#ifdef ISC_PLATFORM_USETHREADS
+static isc_condition_t cv;
+#endif
+
 static void
 set(isc_task_t *task, isc_event_t *event) {
        int *value = (int *) event->ev_arg;
@@ -649,6 +652,10 @@ ATF_TC_BODY(task_exclusive, tc) {
        isc_test_end();
 }
 
+/*
+ * The remainder of these tests require threads
+ */
+#ifdef ISC_PLATFORM_USETHREADS
 /*
  * Max tasks test:
  * The task system can create and execute many tasks. Tests with 10000.
@@ -1446,6 +1453,7 @@ ATF_TC_HEAD(purgeevent_notpurge, tc) {
 ATF_TC_BODY(purgeevent_notpurge, tc) {
        try_purgeevent(ISC_FALSE);
 }
+#endif
 
 /*
  * Main
index a33a4b469c375b56443f3a2a093883807ac820ae..5fac83168cf36ae362e51084203a346b2d7406a6 100644 (file)
 
 #include "isctest.h"
 
+/*
+ * This entire test requires threads.
+ */
+#ifdef ISC_PLATFORM_USETHREADS
+
 /*
  * Helper functions
  */
@@ -564,6 +569,16 @@ ATF_TC_BODY(purge, tc) {
 
        isc_test_end();
 }
+#else
+ATF_TC(untested);
+ATF_TC_HEAD(untested, tc) {
+        atf_tc_set_md_var(tc, "descr", "skipping nsec3 test");
+}
+ATF_TC_BODY(untested, tc) {
+        UNUSED(tc);
+        atf_tc_skip("DNSSEC not available");
+}
+#endif
 
 /*
  * Main
@@ -575,6 +590,8 @@ ATF_TP_ADD_TCS(tp) {
        ATF_TP_ADD_TC(tp, once_idle);
        ATF_TP_ADD_TC(tp, reset);
        ATF_TP_ADD_TC(tp, purge);
+#else
+       ATF_TP_ADD_TC(tp, untested);
 #endif
 
        return (atf_no_error());