diff --git a/tests/benchmarks/scheduler-bench.cpp b/tests/benchmarks/scheduler-bench.cpp
index 46af278..e1e3433 100644
--- a/tests/benchmarks/scheduler-bench.cpp
+++ b/tests/benchmarks/scheduler-bench.cpp
@@ -25,14 +25,14 @@
 #include "ndn-cxx/util/scheduler.hpp"
 #include "tests/benchmarks/timed-execute.hpp"
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 #include <iostream>
 
 namespace ndn::tests {
 
 BOOST_AUTO_TEST_CASE(ScheduleCancel)
 {
-  boost::asio::io_service io;
+  boost::asio::io_context io;
   Scheduler sched(io);
 
   const size_t nEvents = 1000000;
@@ -56,7 +56,7 @@
 
 BOOST_AUTO_TEST_CASE(Execute)
 {
-  boost::asio::io_service io;
+  boost::asio::io_context io;
   Scheduler sched(io);
 
   const size_t nEvents = 1000000;
diff --git a/tests/integration/face.cpp b/tests/integration/face.cpp
index 7bd2408..a759e35 100644
--- a/tests/integration/face.cpp
+++ b/tests/integration/face.cpp
@@ -68,7 +68,7 @@
 protected:
   FaceFixture()
     : face(TransportType::create(""), m_keyChain)
-    , sched(face.getIoService())
+    , sched(face.getIoContext())
   {
   }
 
@@ -82,7 +82,7 @@
   sendInterest(time::nanoseconds delay, const Interest& interest, char& outcome)
   {
     if (face2 == nullptr) {
-      face2 = make_unique<Face>(TransportType::create(""), face.getIoService(), m_keyChain);
+      face2 = make_unique<Face>(TransportType::create(""), face.getIoContext(), m_keyChain);
     }
 
     outcome = '?';
@@ -101,13 +101,13 @@
     return sendInterest(delay, interest, ignoredOutcome);
   }
 
-  /** \brief Stop io_service after a delay
+  /** \brief Stop io_context after a delay
    *  \return scheduled event id
    */
   scheduler::EventId
   terminateAfter(time::nanoseconds delay)
   {
-    return sched.schedule(delay, [this] { face.getIoService().stop(); });
+    return sched.schedule(delay, [this] { face.getIoContext().stop(); });
   }
 
 protected:
diff --git a/tests/integration/network-monitor.cpp b/tests/integration/network-monitor.cpp
index cf6d8bd..ff4d932 100644
--- a/tests/integration/network-monitor.cpp
+++ b/tests/integration/network-monitor.cpp
@@ -30,7 +30,7 @@
 #include "ndn-cxx/util/string-helper.hpp"
 #include "ndn-cxx/util/time.hpp"
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 #include <iostream>
 
 namespace ndn::tests {
@@ -48,7 +48,7 @@
 
 BOOST_AUTO_TEST_CASE(Signals)
 {
-  boost::asio::io_service io;
+  boost::asio::io_context io;
   NetworkMonitor monitor(io);
 
   std::cout << "capabilities=" << AsHex{monitor.getCapabilities()} << std::endl;
diff --git a/tests/unit/encoding/block.t.cpp b/tests/unit/encoding/block.t.cpp
index c93a307..b4f2cf8 100644
--- a/tests/unit/encoding/block.t.cpp
+++ b/tests/unit/encoding/block.t.cpp
@@ -649,8 +649,8 @@
 {
   Block block = "0101A0"_block;
   boost::asio::const_buffer buffer(block);
-  BOOST_CHECK_EQUAL(boost::asio::buffer_cast<const uint8_t*>(buffer), block.data());
-  BOOST_CHECK_EQUAL(boost::asio::buffer_size(buffer), block.size());
+  BOOST_CHECK_EQUAL(buffer.data(), block.data());
+  BOOST_CHECK_EQUAL(buffer.size(), block.size());
 }
 
 BOOST_AUTO_TEST_CASE(Equality)
diff --git a/tests/unit/face.t.cpp b/tests/unit/face.t.cpp
index f369d6f..78d7c67 100644
--- a/tests/unit/face.t.cpp
+++ b/tests/unit/face.t.cpp
@@ -96,8 +96,8 @@
                          BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
                          ++nData;
                        },
-                       std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   advanceClocks(40_ms);
 
@@ -112,9 +112,9 @@
 
   size_t nTimeouts = 0;
   face.expressInterest(*makeInterest("/Hello/World/a/2", false, 50_ms),
-                       std::bind([]{}),
-                       std::bind([]{}),
-                       std::bind([&nTimeouts] { ++nTimeouts; }));
+                       [] (auto&&...) {},
+                       [] (auto&&...) {},
+                       [&] (auto&&...) { ++nTimeouts; });
   advanceClocks(200_ms, 5);
   BOOST_CHECK_EQUAL(nTimeouts, 1);
 }
@@ -124,14 +124,14 @@
   size_t nData = 0;
 
   face.expressInterest(*makeInterest("/Hello/World", true, 50_ms),
-                       [&] (const auto&, const auto&) { ++nData; },
-                       std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [&] (auto&&...) { ++nData; },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   face.expressInterest(*makeInterest("/Hello/World/a", true, 50_ms),
-                       [&] (const auto&, const auto&) { ++nData; },
-                       std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [&] (auto&&...) { ++nData; },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   advanceClocks(40_ms);
 
@@ -148,8 +148,8 @@
 {
   face.expressInterest(*makeInterest("/Hello/World", true),
                        nullptr,
-                       std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
   advanceClocks(1_ms);
 
   BOOST_CHECK_NO_THROW(do {
@@ -162,13 +162,12 @@
 {
   size_t nTimeouts = 0;
   face.expressInterest(*makeInterest("/Hello/World", false, 50_ms),
-                       std::bind([] { BOOST_FAIL("Unexpected Data"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Data"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Nack"); },
                        [&nTimeouts] (const Interest& i) {
                          BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
                          ++nTimeouts;
                        });
-
   advanceClocks(200_ms, 5);
 
   BOOST_CHECK_EQUAL(nTimeouts, 1);
@@ -180,8 +179,8 @@
 BOOST_AUTO_TEST_CASE(EmptyTimeoutCallback)
 {
   face.expressInterest(*makeInterest("/Hello/World", false, 50_ms),
-                       std::bind([] { BOOST_FAIL("Unexpected Data"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Data"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Nack"); },
                        nullptr);
   advanceClocks(40_ms);
 
@@ -195,16 +194,15 @@
   size_t nNacks = 0;
 
   auto interest = makeInterest("/Hello/World", false, 50_ms);
-
   face.expressInterest(*interest,
-                       std::bind([] { BOOST_FAIL("Unexpected Data"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Data"); },
                        [&] (const Interest& i, const lp::Nack& n) {
                          BOOST_CHECK(i.getName().isPrefixOf(n.getInterest().getName()));
                          BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
                          BOOST_CHECK_EQUAL(n.getReason(), lp::NackReason::DUPLICATE);
                          ++nNacks;
                        },
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   advanceClocks(40_ms);
 
@@ -222,15 +220,15 @@
 
   auto interest = makeInterest("/Hello/World", false, 50_ms, 1);
   face.expressInterest(*interest,
-                       std::bind([] { BOOST_FAIL("Unexpected Data"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Data"); },
                        [&] (const auto&, const auto&) { ++nNacks; },
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   interest->setNonce(2);
   face.expressInterest(*interest,
-                       std::bind([] { BOOST_FAIL("Unexpected Data"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Data"); },
                        [&] (const auto&, const auto&) { ++nNacks; },
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   advanceClocks(40_ms);
 
@@ -245,9 +243,9 @@
 BOOST_AUTO_TEST_CASE(EmptyNackCallback)
 {
   face.expressInterest(*makeInterest("/Hello/World"),
-                       std::bind([] { BOOST_FAIL("Unexpected Data"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected Data"); },
                        nullptr,
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
   advanceClocks(1_ms);
 
   BOOST_CHECK_NO_THROW(do {
@@ -259,7 +257,7 @@
 BOOST_AUTO_TEST_CASE(PutDataFromDataCallback) // Bug 4596
 {
   face.expressInterest(*makeInterest("/localhost/notification/1"),
-                       [&] (const auto&, const auto&) {
+                       [&] (auto&&...) {
                          face.put(*makeData("/chronosync/sampleDigest/1"));
                        }, nullptr, nullptr);
   advanceClocks(10_ms);
@@ -290,9 +288,9 @@
 BOOST_AUTO_TEST_CASE(Handle)
 {
   auto hdl = face.expressInterest(*makeInterest("/Hello/World", true, 50_ms),
-                                  std::bind([] { BOOST_FAIL("Unexpected data"); }),
-                                  std::bind([] { BOOST_FAIL("Unexpected nack"); }),
-                                  std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                                  [] (auto&&...) { BOOST_FAIL("Unexpected data"); },
+                                  [] (auto&&...) { BOOST_FAIL("Unexpected nack"); },
+                                  [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
   advanceClocks(1_ms);
   hdl.cancel();
   advanceClocks(1_ms);
@@ -302,9 +300,9 @@
   // cancel after destructing face
   auto face2 = make_unique<DummyClientFace>(m_io, m_keyChain);
   auto hdl2 = face2->expressInterest(*makeInterest("/Hello/World", true, 50_ms),
-                                     std::bind([] { BOOST_FAIL("Unexpected data"); }),
-                                     std::bind([] { BOOST_FAIL("Unexpected nack"); }),
-                                     std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                                     [] (auto&&...) { BOOST_FAIL("Unexpected data"); },
+                                     [] (auto&&...) { BOOST_FAIL("Unexpected nack"); },
+                                     [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
   advanceClocks(1_ms);
   face2.reset();
   advanceClocks(1_ms);
@@ -320,14 +318,14 @@
 BOOST_AUTO_TEST_CASE(RemoveAllPendingInterests)
 {
   face.expressInterest(*makeInterest("/Hello/World/0", false, 50_ms),
-                       std::bind([] { BOOST_FAIL("Unexpected data"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected data"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   face.expressInterest(*makeInterest("/Hello/World/1", false, 50_ms),
-                       std::bind([] { BOOST_FAIL("Unexpected data"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected data"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
 
   advanceClocks(10_ms);
 
@@ -370,18 +368,19 @@
   bool hasInterest1 = false, hasData = false;
 
   // first InterestFilter allows loopback and should receive Interest
-  face.setInterestFilter("/", [&] (const InterestFilter&, const Interest&) {
+  face.setInterestFilter("/", [&] (auto&&...) {
     hasInterest1 = true;
     // do not respond with Data right away, so Face must send Interest to forwarder
   });
+
   // second InterestFilter disallows loopback and should not receive Interest
   face.setInterestFilter(InterestFilter("/").allowLoopback(false),
-    std::bind([] { BOOST_ERROR("Unexpected Interest on second InterestFilter"); }));
+                         [] (auto&&...) { BOOST_ERROR("Unexpected Interest on second InterestFilter"); });
 
   face.expressInterest(*makeInterest("/A", true),
-                       std::bind([&] { hasData = true; }),
-                       std::bind([] { BOOST_FAIL("Unexpected nack"); }),
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [&] (auto&&...) { hasData = true; },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected nack"); },
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
   advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(hasInterest1, true); // Interest looped back
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); // Interest sent to forwarder
@@ -397,12 +396,12 @@
 {
   bool hasInterest1 = false;
   // register two Interest destinations
-  face.setInterestFilter("/", std::bind([&] {
+  face.setInterestFilter("/", [&] (auto&&...) {
     hasInterest1 = true;
     // sending Data right away from the first destination, don't care whether Interest goes to second destination
     face.put(*makeData("/A/B"));
-  }));
-  face.setInterestFilter("/", std::bind([]{}));
+  });
+  face.setInterestFilter("/", [] (auto&&...) {});
   advanceClocks(10_ms);
 
   face.receive(*makeInterest("/A", true));
@@ -417,7 +416,8 @@
 
 BOOST_AUTO_TEST_CASE(PutNack)
 {
-  face.setInterestFilter("/", std::bind([]{})); // register one Interest destination so that face can accept Nacks
+  // register one Interest destination so that face can accept Nacks
+  face.setInterestFilter("/", [] (auto&&...) {});
   advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(face.sentNacks.size(), 0);
@@ -457,7 +457,7 @@
     // sending Nack right away from the first destination, Interest should still go to second destination
     face.put(makeNack(interest, lp::NackReason::CONGESTION));
   });
-  face.setInterestFilter("/", std::bind([&] { hasInterest2 = true; }));
+  face.setInterestFilter("/", [&] (auto&&...) { hasInterest2 = true; });
   advanceClocks(10_ms);
 
   auto interest = makeInterest("/A", false, std::nullopt, 14333271);
@@ -487,18 +487,19 @@
     hasInterest1 = true;
     face.put(makeNack(interest, lp::NackReason::CONGESTION));
   });
+
   // second InterestFilter disallows loopback and should not receive Interest
   face.setInterestFilter(InterestFilter("/").allowLoopback(false),
-    std::bind([] { BOOST_ERROR("Unexpected Interest on second InterestFilter"); }));
+                         [] (auto&&...) { BOOST_ERROR("Unexpected Interest on second InterestFilter"); });
 
   auto interest = makeInterest("/A", false, std::nullopt, 28395852);
   face.expressInterest(*interest,
-                       std::bind([] { BOOST_FAIL("Unexpected data"); }),
+                       [] (auto&&...) { BOOST_FAIL("Unexpected data"); },
                        [&] (const Interest&, const lp::Nack& nack) {
                          hasNack = true;
                          BOOST_CHECK_EQUAL(nack.getReason(), lp::NackReason::CONGESTION);
                        },
-                       std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
+                       [] (auto&&...) { BOOST_FAIL("Unexpected timeout"); });
   advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(hasInterest1, true); // Interest looped back
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); // Interest sent to forwarder
@@ -553,7 +554,7 @@
   // cancel after destructing face
   auto face2 = make_unique<DummyClientFace>(m_io, m_keyChain);
   hdl = face2->registerPrefix("/Hello/World/2", nullptr,
-                              std::bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
+                              [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
   advanceClocks(1_ms);
   face2.reset();
   advanceClocks(1_ms);
@@ -563,7 +564,7 @@
   // unregister after destructing face
   auto face3 = make_unique<DummyClientFace>(m_io, m_keyChain);
   hdl = face3->registerPrefix("/Hello/World/3", nullptr,
-                              std::bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
+                              [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
   advanceClocks(1_ms);
   face3.reset();
   advanceClocks(1_ms);
@@ -579,9 +580,9 @@
   size_t nInterests = 0;
   size_t nRegs = 0;
   auto hdl = face.setInterestFilter("/Hello/World",
-                                    std::bind([&nInterests] { ++nInterests; }),
-                                    std::bind([&nRegs] { ++nRegs; }),
-                                    std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                                    [&] (auto&&...) { ++nInterests; },
+                                    [&] (auto&&...) { ++nRegs; },
+                                    [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegs, 1);
   BOOST_CHECK_EQUAL(nInterests, 0);
@@ -623,8 +624,8 @@
 {
   size_t nInterests = 0;
   auto hdl = face.setInterestFilter("/Hello/World",
-                                    std::bind([&nInterests] { ++nInterests; }),
-                                    std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                                    [&] (auto&&...) { ++nInterests; },
+                                    [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nInterests, 0);
 
@@ -654,9 +655,9 @@
   // don't enable registration reply
   size_t nRegFailed = 0;
   face.setInterestFilter("/Hello/World",
-                         std::bind([] { BOOST_FAIL("Unexpected Interest"); }),
-                         std::bind([] { BOOST_FAIL("Unexpected success of setInterestFilter"); }),
-                         std::bind([&nRegFailed] { ++nRegFailed; }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected Interest"); },
+                         [] (auto&&...) { BOOST_FAIL("Unexpected success"); },
+                         [&] (auto&&...) { ++nRegFailed; });
 
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegFailed, 0);
@@ -670,8 +671,8 @@
   // don't enable registration reply
   size_t nRegFailed = 0;
   face.setInterestFilter("/Hello/World",
-                         std::bind([] { BOOST_FAIL("Unexpected Interest"); }),
-                         std::bind([&nRegFailed] { ++nRegFailed; }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected Interest"); },
+                         [&] (auto&&...) { ++nRegFailed; });
 
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegFailed, 0);
@@ -684,21 +685,21 @@
 {
   size_t nInInterests1 = 0;
   face.setInterestFilter("/Hello/World",
-                         std::bind([&nInInterests1] { ++nInInterests1; }),
+                         [&nInInterests1] (auto&&...) { ++nInInterests1; },
                          nullptr,
-                         std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
   size_t nInInterests2 = 0;
   face.setInterestFilter("/Hello",
-                         std::bind([&nInInterests2] { ++nInInterests2; }),
+                         [&nInInterests2] (auto&&...) { ++nInInterests2; },
                          nullptr,
-                         std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
   size_t nInInterests3 = 0;
   face.setInterestFilter("/Los/Angeles/Lakers",
-                         std::bind([&nInInterests3] { ++nInInterests3; }),
+                         [&nInInterests3] (auto&&...) { ++nInInterests3; },
                          nullptr,
-                         std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
   advanceClocks(25_ms, 4);
 
@@ -714,9 +715,9 @@
 {
   size_t nInInterests = 0;
   face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
-                         std::bind([&nInInterests] { ++nInInterests; }),
+                         [&nInInterests] (auto&&...) { ++nInInterests; },
                          nullptr,
-                         std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
   advanceClocks(25_ms, 4);
 
@@ -736,11 +737,14 @@
 BOOST_AUTO_TEST_CASE(RegexFilterError)
 {
   face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
+                         // Do NOT use 'auto' for this lambda. This is testing the (failure of)
+                         // implicit conversion from InterestFilter to Name, therefore the type
+                         // of the first parameter must be explicit.
                          [] (const Name&, const Interest&) {
-                           BOOST_FAIL("InterestFilter::Error should have been triggered");
+                           BOOST_FAIL("InterestFilter::Error should have been raised");
                          },
                          nullptr,
-                         std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                         [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
   advanceClocks(25_ms, 4);
 
@@ -751,12 +755,12 @@
 {
   size_t nInInterests = 0;
   face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
-                         std::bind([&nInInterests] { ++nInInterests; }));
+                         [&] (auto&&...) { ++nInInterests; });
 
   size_t nRegSuccesses = 0;
   face.registerPrefix("/Hello/World",
-                      std::bind([&nRegSuccesses] { ++nRegSuccesses; }),
-                      std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                      [&] (auto&&...) { ++nRegSuccesses; },
+                      [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegSuccesses, 1);
@@ -780,11 +784,11 @@
   // Regular Face won't accept incoming packets until something is sent.
 
   int hit = 0;
-  face.setInterestFilter(Name("/"), std::bind([&hit] { ++hit; }));
-  face.processEvents(time::milliseconds(-1));
+  face.setInterestFilter(Name("/"), [&hit] (auto&&...) { ++hit; });
+  face.processEvents(-1_ms);
 
   face.receive(*makeInterest("/A"));
-  face.processEvents(time::milliseconds(-1));
+  face.processEvents(-1_ms);
 
   BOOST_CHECK_EQUAL(hit, 1);
 }
@@ -792,7 +796,7 @@
 BOOST_AUTO_TEST_CASE(Handle)
 {
   int hit = 0;
-  InterestFilterHandle hdl = face.setInterestFilter(Name("/"), std::bind([&hit] { ++hit; }));
+  InterestFilterHandle hdl = face.setInterestFilter(Name("/"), [&hit] (auto&&...) { ++hit; });
   face.processEvents(-1_ms);
 
   face.receive(*makeInterest("/A"));
@@ -820,18 +824,18 @@
 
 BOOST_AUTO_TEST_CASE(ProcessEvents)
 {
-  face.processEvents(time::milliseconds(-1)); // io_service::reset()/poll() inside
+  face.processEvents(-1_ms); // io_context::restart()/poll() inside
 
-  size_t nRegSuccesses = 0;
+  int nRegSuccesses = 0;
   face.registerPrefix("/Hello/World",
-                      std::bind([&nRegSuccesses] { ++nRegSuccesses; }),
-                      std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+                      [&] (auto&&...) { ++nRegSuccesses; },
+                      [] (auto&&...) { BOOST_FAIL("Unexpected failure"); });
 
-  // io_service::poll() without reset
-  face.getIoService().poll();
+  // io_context::poll() without reset
+  face.getIoContext().poll();
   BOOST_CHECK_EQUAL(nRegSuccesses, 0);
 
-  face.processEvents(time::milliseconds(-1)); // io_service::reset()/poll() inside
+  face.processEvents(-1_ms); // io_context::restart()/poll() inside
   BOOST_CHECK_EQUAL(nRegSuccesses, 1);
 }
 
@@ -852,16 +856,14 @@
 
 BOOST_FIXTURE_TEST_CASE(FaceTransport, IoKeyChainFixture)
 {
-  BOOST_CHECK(Face().getTransport() != nullptr);
-
-  BOOST_CHECK(Face(shared_ptr<Transport>()).getTransport() != nullptr);
-  BOOST_CHECK(Face(shared_ptr<Transport>(), m_io).getTransport() != nullptr);
-  BOOST_CHECK(Face(shared_ptr<Transport>(), m_io, m_keyChain).getTransport() != nullptr);
+  BOOST_CHECK_NO_THROW(Face(shared_ptr<Transport>()));
+  BOOST_CHECK_NO_THROW(Face(shared_ptr<Transport>(), m_io));
+  BOOST_CHECK_NO_THROW(Face(shared_ptr<Transport>(), m_io, m_keyChain));
 
   auto transport = make_shared<TcpTransport>("localhost", "6363"); // no real io operations will be scheduled
-  BOOST_CHECK(Face(transport).getTransport() == transport);
-  BOOST_CHECK(Face(transport, m_io).getTransport() == transport);
-  BOOST_CHECK(Face(transport, m_io, m_keyChain).getTransport() == transport);
+  BOOST_CHECK(&Face(transport).getTransport() == transport.get());
+  BOOST_CHECK(&Face(transport, m_io).getTransport() == transport.get());
+  BOOST_CHECK(&Face(transport, m_io, m_keyChain).getTransport() == transport.get());
 }
 
 class WithEnv
@@ -914,8 +916,8 @@
 BOOST_FIXTURE_TEST_CASE(NoConfig, WithEnvAndConfig) // fixture configures test HOME and PIB/TPM path
 {
   shared_ptr<Face> face;
-  BOOST_REQUIRE_NO_THROW(face = make_shared<Face>());
-  BOOST_CHECK(dynamic_pointer_cast<UnixTransport>(face->getTransport()) != nullptr);
+  BOOST_CHECK_NO_THROW(face = make_shared<Face>());
+  BOOST_CHECK(dynamic_cast<UnixTransport*>(&face->getTransport()) != nullptr);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Unix, T, ConfigOptions, T)
@@ -923,8 +925,8 @@
   this->configure("unix://some/path");
 
   shared_ptr<Face> face;
-  BOOST_REQUIRE_NO_THROW(face = make_shared<Face>());
-  BOOST_CHECK(dynamic_pointer_cast<UnixTransport>(face->getTransport()) != nullptr);
+  BOOST_CHECK_NO_THROW(face = make_shared<Face>());
+  BOOST_CHECK(dynamic_cast<UnixTransport*>(&face->getTransport()) != nullptr);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Tcp, T, ConfigOptions, T)
@@ -932,8 +934,8 @@
   this->configure("tcp://127.0.0.1:6000");
 
   shared_ptr<Face> face;
-  BOOST_REQUIRE_NO_THROW(face = make_shared<Face>());
-  BOOST_CHECK(dynamic_pointer_cast<TcpTransport>(face->getTransport()) != nullptr);
+  BOOST_CHECK_NO_THROW(face = make_shared<Face>());
+  BOOST_CHECK(dynamic_cast<TcpTransport*>(&face->getTransport()) != nullptr);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(WrongTransport, T, ConfigOptions, T)
@@ -956,8 +958,8 @@
   this->WithConfig::configure("unix://some/path");
 
   shared_ptr<Face> face;
-  BOOST_REQUIRE_NO_THROW(face = make_shared<Face>());
-  BOOST_CHECK(dynamic_pointer_cast<TcpTransport>(face->getTransport()) != nullptr);
+  BOOST_CHECK_NO_THROW(face = make_shared<Face>());
+  BOOST_CHECK(dynamic_cast<TcpTransport*>(&face->getTransport()) != nullptr);
 }
 
 BOOST_FIXTURE_TEST_CASE(ExplicitTransport, WithEnvAndConfig)
@@ -967,8 +969,8 @@
 
   auto transport = make_shared<UnixTransport>("unix://some/path");
   shared_ptr<Face> face;
-  BOOST_REQUIRE_NO_THROW(face = make_shared<Face>(transport));
-  BOOST_CHECK(dynamic_pointer_cast<UnixTransport>(face->getTransport()) != nullptr);
+  BOOST_CHECK_NO_THROW(face = make_shared<Face>(transport));
+  BOOST_CHECK(dynamic_cast<UnixTransport*>(&face->getTransport()) != nullptr);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // Transport
diff --git a/tests/unit/io-fixture.hpp b/tests/unit/io-fixture.hpp
index 191b889..762dd6c 100644
--- a/tests/unit/io-fixture.hpp
+++ b/tests/unit/io-fixture.hpp
@@ -24,7 +24,7 @@
 
 #include "tests/unit/clock-fixture.hpp"
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 
 namespace ndn::tests {
 
@@ -41,7 +41,7 @@
   }
 
 protected:
-  boost::asio::io_service m_io;
+  boost::asio::io_context m_io;
 };
 
 } // namespace ndn::tests
diff --git a/tests/unit/net/dns.t.cpp b/tests/unit/net/dns.t.cpp
index ac734dd..17c5438 100644
--- a/tests/unit/net/dns.t.cpp
+++ b/tests/unit/net/dns.t.cpp
@@ -24,20 +24,19 @@
 #include "tests/boost-test.hpp"
 #include "tests/unit/net/network-configuration-detector.hpp"
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 
 namespace ndn::tests {
 
 using namespace ndn::dns;
-using boost::asio::ip::address_v4;
-using boost::asio::ip::address_v6;
+namespace ip = boost::asio::ip;
 
 class DnsFixture
 {
 public:
   void
-  onSuccess(const IpAddress& resolvedAddress,
-            const IpAddress& expectedAddress,
+  onSuccess(const boost::asio::ip::address& resolvedAddress,
+            const boost::asio::ip::address& expectedAddress,
             bool isValid,
             bool shouldCheckAddress = false)
   {
@@ -66,105 +65,95 @@
 protected:
   int m_nFailures = 0;
   int m_nSuccesses = 0;
-  boost::asio::io_service m_ioService;
+  boost::asio::io_context m_ioCtx;
 };
 
 BOOST_AUTO_TEST_SUITE(Net)
 BOOST_FIXTURE_TEST_SUITE(TestDns, DnsFixture)
 
-BOOST_AUTO_TEST_CASE(Asynchronous)
+BOOST_AUTO_TEST_CASE(Failure)
 {
   SKIP_IF_IP_UNAVAILABLE();
 
   asyncResolve("nothost.nothost.nothost.arpa",
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v4()), false, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v4(), false, false),
                [this] (auto&&...) { onFailure(true); },
-               m_ioService); // should fail
+               m_ioCtx); // should fail
 
-  m_ioService.run();
+  m_ioCtx.run();
   BOOST_CHECK_EQUAL(m_nFailures, 1);
   BOOST_CHECK_EQUAL(m_nSuccesses, 0);
 }
 
-BOOST_AUTO_TEST_CASE(AsynchronousV4)
+BOOST_AUTO_TEST_CASE(Ipv4)
 {
   SKIP_IF_IPV4_UNAVAILABLE();
 
   asyncResolve("192.0.2.1",
-               std::bind(&DnsFixture::onSuccess, this, _1,
-                         IpAddress(address_v4::from_string("192.0.2.1")), true, true),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::make_address_v4("192.0.2.1"), true, true),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService);
+               m_ioCtx);
 
-  m_ioService.run();
+  m_ioCtx.run();
   BOOST_CHECK_EQUAL(m_nFailures, 0);
   BOOST_CHECK_EQUAL(m_nSuccesses, 1);
 }
 
-BOOST_AUTO_TEST_CASE(AsynchronousV6)
+BOOST_AUTO_TEST_CASE(Ipv6)
 {
   SKIP_IF_IPV6_UNAVAILABLE();
 
   asyncResolve("ipv6.google.com", // only IPv6 address should be available
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), true, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v6(), true, false),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService);
+               m_ioCtx);
 
   asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3",
                std::bind(&DnsFixture::onSuccess, this, _1,
-                         IpAddress(address_v6::from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3")),
-                         true, true),
+                         ip::make_address_v6("2001:db8:3f9:0:3025:ccc5:eeeb:86d3"), true, true),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService);
+               m_ioCtx);
 
-  m_ioService.run();
+  m_ioCtx.run();
   BOOST_CHECK_EQUAL(m_nFailures, 0);
   BOOST_CHECK_EQUAL(m_nSuccesses, 2);
 }
 
-BOOST_AUTO_TEST_CASE(AsynchronousV4AndV6)
+BOOST_AUTO_TEST_CASE(WithAddressSelector)
 {
   SKIP_IF_IPV4_UNAVAILABLE();
   SKIP_IF_IPV6_UNAVAILABLE();
 
   asyncResolve("named-data.net",
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v4()), true, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v4(), true, false),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService, Ipv4Only());
+               m_ioCtx, Ipv4Only());
 
   asyncResolve("a.root-servers.net",
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v4()), true, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v4(), true, false),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService, Ipv4Only()); // request IPv4 address
+               m_ioCtx, Ipv4Only()); // request IPv4 address
 
   asyncResolve("a.root-servers.net",
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), true, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v6(), true, false),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService, Ipv6Only()); // request IPv6 address
+               m_ioCtx, Ipv6Only()); // request IPv6 address
 
   asyncResolve("ipv6.google.com", // only IPv6 address should be available
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), true, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v6(), true, false),
                [this] (auto&&...) { onFailure(false); },
-               m_ioService, Ipv6Only());
+               m_ioCtx, Ipv6Only());
 
   asyncResolve("ipv6.google.com", // only IPv6 address should be available
-               std::bind(&DnsFixture::onSuccess, this, _1, IpAddress(address_v6()), false, false),
+               std::bind(&DnsFixture::onSuccess, this, _1, ip::address_v6(), false, false),
                [this] (auto&&...) { onFailure(true); },
-               m_ioService, Ipv4Only()); // should fail
+               m_ioCtx, Ipv4Only()); // should fail
 
-  m_ioService.run();
+  m_ioCtx.run();
   BOOST_CHECK_EQUAL(m_nFailures, 1);
   BOOST_CHECK_EQUAL(m_nSuccesses, 4);
 }
 
-BOOST_AUTO_TEST_CASE(Synchronous)
-{
-  SKIP_IF_IP_UNAVAILABLE();
-
-  IpAddress address = syncResolve("named-data.net", m_ioService);
-  BOOST_CHECK(address.is_v4() || address.is_v6());
-}
-
 BOOST_AUTO_TEST_SUITE_END() // TestDns
 BOOST_AUTO_TEST_SUITE_END() // Net
 
diff --git a/tests/unit/net/face-uri.t.cpp b/tests/unit/net/face-uri.t.cpp
index 78e712a..36883bf 100644
--- a/tests/unit/net/face-uri.t.cpp
+++ b/tests/unit/net/face-uri.t.cpp
@@ -94,7 +94,7 @@
   shared_ptr<const net::NetworkInterface> m_netif;
 
 private:
-  boost::asio::io_service m_io;
+  boost::asio::io_context m_io;
 };
 
 BOOST_AUTO_TEST_CASE(ParseInternal)
@@ -147,11 +147,11 @@
 
   namespace ip = boost::asio::ip;
 
-  ip::udp::endpoint endpoint4(ip::address_v4::from_string("192.0.2.1"), 7777);
+  ip::udp::endpoint endpoint4(ip::make_address_v4("192.0.2.1"), 7777);
   uri = FaceUri(endpoint4);
   BOOST_CHECK_EQUAL(uri.toString(), "udp4://192.0.2.1:7777");
 
-  ip::udp::endpoint endpoint6(ip::address_v6::from_string("2001:DB8::1"), 7777);
+  ip::udp::endpoint endpoint6(ip::make_address_v6("2001:DB8::1"), 7777);
   uri = FaceUri(endpoint6);
   BOOST_CHECK_EQUAL(uri.toString(), "udp6://[2001:db8::1]:7777");
 
@@ -285,14 +285,14 @@
 
   namespace ip = boost::asio::ip;
 
-  ip::tcp::endpoint endpoint4(ip::address_v4::from_string("192.0.2.1"), 7777);
+  ip::tcp::endpoint endpoint4(ip::make_address_v4("192.0.2.1"), 7777);
   uri = FaceUri(endpoint4);
   BOOST_CHECK_EQUAL(uri.toString(), "tcp4://192.0.2.1:7777");
 
   uri = FaceUri(endpoint4, "wsclient");
   BOOST_CHECK_EQUAL(uri.toString(), "wsclient://192.0.2.1:7777");
 
-  ip::tcp::endpoint endpoint6(ip::address_v6::from_string("2001:DB8::1"), 7777);
+  ip::tcp::endpoint endpoint6(ip::make_address_v6("2001:DB8::1"), 7777);
   uri = FaceUri(endpoint6);
   BOOST_CHECK_EQUAL(uri.toString(), "tcp6://[2001:db8::1]:7777");
 
@@ -553,7 +553,7 @@
 
 BOOST_AUTO_TEST_CASE(CanonizeEmptyCallback)
 {
-  boost::asio::io_service io;
+  boost::asio::io_context io;
 
   // unsupported scheme
   FaceUri("null://").canonize(nullptr, nullptr, io, 1_ms);
diff --git a/tests/unit/net/network-configuration-detector.cpp b/tests/unit/net/network-configuration-detector.cpp
index f8a8816..44cae39 100644
--- a/tests/unit/net/network-configuration-detector.cpp
+++ b/tests/unit/net/network-configuration-detector.cpp
@@ -21,11 +21,9 @@
 
 #include "tests/unit/net/network-configuration-detector.hpp"
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
 #include <boost/asio/ip/address.hpp>
-#include <boost/asio/ip/basic_resolver.hpp>
 #include <boost/asio/ip/udp.hpp>
-#include <boost/range/iterator_range_core.hpp>
 
 namespace ndn::tests {
 
@@ -50,31 +48,23 @@
 void
 NetworkConfigurationDetector::detect()
 {
-  using BoostResolver = boost::asio::ip::basic_resolver<boost::asio::ip::udp>;
+  boost::asio::io_context io;
+  boost::asio::ip::udp::resolver resolver(io);
 
-  boost::asio::io_service ioService;
-  BoostResolver resolver(ioService);
+  boost::system::error_code ec;
+  // The specified hostname must have both A and AAAA records
+  auto results = resolver.resolve("a.root-servers.net", "", ec);
 
-  // The specified hostname must contain both A and AAAA records
-  BoostResolver::query query("a.root-servers.net", "");
-
-  boost::system::error_code errorCode;
-  BoostResolver::iterator begin = resolver.resolve(query, errorCode);
-  if (errorCode) {
-    s_isInitialized = true;
-    return;
-  }
-  BoostResolver::iterator end;
-
-  for (const auto& i : boost::make_iterator_range(begin, end)) {
-    if (i.endpoint().address().is_v4()) {
-      s_hasIpv4 = true;
-    }
-    else if (i.endpoint().address().is_v6()) {
-      s_hasIpv6 = true;
+  if (!ec) {
+    for (const auto& i : results) {
+      if (i.endpoint().address().is_v4()) {
+        s_hasIpv4 = true;
+      }
+      else if (i.endpoint().address().is_v6()) {
+        s_hasIpv6 = true;
+      }
     }
   }
-
   s_isInitialized = true;
 }
 
diff --git a/tests/unit/net/network-monitor.t.cpp b/tests/unit/net/network-monitor.t.cpp
index 4515258..50c04c7 100644
--- a/tests/unit/net/network-monitor.t.cpp
+++ b/tests/unit/net/network-monitor.t.cpp
@@ -23,7 +23,8 @@
 
 #include "tests/boost-test.hpp"
 
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/io_context.hpp>
+#include <boost/asio/post.hpp>
 
 namespace ndn::tests {
 
@@ -42,7 +43,7 @@
 
 BOOST_AUTO_TEST_CASE(DestructWithoutRun)
 {
-  boost::asio::io_service io;
+  boost::asio::io_context io;
   auto nm = make_unique<NetworkMonitor>(io);
   nm.reset();
   BOOST_CHECK(true); // if we got this far, the test passed
@@ -50,16 +51,16 @@
 
 BOOST_AUTO_TEST_CASE(DestructWhileEnumerating)
 {
-  boost::asio::io_service io;
+  boost::asio::io_context io;
   auto nm = make_unique<NetworkMonitor>(io);
   NM_REQUIRE_CAP(ENUM);
 
   nm->onInterfaceAdded.connect([&] (const shared_ptr<const NetworkInterface>&) {
-    io.post([&] { nm.reset(); });
+    boost::asio::post(io, [&] { nm.reset(); });
   });
   nm->onEnumerationCompleted.connect([&] {
     // make sure the test case terminates even if we have zero interfaces
-    io.post([&] { nm.reset(); });
+    boost::asio::post(io, [&] { nm.reset(); });
   });
 
   io.run();
diff --git a/tests/unit/security/validator-fixture.cpp b/tests/unit/security/validator-fixture.cpp
index 41497bf..ff198a3 100644
--- a/tests/unit/security/validator-fixture.cpp
+++ b/tests/unit/security/validator-fixture.cpp
@@ -24,6 +24,8 @@
 #include "ndn-cxx/security/additional-description.hpp"
 #include "ndn-cxx/util/signal/scoped-connection.hpp"
 
+#include <boost/asio/post.hpp>
+
 namespace ndn::tests {
 
 using namespace ndn::security;
@@ -47,7 +49,7 @@
 {
   signal::ScopedConnection conn = face.onSendInterest.connect([this] (const Interest& interest) {
     if (processInterest) {
-      m_io.post([=] { processInterest(interest); });
+      boost::asio::post(m_io, [=] { processInterest(interest); });
     }
   });
   advanceClocks(s_mockPeriod, s_mockTimes);
@@ -69,8 +71,7 @@
                .appendVersion());
 
   SignatureInfo info;
-  auto now = time::system_clock::now();
-  info.setValidityPeriod(ValidityPeriod(now, now + 90_days));
+  info.setValidityPeriod(ValidityPeriod::makeRelative(0_s, 90_days));
 
   AdditionalDescription description;
   description.set("type", "sub-certificate");
diff --git a/tests/unit/security/validator-null.t.cpp b/tests/unit/security/validator-null.t.cpp
index ebae900..05dd270 100644
--- a/tests/unit/security/validator-null.t.cpp
+++ b/tests/unit/security/validator-null.t.cpp
@@ -39,8 +39,8 @@
 
   ValidatorNull validator;
   validator.validate(data,
-                     std::bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
-                     std::bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+                     [] (auto&&...) { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); },
+                     [] (auto&&...) { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); });
 }
 
 BOOST_AUTO_TEST_CASE(ValidateInterest)
@@ -51,8 +51,8 @@
 
   ValidatorNull validator;
   validator.validate(interest,
-                     std::bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
-                     std::bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+                     [] (auto&&...) { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); },
+                     [] (auto&&...) { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); });
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestValidatorNull
diff --git a/tests/unit/util/regex.t.cpp b/tests/unit/util/regex.t.cpp
index d09688e..07ec293 100644
--- a/tests/unit/util/regex.t.cpp
+++ b/tests/unit/util/regex.t.cpp
@@ -279,7 +279,7 @@
 {
   auto backRef = make_shared<RegexBackrefManager>();
   auto cm = make_shared<RegexBackrefMatcher>("(<a><b>)", backRef);
-  backRef->pushRef(static_pointer_cast<RegexMatcher>(cm));
+  backRef->pushRef(std::static_pointer_cast<RegexMatcher>(cm));
   cm->compile();
   bool res = cm->match(Name("/a/b/c"), 0, 2);
   BOOST_CHECK_EQUAL(res, true);
diff --git a/tests/unit/util/scheduler.t.cpp b/tests/unit/util/scheduler.t.cpp
index e5c99e5..88c4313 100644
--- a/tests/unit/util/scheduler.t.cpp
+++ b/tests/unit/util/scheduler.t.cpp
@@ -51,23 +51,31 @@
     BOOST_CHECK_EQUAL(count2, 1);
   });
 
-  EventId i = scheduler.schedule(1_s, [] { BOOST_ERROR("This event should not have been fired"); });
-  i.cancel();
+  EventId eid = scheduler.schedule(1_s, [] { BOOST_ERROR("This event should not have been fired"); });
+  eid.cancel();
 
   scheduler.schedule(250_ms, [&] {
     BOOST_CHECK_EQUAL(count1, 0);
     ++count2;
   });
 
-  i = scheduler.schedule(50_ms, [&] { BOOST_ERROR("This event should not have been fired"); });
-  i.cancel();
+  eid = scheduler.schedule(50_ms, [&] { BOOST_ERROR("This event should not have been fired"); });
+  eid.cancel();
 
   advanceClocks(25_ms, 1000_ms);
   BOOST_CHECK_EQUAL(count1, 1);
   BOOST_CHECK_EQUAL(count2, 1);
 }
 
-BOOST_AUTO_TEST_CASE(CallbackException)
+BOOST_AUTO_TEST_CASE(NegativeDelay)
+{
+  bool wasCallbackInvoked = false;
+  scheduler.schedule(-1_s, [&] { wasCallbackInvoked = true; });
+  advanceClocks(1_ns);
+  BOOST_CHECK(wasCallbackInvoked);
+}
+
+BOOST_AUTO_TEST_CASE(ThrowingCallback)
 {
   class MyException : public std::exception
   {
@@ -79,12 +87,12 @@
     throw MyException{};
   });
 
-  bool isCallbackInvoked = false;
-  scheduler.schedule(20_ms, [&isCallbackInvoked] { isCallbackInvoked = true; });
+  bool wasCallbackInvoked = false;
+  scheduler.schedule(20_ms, [&] { wasCallbackInvoked = true; });
 
   BOOST_CHECK_THROW(this->advanceClocks(6_ms, 2), MyException);
   this->advanceClocks(6_ms, 2);
-  BOOST_CHECK(isCallbackInvoked);
+  BOOST_CHECK(wasCallbackInvoked);
 }
 
 BOOST_AUTO_TEST_CASE(CancelEmptyEvent)
@@ -100,7 +108,7 @@
 {
   EventId selfEventId;
   selfEventId = scheduler.schedule(100_ms, [&] { selfEventId.cancel(); });
-  BOOST_REQUIRE_NO_THROW(advanceClocks(100_ms, 10));
+  BOOST_CHECK_NO_THROW(advanceClocks(100_ms, 10));
 }
 
 class SelfRescheduleFixture : public SchedulerFixture
@@ -143,7 +151,7 @@
     scheduler.schedule(100_ms, [&] { ++count; });
   }
 
-public:
+protected:
   EventId selfEventId;
   size_t count = 0;
 };
@@ -151,21 +159,21 @@
 BOOST_FIXTURE_TEST_CASE(Reschedule, SelfRescheduleFixture)
 {
   selfEventId = scheduler.schedule(0_s, [this] { reschedule(); });
-  BOOST_REQUIRE_NO_THROW(advanceClocks(50_ms, 1000_ms));
+  advanceClocks(50_ms, 1000_ms);
   BOOST_CHECK_EQUAL(count, 5);
 }
 
 BOOST_FIXTURE_TEST_CASE(Reschedule2, SelfRescheduleFixture)
 {
   selfEventId = scheduler.schedule(0_s, [this] { reschedule2(); });
-  BOOST_REQUIRE_NO_THROW(advanceClocks(50_ms, 1000_ms));
+  advanceClocks(50_ms, 1000_ms);
   BOOST_CHECK_EQUAL(count, 5);
 }
 
 BOOST_FIXTURE_TEST_CASE(Reschedule3, SelfRescheduleFixture)
 {
   selfEventId = scheduler.schedule(0_s, [this] { reschedule3(); });
-  BOOST_REQUIRE_NO_THROW(advanceClocks(50_ms, 1000_ms));
+  advanceClocks(50_ms, 1000_ms);
   BOOST_CHECK_EQUAL(count, 6);
 }
 
