]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/test-lock_hh.cc
dnsdist: Add HTTPStatusAction to return a specific HTTP response
[thirdparty/pdns.git] / pdns / test-lock_hh.cc
index 707dcc183c8f9286337f067ea58c656e741b52fa..7f73d5e455dafa00b51359a5fcb130fbd1cb467a 100644 (file)
@@ -41,8 +41,17 @@ BOOST_AUTO_TEST_CASE(test_pdns_lock)
   for(auto& pp : g_locks)
     wlocks.emplace_back(&*pp);
 
-  TryReadLock trl(&*g_locks[0]);
-  BOOST_CHECK(!trl.gotIt());
+  // on macOS, this TryReadLock throws (EDEADLK) instead of simply failing
+  // so we catch the exception and consider that success for this test
+  bool gotit = false;
+  try {
+    TryReadLock trl(&*g_locks[0]);
+    gotit = trl.gotIt();
+  }
+  catch(const PDNSException &e) {
+    gotit = false;
+  }
+  BOOST_CHECK(!gotit);
 
   wlocks.clear();
   TryReadLock trl2(&*g_locks[0]);