diff --git a/tests/daemon/face/ethernet-factory.t.cpp b/tests/daemon/face/ethernet-factory.t.cpp
index b6d2516..0ee4562 100644
--- a/tests/daemon/face/ethernet-factory.t.cpp
+++ b/tests/daemon/face/ethernet-factory.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -49,22 +49,20 @@
   {
     std::set<std::string> uris;
     std::transform(netifs.begin(), netifs.end(), std::inserter(uris, uris.end()),
-                   [] (const auto& netif) {
-                     return FaceUri::fromDev(netif->getName()).toString();
-                   });
+                   [] (const auto& netif) { return FaceUri::fromDev(netif->getName()).toString(); });
     return uris;
   }
 
   std::vector<const Face*>
   listEtherMcastFaces(ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS) const
   {
-    return this->listFacesByScheme("ether", linkType);
+    return listFacesByScheme("ether", linkType);
   }
 
   size_t
   countEtherMcastFaces(ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS) const
   {
-    return this->listEtherMcastFaces(linkType).size();
+    return listEtherMcastFaces(linkType).size();
   }
 };
 
@@ -303,10 +301,9 @@
   auto etherMcastFaces = this->listEtherMcastFaces();
   BOOST_CHECK_EQUAL(etherMcastFaces.size(), netifs.size() - 1);
   BOOST_CHECK(std::none_of(etherMcastFaces.begin(), etherMcastFaces.end(),
-    [ifname] (const nfd::Face* face) {
-      return face->getLocalUri() == FaceUri::fromDev(ifname);
-    }
-  ));
+                           [uri = FaceUri::fromDev(ifname)] (const auto* face) {
+                             return face->getLocalUri() == uri;
+                           }));
 }
 
 BOOST_AUTO_TEST_CASE(Omitted)
@@ -438,6 +435,7 @@
 BOOST_AUTO_TEST_CASE(GetChannels)
 {
   BOOST_CHECK_EQUAL(factory.getChannels().empty(), true);
+
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
 
   factory.createChannel(netifs.front(), 1_min);
diff --git a/tests/daemon/face/ethernet-fixture.hpp b/tests/daemon/face/ethernet-fixture.hpp
index dfd5615..45ce00d 100644
--- a/tests/daemon/face/ethernet-fixture.hpp
+++ b/tests/daemon/face/ethernet-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -27,17 +27,12 @@
 #define NFD_TESTS_DAEMON_FACE_ETHERNET_FIXTURE_HPP
 
 #include "face/multicast-ethernet-transport.hpp"
-#include "face/unicast-ethernet-transport.hpp"
 
-#include "tests/daemon/limited-io.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
 #include "test-netif.hpp"
 
 namespace nfd::tests {
 
-using face::EthernetTransport;
-using face::MulticastEthernetTransport;
-using face::UnicastEthernetTransport;
-
 /**
  * \brief Fixture providing a list of EthernetTransport-capable network interfaces.
  */
@@ -47,79 +42,25 @@
   EthernetFixture()
   {
     for (const auto& netif : collectNetworkInterfaces()) {
-      if (!netif->isLoopback() && netif->isUp()) {
+      // similar filtering logic to EthernetFactory::applyMcastConfigToNetif()
+      if (netif->isUp() && !netif->isLoopback() && netif->canMulticast()) {
         try {
-          MulticastEthernetTransport t(*netif, ethernet::getBroadcastAddress(),
-                                       ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+          face::MulticastEthernetTransport t(*netif, ethernet::getBroadcastAddress(),
+                                             ndn::nfd::LINK_TYPE_MULTI_ACCESS);
           netifs.push_back(netif);
         }
-        catch (const EthernetTransport::Error&) {
+        catch (const face::EthernetTransport::Error&) {
           // ignore
         }
       }
     }
-    if (!netifs.empty()) {
-      defaultNetif = const_pointer_cast<ndn::net::NetworkInterface>(netifs.front());
-    }
-  }
-
-  /** \brief Returns the first running interface.
-   */
-  shared_ptr<ndn::net::NetworkInterface>
-  getRunningNetif() const
-  {
-    for (const auto& netif : netifs) {
-      if (netif->getState() == ndn::net::InterfaceState::RUNNING) {
-        return const_pointer_cast<ndn::net::NetworkInterface>(netif);
-      }
-    }
-
-    return nullptr;
-  }
-
-  /** \brief Create a UnicastEthernetTransport.
-   */
-  void
-  initializeUnicast(shared_ptr<ndn::net::NetworkInterface> netif = nullptr,
-                    ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-                    ethernet::Address remoteAddr = {0x00, 0x00, 0x5e, 0x00, 0x53, 0x5e})
-  {
-    if (!netif) {
-      netif = defaultNetif;
-    }
-
-    localEp = netif->getName();
-    remoteEp = remoteAddr;
-    transport = make_unique<UnicastEthernetTransport>(*netif, remoteEp, persistency, 2_s);
-  }
-
-  /** \brief Create a MulticastEthernetTransport.
-   */
-  void
-  initializeMulticast(shared_ptr<ndn::net::NetworkInterface> netif = nullptr,
-                      ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS,
-                      ethernet::Address mcastGroup = {0x01, 0x00, 0x5e, 0x90, 0x10, 0x5e})
-  {
-    if (!netif) {
-      netif = defaultNetif;
-    }
-
-    localEp = netif->getName();
-    remoteEp = mcastGroup;
-    transport = make_unique<MulticastEthernetTransport>(*netif, remoteEp, linkType);
   }
 
 protected:
-  LimitedIo limitedIo;
-
-  /** \brief EthernetTransport-capable network interfaces.
+  /**
+   * \brief EthernetTransport-capable network interfaces.
    */
   std::vector<shared_ptr<const ndn::net::NetworkInterface>> netifs;
-
-  shared_ptr<ndn::net::NetworkInterface> defaultNetif;
-  unique_ptr<EthernetTransport> transport;
-  std::string localEp;
-  ethernet::Address remoteEp;
 };
 
 } // namespace nfd::tests
@@ -133,13 +74,4 @@
     } \
   } while (false)
 
-#define SKIP_IF_NO_RUNNING_ETHERNET_NETIF() \
-  do { \
-    if (!this->getRunningNetif()) { \
-      BOOST_WARN_MESSAGE(false, "skipping assertions that require a running " \
-                                "EthernetTransport-capable network interface"); \
-      return; \
-    } \
-  } while (false)
-
 #endif // NFD_TESTS_DAEMON_FACE_ETHERNET_FIXTURE_HPP
diff --git a/tests/daemon/face/ethernet-transport-fixture.hpp b/tests/daemon/face/ethernet-transport-fixture.hpp
new file mode 100644
index 0000000..ab73795
--- /dev/null
+++ b/tests/daemon/face/ethernet-transport-fixture.hpp
@@ -0,0 +1,115 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2023,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_TESTS_DAEMON_FACE_ETHERNET_TRANSPORT_FIXTURE_HPP
+#define NFD_TESTS_DAEMON_FACE_ETHERNET_TRANSPORT_FIXTURE_HPP
+
+#include "face/multicast-ethernet-transport.hpp"
+#include "face/unicast-ethernet-transport.hpp"
+
+#include "tests/daemon/limited-io.hpp"
+#include "ethernet-fixture.hpp"
+
+namespace nfd::tests {
+
+class EthernetTransportFixture : public EthernetFixture
+{
+protected:
+  EthernetTransportFixture()
+  {
+    if (!netifs.empty()) {
+      defaultNetif = const_pointer_cast<ndn::net::NetworkInterface>(netifs.front());
+    }
+  }
+
+  /**
+   * \brief Returns the first running interface.
+   */
+  shared_ptr<ndn::net::NetworkInterface>
+  getRunningNetif() const
+  {
+    for (const auto& netif : netifs) {
+      if (netif->getState() == ndn::net::InterfaceState::RUNNING) {
+        return const_pointer_cast<ndn::net::NetworkInterface>(netif);
+      }
+    }
+
+    return nullptr;
+  }
+
+  /**
+   * \brief Create a UnicastEthernetTransport.
+   */
+  void
+  initializeUnicast(shared_ptr<ndn::net::NetworkInterface> netif = nullptr,
+                    ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
+                    ethernet::Address remoteAddr = {0x00, 0x00, 0x5e, 0x00, 0x53, 0x5e})
+  {
+    if (!netif) {
+      netif = defaultNetif;
+    }
+
+    localEp = netif->getName();
+    remoteEp = remoteAddr;
+    transport = make_unique<face::UnicastEthernetTransport>(*netif, remoteEp, persistency, 2_s);
+  }
+
+  /**
+   * \brief Create a MulticastEthernetTransport.
+   */
+  void
+  initializeMulticast(shared_ptr<ndn::net::NetworkInterface> netif = nullptr,
+                      ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS,
+                      ethernet::Address mcastGroup = {0x01, 0x00, 0x5e, 0x90, 0x10, 0x5e})
+  {
+    if (!netif) {
+      netif = defaultNetif;
+    }
+
+    localEp = netif->getName();
+    remoteEp = mcastGroup;
+    transport = make_unique<face::MulticastEthernetTransport>(*netif, remoteEp, linkType);
+  }
+
+protected:
+  LimitedIo limitedIo;
+  shared_ptr<ndn::net::NetworkInterface> defaultNetif;
+  unique_ptr<face::EthernetTransport> transport;
+  std::string localEp;
+  ethernet::Address remoteEp;
+};
+
+} // namespace nfd::tests
+
+#define SKIP_IF_NO_RUNNING_ETHERNET_NETIF() \
+  do { \
+    if (!this->getRunningNetif()) { \
+      BOOST_WARN_MESSAGE(false, "skipping assertions that require a running " \
+                                "EthernetTransport-capable network interface"); \
+      return; \
+    } \
+  } while (false)
+
+#endif // NFD_TESTS_DAEMON_FACE_ETHERNET_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/multicast-ethernet-transport.t.cpp b/tests/daemon/face/multicast-ethernet-transport.t.cpp
index 2791ca7..2694e00 100644
--- a/tests/daemon/face/multicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/multicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -23,7 +23,7 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "ethernet-fixture.hpp"
+#include "ethernet-transport-fixture.hpp"
 
 #include "common/global.hpp"
 
@@ -34,7 +34,7 @@
 using namespace nfd::face;
 
 BOOST_AUTO_TEST_SUITE(Face)
-BOOST_FIXTURE_TEST_SUITE(TestMulticastEthernetTransport, EthernetFixture)
+BOOST_FIXTURE_TEST_SUITE(TestMulticastEthernetTransport, EthernetTransportFixture)
 
 BOOST_AUTO_TEST_CASE(StaticProperties)
 {
diff --git a/tests/daemon/face/transport-test-common.hpp b/tests/daemon/face/transport-test-common.hpp
index c257a04..4a90c77 100644
--- a/tests/daemon/face/transport-test-common.hpp
+++ b/tests/daemon/face/transport-test-common.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,25 +32,27 @@
 
 namespace nfd::tests {
 
-/** \brief Check that a transport has all its static properties set after initialization
+/**
+ * \brief Check that a transport has all its static properties set after initialization.
  *
- *  This check shall be inserted to the StaticProperties test case for each transport,
- *  in addition to checking the values of properties.
- *  When a new static property is defined, this test case shall be updated.
- *  Thus, if a transport forgets to set a static property, this check would fail.
+ * This check shall be inserted to the StaticProperties test case for each transport,
+ * in addition to checking the values of properties.
+ * When a new static property is defined, this test case shall be updated.
+ * Thus, if a transport forgets to set a static property, this check would fail.
  */
 inline void
 checkStaticPropertiesInitialized(const face::Transport& transport)
 {
-  BOOST_CHECK(!transport.getLocalUri().getScheme().empty());
-  BOOST_CHECK(!transport.getRemoteUri().getScheme().empty());
-  BOOST_CHECK_NE(transport.getScope(), ndn::nfd::FACE_SCOPE_NONE);
-  BOOST_CHECK_NE(transport.getPersistency(), ndn::nfd::FACE_PERSISTENCY_NONE);
-  BOOST_CHECK_NE(transport.getLinkType(), ndn::nfd::LINK_TYPE_NONE);
-  BOOST_CHECK_NE(transport.getMtu(), face::MTU_INVALID);
+  BOOST_TEST(transport.getLocalUri().getScheme().empty() == false);
+  BOOST_TEST(transport.getRemoteUri().getScheme().empty() == false);
+  BOOST_TEST(transport.getScope() != ndn::nfd::FACE_SCOPE_NONE);
+  BOOST_TEST(transport.getPersistency() != ndn::nfd::FACE_PERSISTENCY_NONE);
+  BOOST_TEST(transport.getLinkType() != ndn::nfd::LINK_TYPE_NONE);
+  BOOST_TEST(transport.getMtu() != face::MTU_INVALID);
 }
 
-/** \brief Generic wrapper for transport fixtures that require an IP address
+/**
+ * \brief Generic wrapper for transport fixtures that require an IP address.
  */
 template<typename TransportFixtureBase,
          AddressFamily AF = AddressFamily::Any,
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index e3e427c..d405e68 100644
--- a/tests/daemon/face/transport.t.cpp
+++ b/tests/daemon/face/transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -145,7 +145,7 @@
 
   auto from = static_cast<TransportState>(T::first::value);
   auto to = static_cast<TransportState>(T::second::value);
-  BOOST_TEST_MESSAGE("SetState " << from << " -> " << to);
+  BOOST_TEST_INFO_SCOPE(from << " -> " << to);
 
   // enter from state
   using Steps = typename mpl::at<StateEntering, mpl::int_<T::first::value>>::type;
@@ -155,12 +155,11 @@
   BOOST_REQUIRE_EQUAL(transport->getState(), from);
 
   bool hasSignal = false;
-  transport->afterStateChange.connect(
-    [from, to, &hasSignal] (TransportState oldState, TransportState newState) {
-      hasSignal = true;
-      BOOST_CHECK_EQUAL(oldState, from);
-      BOOST_CHECK_EQUAL(newState, to);
-    });
+  transport->afterStateChange.connect([&] (TransportState oldState, TransportState newState) {
+    hasSignal = true;
+    BOOST_CHECK_EQUAL(oldState, from);
+    BOOST_CHECK_EQUAL(newState, to);
+  });
 
   // do transition
   bool isValid = from == to ||
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index 106ba0b..fd83656 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -69,7 +69,7 @@
         }
       }
     }
-    this->copyRealNetifsToNetmon();
+    copyRealNetifsToNetmon();
   }
 
   shared_ptr<Face>
@@ -106,16 +106,17 @@
   std::vector<const Face*>
   listUdp4McastFaces(ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS) const
   {
-    return this->listFacesByScheme("udp4", linkType);
+    return listFacesByScheme("udp4", linkType);
   }
 
   std::vector<const Face*>
   listUdp6McastFaces(ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_MULTI_ACCESS) const
   {
-    return this->listFacesByScheme("udp6", linkType);
+    return listFacesByScheme("udp6", linkType);
   }
 
-  /** \brief Determine whether \p netif has at least one IP address of the given family.
+  /**
+   * \brief Determine whether \p netif has at least one IP address of the given family.
    */
   static bool
   hasAddressFamily(const NetworkInterface& netif, ndn::net::AddressFamily af)
@@ -124,7 +125,8 @@
                        [af] (const auto& a) { return a.getFamily() == af; });
   }
 
-  /** \brief Determine whether a UDP multicast face is created on \p netif.
+  /**
+   * \brief Determine whether a UDP multicast face is created on \p netif.
    */
   static bool
   isFaceOnNetif(const Face& face, const NetworkInterface& netif)
diff --git a/tests/daemon/face/unicast-ethernet-transport.t.cpp b/tests/daemon/face/unicast-ethernet-transport.t.cpp
index 373bcc3..83e4b54 100644
--- a/tests/daemon/face/unicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/unicast-ethernet-transport.t.cpp
@@ -23,7 +23,7 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "ethernet-fixture.hpp"
+#include "ethernet-transport-fixture.hpp"
 
 #include "common/global.hpp"
 
@@ -34,7 +34,7 @@
 using namespace nfd::face;
 
 BOOST_AUTO_TEST_SUITE(Face)
-BOOST_FIXTURE_TEST_SUITE(TestUnicastEthernetTransport, EthernetFixture)
+BOOST_FIXTURE_TEST_SUITE(TestUnicastEthernetTransport, EthernetTransportFixture)
 
 BOOST_AUTO_TEST_CASE(StaticProperties)
 {
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index a853c79..ff8ed50 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -541,17 +541,16 @@
   FaceTable faceTable;
   Forwarder forwarder{faceTable};
 
-  auto checkValidity = [&] (const std::string& parameters, bool isCorrect) {
-    Name strategyName(Name(AsfStrategy::getStrategyName()).append(parameters));
+  auto checkValidity = [&] (std::string_view parameters, bool isCorrect) {
+    BOOST_TEST_INFO_SCOPE(parameters);
+    Name strategyName(Name(AsfStrategy::getStrategyName()).append(Name(parameters)));
     std::unique_ptr<AsfStrategy> strategy;
-    BOOST_TEST_CONTEXT(parameters) {
-      if (isCorrect) {
-        strategy = make_unique<AsfStrategy>(forwarder, strategyName);
-        BOOST_CHECK(strategy->m_retxSuppression != nullptr);
-      }
-      else {
-        BOOST_CHECK_THROW(make_unique<AsfStrategy>(forwarder, strategyName), std::invalid_argument);
-      }
+    if (isCorrect) {
+      strategy = make_unique<AsfStrategy>(forwarder, strategyName);
+      BOOST_CHECK(strategy->m_retxSuppression != nullptr);
+    }
+    else {
+      BOOST_CHECK_THROW(make_unique<AsfStrategy>(forwarder, strategyName), std::invalid_argument);
     }
     return strategy;
   };
diff --git a/tests/daemon/fw/strategy-instantiation.t.cpp b/tests/daemon/fw/strategy-instantiation.t.cpp
index 12c13a1..0ac730c 100644
--- a/tests/daemon/fw/strategy-instantiation.t.cpp
+++ b/tests/daemon/fw/strategy-instantiation.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -125,18 +125,17 @@
 {
 public:
   std::unique_ptr<S>
-  checkValidity(const std::string& parameters, bool isCorrect)
+  checkValidity(std::string_view parameters, bool isCorrect)
   {
-    Name strategyName(Name(S::getStrategyName()).append(parameters));
+    BOOST_TEST_INFO_SCOPE(parameters);
+    Name strategyName(Name(S::getStrategyName()).append(Name(parameters)));
     std::unique_ptr<S> strategy;
-    BOOST_TEST_CONTEXT(parameters) {
-      if (isCorrect) {
-        strategy = make_unique<S>(m_forwarder, strategyName);
-        BOOST_CHECK(strategy->m_retxSuppression != nullptr);
-      }
-      else {
-        BOOST_CHECK_THROW(make_unique<S>(m_forwarder, strategyName), std::invalid_argument);
-      }
+    if (isCorrect) {
+      strategy = make_unique<S>(m_forwarder, strategyName);
+      BOOST_CHECK(strategy->m_retxSuppression != nullptr);
+    }
+    else {
+      BOOST_CHECK_THROW(make_unique<S>(m_forwarder, strategyName), std::invalid_argument);
     }
     return strategy;
   }
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 140b1c6..d73dc24 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -60,8 +60,9 @@
     RANDOMIZE_COUNTERS       = 1 << 3,
   };
 
-  /** \brief Adds a face to the FaceTable.
-   *  \param options bitwise OR'ed AddFaceFlags
+  /**
+   * \brief Adds a face to the FaceTable.
+   * \param flags bitwise OR'ed AddFaceFlags
    */
   shared_ptr<Face>
   addFace(unsigned int flags = 0)
@@ -169,6 +170,7 @@
   std::set<FaceId> faceIds;
   for (size_t idx = 0; idx < nEntries; ++idx) {
     ndn::nfd::FaceStatus decodedStatus(content.elements()[idx]);
+    BOOST_TEST_INFO_SCOPE(decodedStatus);
     BOOST_CHECK(m_faceTable.get(decodedStatus.getFaceId()) != nullptr);
     faceIds.insert(decodedStatus.getFaceId());
   }
@@ -330,6 +332,7 @@
 
   for (size_t idx = 0; idx < nEntries; ++idx) {
     ndn::nfd::ChannelStatus decodedStatus(content.elements()[idx]);
+    BOOST_TEST_INFO_SCOPE(decodedStatus);
     BOOST_CHECK(addedChannels.find(decodedStatus.getLocalUri()) != addedChannels.end());
   }
 }
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 32bbec3..5da697b 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -421,6 +421,7 @@
   std::vector<ndn::nfd::FibEntry> receivedRecords, expectedRecords;
   for (size_t idx = 0; idx < nEntries; ++idx) {
     ndn::nfd::FibEntry decodedEntry(content.elements()[idx]);
+    BOOST_TEST_INFO_SCOPE(decodedEntry);
     receivedRecords.push_back(decodedEntry);
     actualPrefixes.erase(decodedEntry.getPrefix());
 
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 6c82d4a..83a0af2 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -71,14 +71,14 @@
     loadDefaultPaConfig();
   }
 
-  template<typename ...T>
+  template<typename... T>
   ndn::PrefixAnnouncement
   makeTrustedAnn(T&&... args)
   {
     return signPrefixAnn(makePrefixAnn(std::forward<T>(args)...), m_keyChain, m_trustedSigner);
   }
 
-  template<typename ...T>
+  template<typename... T>
   ndn::PrefixAnnouncement
   makeUntrustedAnn(T&&... args)
   {
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 0b407f6..417500e 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -486,6 +486,7 @@
   std::vector<ndn::nfd::RibEntry> receivedRecords, expectedRecords;
   for (size_t idx = 0; idx < nEntries; ++idx) {
     ndn::nfd::RibEntry decodedEntry(content.elements()[idx]);
+    BOOST_TEST_INFO_SCOPE(decodedEntry);
     receivedRecords.push_back(decodedEntry);
     actualPrefixes.erase(decodedEntry.getName());
 
diff --git a/tests/daemon/mgmt/strategy-choice-manager.t.cpp b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
index 71763bb..4a6e3df 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.t.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -218,14 +218,13 @@
 
   for (auto i = dataset.elements_begin(); i != dataset.elements_end(); ++i) {
     ndn::nfd::StrategyChoice record(*i);
+    BOOST_TEST_INFO_SCOPE(record);
     auto found = expected.find(record.getName());
     if (found == expected.end()) {
       BOOST_ERROR("record has unexpected namespace " << record.getName());
     }
     else {
-      BOOST_CHECK_MESSAGE(record.getStrategy() == found->second,
-        "record for " << record.getName() << " has wrong strategy " << record.getStrategy() <<
-        ", should be " << found->second);
+      BOOST_TEST(record.getStrategy() == found->second);
       expected.erase(found);
     }
   }
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 65b1280..073d88c 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -244,20 +244,21 @@
   BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(mABCD).getPrefix(), "/A/B/C");
 }
 
-void
+static void
 validateFindExactMatch(Fib& fib, const Name& target)
 {
+  BOOST_TEST_INFO_SCOPE(target);
   const Entry* entry = fib.findExactMatch(target);
-  BOOST_REQUIRE_MESSAGE(entry != nullptr, "No entry found for " << target);
+  BOOST_REQUIRE(entry != nullptr);
   BOOST_CHECK_EQUAL(entry->getPrefix(), target);
 }
 
-void
+static void
 validateNoExactMatch(Fib& fib, const Name& target)
 {
+  BOOST_TEST_INFO_SCOPE(target);
   const Entry* entry = fib.findExactMatch(target);
-  BOOST_CHECK_MESSAGE(entry == nullptr,
-                      "Found unexpected entry for " << target);
+  BOOST_CHECK(entry == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE(ExactMatch)
@@ -294,13 +295,12 @@
   validateNoExactMatch(fib, "/nothing/here");
 }
 
-void
+static void
 validateErase(Fib& fib, const Name& target)
 {
+  BOOST_TEST_INFO_SCOPE(target);
   fib.erase(target);
-
-  const Entry* entry = fib.findExactMatch(target);
-  BOOST_CHECK_MESSAGE(entry == nullptr, "Found \"removed\" entry for " << target);
+  BOOST_CHECK(fib.findExactMatch(target) == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE(Erase)
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index eed9846..f5feb86 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -173,7 +173,7 @@
    *  \param name dataset prefix without version and segment
    *  \param contentArgs passed to Data::setContent
    */
-  template<typename ...ContentArgs>
+  template<typename... ContentArgs>
   void
   sendDatasetReply(Name name, ContentArgs&&... contentArgs)
   {
@@ -220,8 +220,8 @@
   [&interest] { \
     auto params = parseCommand(interest, (expectedPrefix)); \
     BOOST_REQUIRE_MESSAGE(params.has_value(), "Interest " << interest.getName() << \
-                          " does not match command prefix " << (expectedPrefix)); \
+                          " must match the prefix " << (expectedPrefix)); \
     return *params; \
-  } ()
+  }()
 
 #endif // NFD_TESTS_TOOLS_MOCK_NFD_MGMT_FIXTURE_HPP
diff --git a/tests/tools/nfdc/rib-module.t.cpp b/tests/tools/nfdc/rib-module.t.cpp
index b50625d..f349dfd 100644
--- a/tests/tools/nfdc/rib-module.t.cpp
+++ b/tests/tools/nfdc/rib-module.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -457,8 +457,9 @@
     ndn::nfd::RibUnregisterCommand cmd;
     cmd.validateRequest(req);
     cmd.applyDefaultsToRequest(req);
+    BOOST_TEST_INFO_SCOPE("FaceId=" << req.getFaceId());
     BOOST_CHECK_EQUAL(req.getName(), "/nm5y8X8b2");
-    BOOST_CHECK_MESSAGE(faceIds.erase(req.getFaceId()), "expected face " + to_string(req.getFaceId()));
+    BOOST_CHECK(faceIds.erase(req.getFaceId()));
     BOOST_CHECK_EQUAL(req.getOrigin(), ndn::nfd::ROUTE_ORIGIN_STATIC);
 
     this->succeedCommand(interest, req);
