diff --git a/tests/unit-tests/test-interest-table.cpp b/tests/unit-tests/test-interest-table.cpp
index 9e98c0b..655762e 100644
--- a/tests/unit-tests/test-interest-table.cpp
+++ b/tests/unit-tests/test-interest-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012-2019 University of California, Los Angeles
+ * Copyright (c) 2012-2022 University of California, Los Angeles
  *
  * This file is part of ChronoSync, synchronization library for distributed realtime
  * applications for NDN.
@@ -32,24 +32,24 @@
 public:
   InterestTableFixture()
   {
-    uint8_t origin[4] = {0x01, 0x02, 0x03, 0x04};
+    const uint8_t origin[] = {0x01, 0x02, 0x03, 0x04};
     Name prefix("/test/prefix");
 
     Name interestName1;
-    digest1 = ndn::util::Sha256::computeDigest(origin, 1);
+    digest1 = ndn::util::Sha256::computeDigest({origin, 1});
     interestName1.append(prefix).append(name::Component(digest1));
 
     interest1 = Interest(interestName1);
     interest1.setInterestLifetime(time::milliseconds(100));
 
     Name interestName2;
-    digest2 = ndn::util::Sha256::computeDigest(origin, 2);
+    digest2 = ndn::util::Sha256::computeDigest({origin, 2});
     interestName2.append(prefix).append(name::Component(digest2));
     interest2 = Interest(interestName2);
     interest2.setInterestLifetime(time::milliseconds(100));
 
     Name interestName3;
-    digest3 = ndn::util::Sha256::computeDigest(origin, 3);
+    digest3 = ndn::util::Sha256::computeDigest({origin, 3});
     interestName3.append(prefix).append(name::Component(digest3));
     interest3 = Interest(interestName3);
     interest3.setInterestLifetime(time::milliseconds(100));
diff --git a/tests/unit-tests/test-leaf.cpp b/tests/unit-tests/test-leaf.cpp
index 71ea8f1..bc284b1 100644
--- a/tests/unit-tests/test-leaf.cpp
+++ b/tests/unit-tests/test-leaf.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012-2019 University of California, Los Angeles
+ * Copyright (c) 2012-2022 University of California, Los Angeles
  *
  * This file is part of ChronoSync, synchronization library for distributed realtime
  * applications for NDN.
@@ -54,10 +54,7 @@
   Name userPrefix("/test/name");
   Leaf leaf(userPrefix, 1, 10);
 
-  BOOST_CHECK_NO_THROW(leaf.getDigest());
-
-  ndn::ConstBufferPtr digest = leaf.getDigest();
-  BOOST_CHECK_EQUAL(result, ndn::toHex(digest->data(), digest->size(), false));
+  BOOST_CHECK_EQUAL(result, ndn::toHex(*leaf.getDigest(), false));
 }
 
 BOOST_AUTO_TEST_CASE(Container)
diff --git a/tests/unit-tests/test-logic.cpp b/tests/unit-tests/test-logic.cpp
index 8cb0baf..8459158 100644
--- a/tests/unit-tests/test-logic.cpp
+++ b/tests/unit-tests/test-logic.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012-2021 University of California, Los Angeles
+ * Copyright (c) 2012-2022 University of California, Los Angeles
  *
  * This file is part of ChronoSync, synchronization library for distributed realtime
  * applications for NDN.
@@ -29,17 +29,11 @@
 namespace chronosync {
 namespace test {
 
-using ndn::chronosync::DummyForwarder;
-
 class Handler
 {
 public:
-  Handler(ndn::Face& face,
-          const Name& syncPrefix,
-          const Name& userPrefix)
-    : logic(face,
-            syncPrefix,
-            userPrefix,
+  Handler(ndn::Face& face, const Name& syncPrefix, const Name& userPrefix)
+    : logic(face, syncPrefix, userPrefix,
             bind(&Handler::onUpdate, this, _1))
   {
   }
@@ -87,7 +81,7 @@
   Name syncPrefix;
   Name userPrefix[4];
 
-  DummyForwarder fw;
+  ndn::chronosync::DummyForwarder fw;
   // std::unique_ptr<DummyClientFace> faces[4];
   shared_ptr<Handler> handler[4];
 
@@ -98,7 +92,7 @@
 BOOST_FIXTURE_TEST_SUITE(LogicTests, LogicFixture)
 
 static void
-onUpdate(const std::vector<MissingDataInfo>& v)
+onUpdate(const std::vector<MissingDataInfo>&)
 {
 }
 
@@ -407,7 +401,7 @@
   Logic logic(face, syncPrefix, userPrefix, bind(onUpdate, _1));
 
   State state;
-  for (size_t i = 0; i < 50000 && bzip2::compress(reinterpret_cast<const char*>(state.wireEncode().wire()),
+  for (size_t i = 0; i < 50000 && bzip2::compress(reinterpret_cast<const char*>(state.wireEncode().data()),
                                                   state.wireEncode().size())->size() < ndn::MAX_NDN_PACKET_SIZE;
        i += 10) {
     Name prefix("/to/trim");
diff --git a/tests/unit-tests/test-state.cpp b/tests/unit-tests/test-state.cpp
index 850f8da..a302f01 100644
--- a/tests/unit-tests/test-state.cpp
+++ b/tests/unit-tests/test-state.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012-2019 University of California, Los Angeles
+ * Copyright (c) 2012-2022 University of California, Los Angeles
  *
  * This file is part of ChronoSync, synchronization library for distributed realtime
  * applications for NDN.
@@ -148,17 +148,16 @@
           0x04
   };
 
-  Block block(wire, sizeof(wire));
+  Block block(wire);
   State state;
   BOOST_REQUIRE_NO_THROW(state.wireDecode(block));
 
   BOOST_CHECK_EQUAL(state.getLeaves().size(), 2);
-  LeafContainer::index<ordered>::type::iterator it = state.getLeaves().get<ordered>().begin();
+  auto it = state.getLeaves().get<ordered>().begin();
   BOOST_CHECK_EQUAL((*it)->getSeq(), 14);
   it++;
   BOOST_CHECK_EQUAL((*it)->getSeq(), 4);
 
-
   State state2;
 
   Name info1("/test/name");
@@ -169,15 +168,9 @@
   info2.appendNumber(1);
   state2.update(info2, 4);
 
-  BOOST_REQUIRE_NO_THROW(state2.wireEncode());
   Block block2 = state2.wireEncode();
-
-  BOOST_CHECK_EQUAL_COLLECTIONS(block.wire(),
-                                block.wire() + block.size(),
-                                block2.wire(),
-                                block2.wire() + block2.size());
-
-  BOOST_CHECK(*state.getRootDigest() == *state2.getRootDigest());
+  BOOST_TEST(block == block2, boost::test_tools::per_element());
+  BOOST_TEST(*state.getRootDigest() == *state2.getRootDigest(), boost::test_tools::per_element());
 }
 
 BOOST_AUTO_TEST_CASE(Combine)
@@ -208,7 +201,7 @@
   BOOST_CHECK_EQUAL(state1.getLeaves().size(), 2);
   BOOST_CHECK_EQUAL(state2.getLeaves().size(), 3);
 
-  LeafContainer::index<ordered>::type::iterator it = state2.getLeaves().get<ordered>().begin();
+  auto it = state2.getLeaves().get<ordered>().begin();
   BOOST_CHECK_EQUAL((*it)->getSeq(), 4);
   it++;
   BOOST_CHECK_EQUAL((*it)->getSeq(), 15);
