diff --git a/tests/unit-tests/data.t.cpp b/tests/unit-tests/data.t.cpp
index 262f2ac..ab9cee6 100644
--- a/tests/unit-tests/data.t.cpp
+++ b/tests/unit-tests/data.t.cpp
@@ -194,7 +194,7 @@
 
   b = SignatureSha256WithRsa();
   static const uint8_t someData[256] = {};
-  Block signatureValue = dataBlock(tlv::SignatureValue, someData, sizeof(someData));
+  Block signatureValue = makeBinaryBlock(tlv::SignatureValue, someData, sizeof(someData));
   b.setValue(signatureValue);
   BOOST_CHECK_EQUAL(a == b, false);
   BOOST_CHECK_EQUAL(a != b, true);
@@ -382,8 +382,7 @@
   Block signatureInfo(tlv::SignatureInfo);
   // SignatureType
   {
-    signatureInfo.push_back
-      (nonNegativeIntegerBlock(tlv::SignatureType, Signature::Sha256WithRsa));
+    signatureInfo.push_back(makeNonNegativeIntegerBlock(tlv::SignatureType, Signature::Sha256WithRsa));
   }
   // KeyLocator
   {
diff --git a/tests/unit-tests/encoding/block-helpers.t.cpp b/tests/unit-tests/encoding/block-helpers.t.cpp
new file mode 100644
index 0000000..01f0ddb
--- /dev/null
+++ b/tests/unit-tests/encoding/block-helpers.t.cpp
@@ -0,0 +1,93 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2015 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "encoding/block-helpers.hpp"
+
+#include "boost-test.hpp"
+#include "name.hpp"
+
+namespace ndn {
+namespace encoding {
+namespace tests {
+
+BOOST_AUTO_TEST_SUITE(EncodingBlockHelpers)
+
+BOOST_AUTO_TEST_CASE(NonNegativeInteger)
+{
+  Block b = makeNonNegativeIntegerBlock(100, 1000);
+  BOOST_CHECK_EQUAL(b.type(), 100);
+  BOOST_CHECK_GT(b.value_size(), 0);
+  BOOST_CHECK_EQUAL(readNonNegativeInteger(b), 1000);
+
+  BOOST_CHECK_THROW(readNonNegativeInteger(Block()), tlv::Error);
+}
+
+BOOST_AUTO_TEST_CASE(Empty)
+{
+  Block b = makeEmptyBlock(200);
+  BOOST_CHECK_EQUAL(b.type(), 200);
+  BOOST_CHECK_EQUAL(b.value_size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(String)
+{
+  Block b = makeStringBlock(100, "Hello, world!");
+  BOOST_CHECK_EQUAL(b.type(), 100);
+  BOOST_CHECK_GT(b.value_size(), 0);
+  BOOST_CHECK_EQUAL(readString(b), "Hello, world!");
+}
+
+BOOST_AUTO_TEST_CASE(Data)
+{
+  std::string buf1{1, 1, 1, 1};
+  const uint8_t buf2[]{1, 1, 1, 1};
+  std::list<uint8_t> buf3{1, 1, 1, 1};
+
+  Block b1 = makeBinaryBlock(100, buf1.data(), buf1.size());
+  Block b2 = makeBinaryBlock(100, buf2, sizeof(buf2));
+  Block b3 = makeBinaryBlock(100, buf1.begin(), buf1.end()); // fast encoding (random access iterator)
+  Block b4 = makeBinaryBlock(100, buf3.begin(), buf3.end()); // slow encoding (general iterator)
+
+  BOOST_CHECK(b1 == b2);
+  BOOST_CHECK(b1 == b3);
+  BOOST_CHECK_EQUAL(b1.type(), 100);
+  BOOST_CHECK_EQUAL(b1.value_size(), buf1.size());
+  BOOST_CHECK_EQUAL_COLLECTIONS(b1.value_begin(), b1.value_end(),
+                                buf2, buf2 + sizeof(buf2));
+}
+
+BOOST_AUTO_TEST_CASE(Nested)
+{
+  Name name("ndn:/Hello/World!");
+  Block b1 = makeNestedBlock(100, name);
+
+  BOOST_CHECK_EQUAL(b1.type(), 100);
+  b1.parse();
+  BOOST_CHECK_EQUAL(b1.elements().size(), 1);
+  BOOST_CHECK_EQUAL(b1.elements().begin()->type(), name.wireEncode().type());
+  BOOST_CHECK(*b1.elements().begin() == name.wireEncode());
+}
+
+BOOST_AUTO_TEST_SUITE_END() // EncodingBlockHelpers
+
+} // namespace tests
+} // namespace encoding
+} // namespace ndn
diff --git a/tests/unit-tests/key-locator.t.cpp b/tests/unit-tests/key-locator.t.cpp
index 671a362..94eb5a2 100644
--- a/tests/unit-tests/key-locator.t.cpp
+++ b/tests/unit-tests/key-locator.t.cpp
@@ -92,7 +92,7 @@
 {
   char digestOctets[] = "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD";
   ConstBufferPtr digestBuffer = make_shared<Buffer>(digestOctets, 8);
-  Block expectedDigestBlock = dataBlock(tlv::KeyDigest, digestOctets, 8);
+  Block expectedDigestBlock = makeBinaryBlock(tlv::KeyDigest, digestOctets, 8);
 
   KeyLocator a;
   a.setKeyDigest(digestBuffer);
diff --git a/tests/unit-tests/make-interest-data.hpp b/tests/unit-tests/make-interest-data.hpp
index 23fcc22..ca3bff5 100644
--- a/tests/unit-tests/make-interest-data.hpp
+++ b/tests/unit-tests/make-interest-data.hpp
@@ -44,8 +44,7 @@
 signData(const shared_ptr<Data>& data)
 {
   ndn::SignatureSha256WithRsa fakeSignature;
-  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
-                                        reinterpret_cast<const uint8_t*>(0), 0));
+  fakeSignature.setValue(makeEmptyBlock(tlv::SignatureValue));
   data->setSignature(fakeSignature);
   data->wireEncode();
 
diff --git a/tests/unit-tests/meta-info.t.cpp b/tests/unit-tests/meta-info.t.cpp
index 6c158a2..77bdd3e 100644
--- a/tests/unit-tests/meta-info.t.cpp
+++ b/tests/unit-tests/meta-info.t.cpp
@@ -122,18 +122,18 @@
 
   for (int i = 0; i < 5; i++) {
     uint32_t type = 128 + i * 10;
-    info1.addAppMetaInfo(nonNegativeIntegerBlock(type, ints[i]));
+    info1.addAppMetaInfo(makeNonNegativeIntegerBlock(type, ints[i]));
     const std::string& s = ss[i];
     type += 5;
-    info1.addAppMetaInfo(dataBlock(type, s.c_str(), s.size()));
+    info1.addAppMetaInfo(makeStringBlock(type, s));
   }
 
   BOOST_CHECK(info1.findAppMetaInfo(252) == 0);
 
-  info1.addAppMetaInfo(nonNegativeIntegerBlock(252, 1000));
+  info1.addAppMetaInfo(makeNonNegativeIntegerBlock(252, 1000));
   BOOST_CHECK(info1.findAppMetaInfo(252) != 0);
 
-  info1.addAppMetaInfo(nonNegativeIntegerBlock(252, 1000));
+  info1.addAppMetaInfo(makeNonNegativeIntegerBlock(252, 1000));
   BOOST_CHECK(info1.findAppMetaInfo(252) != 0);
 
   info1.removeAppMetaInfo(252);
@@ -187,11 +187,11 @@
 {
   MetaInfo info;
 
-  BOOST_CHECK_NO_THROW(info.addAppMetaInfo(nonNegativeIntegerBlock(128, 1000)));
-  BOOST_CHECK_NO_THROW(info.addAppMetaInfo(nonNegativeIntegerBlock(252, 1000)));
+  BOOST_CHECK_NO_THROW(info.addAppMetaInfo(makeNonNegativeIntegerBlock(128, 1000)));
+  BOOST_CHECK_NO_THROW(info.addAppMetaInfo(makeNonNegativeIntegerBlock(252, 1000)));
 
-  BOOST_CHECK_THROW(info.addAppMetaInfo(nonNegativeIntegerBlock(127, 1000)), MetaInfo::Error);
-  BOOST_CHECK_THROW(info.addAppMetaInfo(nonNegativeIntegerBlock(253, 1000)), MetaInfo::Error);
+  BOOST_CHECK_THROW(info.addAppMetaInfo(makeNonNegativeIntegerBlock(127, 1000)), MetaInfo::Error);
+  BOOST_CHECK_THROW(info.addAppMetaInfo(makeNonNegativeIntegerBlock(253, 1000)), MetaInfo::Error);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/unit-tests/util/test-in-memory-storage-common.cpp b/tests/unit-tests/util/test-in-memory-storage-common.cpp
index 5fe9805..f2c1b9f 100644
--- a/tests/unit-tests/util/test-in-memory-storage-common.cpp
+++ b/tests/unit-tests/util/test-in-memory-storage-common.cpp
@@ -510,8 +510,7 @@
   const ndn::KeyLocator locator(keyName);
 
   ndn::SignatureSha256WithRsa fakeSignature;
-  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
-                                        reinterpret_cast<const uint8_t*>(0), 0));
+  fakeSignature.setValue(makeEmptyBlock(tlv::SignatureValue));
 
   fakeSignature.setKeyLocator(locator);
   data2->setSignature(fakeSignature);
