diff --git a/tests/unit/data.t.cpp b/tests/unit/data.t.cpp
index 6ee1708..2b59850 100644
--- a/tests/unit/data.t.cpp
+++ b/tests/unit/data.t.cpp
@@ -510,16 +510,14 @@
   d.setContent("1502CAFE"_block);
   BOOST_CHECK_EQUAL(d.hasContent(), true);
   BOOST_CHECK_EQUAL(d.getContent().type(), tlv::Content);
-  BOOST_CHECK_EQUAL_COLLECTIONS(d.getContent().value_begin(), d.getContent().value_end(),
-                                direct, direct + sizeof(direct));
+  BOOST_TEST(d.getContent().value_bytes() == direct, boost::test_tools::per_element());
 
   // Block overload, nested inside Content element
   const uint8_t nested[] = {0x99, 0x02, 0xca, 0xfe};
   d.setContent(Block(nested));
   BOOST_CHECK_EQUAL(d.hasContent(), true);
   BOOST_CHECK_EQUAL(d.getContent().type(), tlv::Content);
-  BOOST_CHECK_EQUAL_COLLECTIONS(d.getContent().value_begin(), d.getContent().value_end(),
-                                nested, nested + sizeof(nested));
+  BOOST_TEST(d.getContent().value_bytes() == nested, boost::test_tools::per_element());
 
   // Block overload, default constructed (invalid)
   BOOST_CHECK_THROW(d.setContent(Block{}), std::invalid_argument);
@@ -528,8 +526,7 @@
   d.setContent(nested);
   BOOST_CHECK_EQUAL(d.hasContent(), true);
   BOOST_CHECK_EQUAL(d.getContent().type(), tlv::Content);
-  BOOST_CHECK_EQUAL_COLLECTIONS(d.getContent().value_begin(), d.getContent().value_end(),
-                                nested, nested + sizeof(nested));
+  BOOST_TEST(d.getContent().value_bytes() == nested, boost::test_tools::per_element());
   d.setContent(span<uint8_t>{});
   BOOST_CHECK_EQUAL(d.hasContent(), true);
   BOOST_CHECK_EQUAL(d.getContent().type(), tlv::Content);
@@ -545,8 +542,7 @@
   d.setContent(std::make_shared<Buffer>(direct, sizeof(direct)));
   BOOST_CHECK_EQUAL(d.hasContent(), true);
   BOOST_CHECK_EQUAL(d.getContent().type(), tlv::Content);
-  BOOST_CHECK_EQUAL_COLLECTIONS(d.getContent().value_begin(), d.getContent().value_end(),
-                                direct, direct + sizeof(direct));
+  BOOST_TEST(d.getContent().value_bytes() == direct, boost::test_tools::per_element());
   d.setContent(std::make_shared<Buffer>());
   BOOST_CHECK_EQUAL(d.hasContent(), true);
   BOOST_CHECK_EQUAL(d.getContent().type(), tlv::Content);
@@ -565,11 +561,18 @@
   Data d;
   BOOST_CHECK_EQUAL(d.getSignatureValue().type(), tlv::Invalid);
 
-  d.setSignatureValue(fromHex("FACADE"));
+  // span overload
+  const uint8_t sv1[] = {0xbe, 0xef};
+  d.setSignatureValue(sv1);
   BOOST_CHECK_EQUAL(d.getSignatureValue().type(), tlv::SignatureValue);
-  BOOST_CHECK_EQUAL(d.getSignatureValue().value_size(), 3);
+  BOOST_TEST(d.getSignatureValue().value_bytes() == sv1, boost::test_tools::per_element());
 
-  d.setSignatureValue(std::make_shared<Buffer>()); // empty buffer
+  // ConstBufferPtr overload
+  const uint8_t sv2[] = {0xfa, 0xca, 0xde};
+  d.setSignatureValue(std::make_shared<Buffer>(sv2, sizeof(sv2)));
+  BOOST_CHECK_EQUAL(d.getSignatureValue().type(), tlv::SignatureValue);
+  BOOST_TEST(d.getSignatureValue().value_bytes() == sv2, boost::test_tools::per_element());
+  d.setSignatureValue(std::make_shared<Buffer>());
   BOOST_CHECK_EQUAL(d.getSignatureValue().type(), tlv::SignatureValue);
   BOOST_CHECK_EQUAL(d.getSignatureValue().value_size(), 0);
 
diff --git a/tests/unit/interest.t.cpp b/tests/unit/interest.t.cpp
index 95193ac..722a2d5 100644
--- a/tests/unit/interest.t.cpp
+++ b/tests/unit/interest.t.cpp
@@ -265,7 +265,7 @@
   i2.setNonce(0x4c1ecb4a);
   i2.setApplicationParameters("2404C0C1C2C3"_block);
   i2.setSignatureInfo(si);
-  i2.setSignatureValue(make_shared<Buffer>(sv.value_begin(), sv.value_end()));
+  i2.setSignatureValue(sv.value_bytes());
   BOOST_CHECK_EQUAL(i2.isParametersDigestValid(), true);
 
   BOOST_TEST(i2.wireEncode() == WIRE, boost::test_tools::per_element());
@@ -901,13 +901,15 @@
 BOOST_AUTO_TEST_CASE(SetSignature)
 {
   Interest i;
-  BOOST_CHECK(i.getSignatureInfo() == nullopt);
-  BOOST_CHECK_EQUAL(i.isSigned(), false);
 
-  // Throws because attempting to set InterestSignatureValue without set InterestSignatureInfo
   Block sv1("2E04 01020304"_block);
-  auto svBuffer1 = make_shared<Buffer>(sv1.value_begin(), sv1.value_end());
-  BOOST_CHECK_THROW(i.setSignatureValue(svBuffer1), tlv::Error);
+  BOOST_CHECK_EXCEPTION(i.setSignatureValue(sv1.value_bytes()), tlv::Error, [] (const auto& e) {
+    return e.what() == "InterestSignatureInfo must be present to set InterestSignatureValue"s;
+  });
+
+  BOOST_CHECK(i.getSignatureInfo() == nullopt);
+  BOOST_CHECK_EQUAL(i.getSignatureValue().isValid(), false);
+  BOOST_CHECK_EQUAL(i.isSigned(), false);
 
   // Simple set/get case for InterestSignatureInfo (no prior set)
   SignatureInfo si1(tlv::SignatureSha256WithEcdsa);
@@ -916,7 +918,7 @@
   BOOST_CHECK_EQUAL(i.isSigned(), false);
 
   // Simple set/get case for InterestSignatureValue (no prior set)
-  BOOST_CHECK_EQUAL(i.getSignatureValue().isValid(), false);
+  auto svBuffer1 = make_shared<Buffer>(sv1.value_begin(), sv1.value_end());
   i.setSignatureValue(svBuffer1);
   BOOST_CHECK_EQUAL(i.getSignatureValue(), sv1);
   BOOST_CHECK_EQUAL(i.isSigned(), true);
@@ -948,7 +950,7 @@
   // Ensure that wire is not reset if specified InterestSignatureValue is same
   i.wireEncode();
   BOOST_CHECK_EQUAL(i.hasWire(), true);
-  i.setSignatureValue(svBuffer1);
+  i.setSignatureValue(sv1.value_bytes());
   BOOST_CHECK_EQUAL(i.hasWire(), true);
   BOOST_CHECK(i.getSignatureInfo() == si2);
   BOOST_CHECK_EQUAL(i.getSignatureValue(), sv1);
@@ -957,12 +959,11 @@
   // Ensure that wire is reset if specified InterestSignatureValue is different
   i.wireEncode();
   BOOST_CHECK_EQUAL(i.hasWire(), true);
-  Block sv2("2E04 99887766"_block);
-  auto svBuffer2 = make_shared<Buffer>(sv2.value_begin(), sv2.value_end());
-  i.setSignatureValue(svBuffer2);
+  const uint8_t sv2[] = {0x99, 0x88, 0x77, 0x66};
+  i.setSignatureValue(sv2);
   BOOST_CHECK_EQUAL(i.hasWire(), false);
   BOOST_CHECK(i.getSignatureInfo() == si2);
-  BOOST_CHECK_EQUAL(i.getSignatureValue(), sv2);
+  BOOST_TEST(i.getSignatureValue().value_bytes() == sv2, boost::test_tools::per_element());
   BOOST_CHECK_EQUAL(i.isSigned(), true);
 }
 
@@ -1027,8 +1028,7 @@
   BOOST_CHECK(i.getSignatureInfo() == si);
 
   Block sv("2E04 01020304"_block);
-  i.setSignatureValue(make_shared<Buffer>(sv.value_begin(),
-                                          sv.value_end())); // updates ParametersDigestSha256Component
+  i.setSignatureValue(sv.value_bytes()); // updates ParametersDigestSha256Component
   BOOST_CHECK_EQUAL(i.getName(),
                     "/A/B/C/params-sha256=f649845ef944638390d1c689e2f0618ea02e471eff236110cbeb822d5932d342");
   BOOST_CHECK_EQUAL(i.isParametersDigestValid(), true);
@@ -1071,8 +1071,7 @@
                                 appParamsWire1->begin(), wire1.end());
 
   // Test with Interest with existing InterestSignatureValue
-  auto sigValue = make_shared<Buffer>();
-  i1.setSignatureValue(sigValue);
+  i1.setSignatureValue(std::make_shared<Buffer>());
   auto ranges2 = i1.extractSignedRanges();
   BOOST_REQUIRE_EQUAL(ranges2.size(), 2);
   const auto& wire2 = i1.wireEncode();
diff --git a/tests/unit/security/certificate.t.cpp b/tests/unit/security/certificate.t.cpp
index d0633f0..a9df438 100644
--- a/tests/unit/security/certificate.t.cpp
+++ b/tests/unit/security/certificate.t.cpp
@@ -129,12 +129,12 @@
 generateFakeSignature(Data& data)
 {
   SignatureInfo signatureInfo(Block{SIG_INFO});
-  signatureInfo.setKeyLocator(KeyLocator(Name("/ndn/site1/KEY/ksk-2516425377094")));
+  signatureInfo.setKeyLocator(Name("/ndn/site1/KEY/ksk-2516425377094"));
   signatureInfo.setValidityPeriod(ValidityPeriod(time::fromIsoString("20141111T050000"),
                                                  time::fromIsoString("20141111T060000")));
 
   data.setSignatureInfo(signatureInfo);
-  data.setSignatureValue(make_shared<Buffer>(SIG_VALUE, sizeof(SIG_VALUE)));
+  data.setSignatureValue(SIG_VALUE);
 }
 
 BOOST_AUTO_TEST_CASE(Construction)
