diff --git a/tests/tlv/test-lsdb-status.cpp b/tests/tlv/test-lsdb-status.cpp
new file mode 100644
index 0000000..73a120f
--- /dev/null
+++ b/tests/tlv/test-lsdb-status.cpp
@@ -0,0 +1,337 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  The University of Memphis,
+ *                           Regents of the University of California,
+ *                           Arizona Board of Regents.
+ *
+ * This file is part of NLSR (Named-data Link State Routing).
+ * See AUTHORS.md for complete list of NLSR authors and contributors.
+ *
+ * NLSR 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.
+ *
+ * NLSR 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
+ * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "tlv/lsdb-status.hpp"
+
+#include "../boost-test.hpp"
+
+namespace nlsr {
+namespace tlv  {
+namespace test {
+
+BOOST_AUTO_TEST_SUITE(TlvTestLsdbStatus)
+
+const uint8_t LsdbStatusData1[] =
+{
+  // Header
+  0x8a, 0x7f,
+  // AdjacencyLsa
+  0x83, 0x32,
+    // LsaInfo
+    0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
+    0x80, 0x8b, 0x02, 0x27, 0x10,
+    // Adjacency
+    0x84, 0x1d, 0x07, 0x0c, 0x08, 0x0a, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x63,
+    0x79, 0x31, 0x8d, 0x0a, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x63, 0x79, 0x31,
+    0x8c, 0x01, 0x80,
+  // CoordianteLsa
+  0x85, 0x2b,
+    // LsaInfo
+    0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
+    0x80, 0x8b, 0x02, 0x27, 0x10,
+    // HyperbolicRadius
+    0x87, 0x0a, 0x86, 0x08, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xfa, 0x3f,
+    // HyperbolicAngle
+    0x88, 0x0a, 0x86, 0x08, 0x7b, 0x14, 0xae, 0x47, 0xe1, 0x7a, 0xfc, 0x3f,
+  // NameLsa
+  0x89, 0x1c,
+    // LsaInfo
+    0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
+    0x80, 0x8b, 0x02, 0x27, 0x10,
+    // Name
+    0x07, 0x07, 0x08, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x31
+};
+
+const uint8_t LsdbStatusData2[] =
+{
+  // Header
+  0x8a, 0x00
+};
+
+const uint8_t LsdbStatusData3[] =
+{
+  // Header
+  0x8a, 0x7f,
+  // CoordianteLsa
+  0x85, 0x2b,
+    // LsaInfo
+    0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
+    0x80, 0x8b, 0x02, 0x27, 0x10,
+    // HyperbolicRadius
+    0x87, 0x0a, 0x86, 0x08, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xfa, 0x3f,
+    // HyperbolicAngle
+    0x88, 0x0a, 0x86, 0x08, 0x7b, 0x14, 0xae, 0x47, 0xe1, 0x7a, 0xfc, 0x3f,
+  // NameLsa
+  0x89, 0x1c,
+    // LsaInfo
+    0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
+    0x80, 0x8b, 0x02, 0x27, 0x10,
+    // Name
+    0x07, 0x07, 0x08, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x31,
+  // AdjacencyLsa
+   0x83, 0x32,
+     // LsaInfo
+     0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
+     0x80, 0x8b, 0x02, 0x27, 0x10,
+     // Adjacency
+     0x84, 0x1d, 0x07, 0x0c, 0x08, 0x0a, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x63,
+     0x79, 0x31, 0x8d, 0x0a, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x63, 0x79, 0x31,
+     0x8c, 0x01, 0x80
+};
+
+BOOST_AUTO_TEST_CASE(LsdbStatusEncode1)
+{
+  LsdbStatus lsdbStatus;
+
+  LsaInfo lsaInfo;
+  lsaInfo.setOriginRouter("test");
+  lsaInfo.setSequenceNumber(128);
+  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
+
+  // AdjacencyLsa
+  AdjacencyLsa adjacencyLsa;
+  adjacencyLsa.setLsaInfo(lsaInfo);
+
+  Adjacency adjacency1;
+  adjacency1.setName("adjacency1");
+  adjacency1.setUri("adjacency1");
+  adjacency1.setCost(128);
+  adjacencyLsa.addAdjacency(adjacency1);
+
+  lsdbStatus.addAdjacencyLsa(adjacencyLsa);
+
+  // CoordinateLsa
+  CoordinateLsa coordinateLsa;
+  coordinateLsa.setLsaInfo(lsaInfo);
+
+  coordinateLsa.setHyperbolicRadius(1.65);
+  coordinateLsa.setHyperbolicAngle(1.78);
+
+  lsdbStatus.addCoordinateLsa(coordinateLsa);
+
+  // NameLsa
+  NameLsa nameLsa;
+  nameLsa.setLsaInfo(lsaInfo);
+  nameLsa.addName("name1");
+
+  lsdbStatus.addNameLsa(nameLsa);
+
+  const ndn::Block& wire = lsdbStatus.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(LsdbStatusData1,
+                                  LsdbStatusData1 + sizeof(LsdbStatusData1),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(LsdbStatusEncode2)
+{
+  LsdbStatus lsdbStatus;
+
+  const ndn::Block& wire = lsdbStatus.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(LsdbStatusData2,
+                                  LsdbStatusData2 + sizeof(LsdbStatusData2),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(LsdbStatusDecode1)
+{
+  LsdbStatus lsdbStatus;
+
+  lsdbStatus.wireDecode(ndn::Block(LsdbStatusData1, sizeof(LsdbStatusData1)));
+
+  std::list<AdjacencyLsa> adjacencyLsas = lsdbStatus.getAdjacencyLsas();
+  std::list<AdjacencyLsa>::const_iterator it1 = adjacencyLsas.begin();
+
+  LsaInfo lsaInfo = it1->getLsaInfo();
+  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
+  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
+  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
+
+  std::list<Adjacency> adjacencies = it1->getAdjacencies();
+  std::list<Adjacency>::const_iterator it2 = adjacencies.begin();
+  BOOST_CHECK_EQUAL(it2->getName(), "adjacency1");
+  BOOST_CHECK_EQUAL(it2->getUri(), "adjacency1");
+  BOOST_CHECK_EQUAL(it2->getCost(), 128);
+
+  BOOST_CHECK_EQUAL(lsdbStatus.hasAdjacencyLsas(), true);
+
+  std::list<CoordinateLsa> coordinateLsas = lsdbStatus.getCoordinateLsas();
+  std::list<CoordinateLsa>::const_iterator it3 = coordinateLsas.begin();
+
+  lsaInfo = it3->getLsaInfo();
+  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
+  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
+  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
+
+  BOOST_REQUIRE_EQUAL(it3->getHyperbolicRadius(), 1.65);
+  BOOST_REQUIRE_EQUAL(it3->getHyperbolicAngle(), 1.78);
+
+  BOOST_CHECK_EQUAL(lsdbStatus.hasCoordinateLsas(), true);
+
+  std::list<NameLsa> nameLsas = lsdbStatus.getNameLsas();
+  std::list<NameLsa>::const_iterator it4 = nameLsas.begin();
+
+  lsaInfo = it4->getLsaInfo();
+  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
+  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
+  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
+
+  std::list<ndn::Name> names = it4->getNames();
+  std::list<ndn::Name>::const_iterator it5 = names.begin();
+  BOOST_CHECK_EQUAL(*it5, "name1");
+
+  BOOST_CHECK_EQUAL(lsdbStatus.hasNameLsas(), true);
+}
+
+BOOST_AUTO_TEST_CASE(LsdbStatusDecode2)
+{
+  LsdbStatus lsdbStatus;
+
+  lsdbStatus.wireDecode(ndn::Block(LsdbStatusData2, sizeof(LsdbStatusData2)));
+
+  BOOST_CHECK_EQUAL(lsdbStatus.hasAdjacencyLsas(), false);
+  BOOST_CHECK_EQUAL(lsdbStatus.hasCoordinateLsas(), false);
+  BOOST_CHECK_EQUAL(lsdbStatus.hasNameLsas(), false);
+}
+
+BOOST_AUTO_TEST_CASE(LsdbStatusDecode3)
+{
+  LsdbStatus lsdbStatus;
+
+  BOOST_CHECK_THROW(lsdbStatus.wireDecode(ndn::Block(LsdbStatusData3, sizeof(LsdbStatusData3))),
+                    LsdbStatus::Error);
+}
+
+BOOST_AUTO_TEST_CASE(LsdbStatusClear)
+{
+  LsdbStatus lsdbStatus;
+
+  LsaInfo lsaInfo;
+  lsaInfo.setOriginRouter("test");
+  lsaInfo.setSequenceNumber(128);
+  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
+
+  // AdjacencyLsa
+  AdjacencyLsa adjacencyLsa;
+  adjacencyLsa.setLsaInfo(lsaInfo);
+
+  Adjacency adjacency1;
+  adjacency1.setName("adjacency1");
+  adjacency1.setUri("adjacency1");
+  adjacency1.setCost(128);
+  adjacencyLsa.addAdjacency(adjacency1);
+
+  lsdbStatus.addAdjacencyLsa(adjacencyLsa);
+  BOOST_CHECK_EQUAL(lsdbStatus.hasAdjacencyLsas(), true);
+  lsdbStatus.clearAdjacencyLsas();
+  BOOST_CHECK_EQUAL(lsdbStatus.hasAdjacencyLsas(), false);
+
+  // CoordinateLsa
+  CoordinateLsa coordinateLsa;
+  coordinateLsa.setLsaInfo(lsaInfo);
+
+  coordinateLsa.setHyperbolicRadius(1.65);
+  coordinateLsa.setHyperbolicAngle(1.78);
+
+  lsdbStatus.addCoordinateLsa(coordinateLsa);
+  BOOST_CHECK_EQUAL(lsdbStatus.hasCoordinateLsas(), true);
+  lsdbStatus.clearCoordinateLsas();
+  BOOST_CHECK_EQUAL(lsdbStatus.hasCoordinateLsas(), false);
+
+  // NameLsa
+  NameLsa nameLsa;
+  nameLsa.setLsaInfo(lsaInfo);
+  nameLsa.addName("name1");
+
+  lsdbStatus.addNameLsa(nameLsa);
+  BOOST_CHECK_EQUAL(lsdbStatus.hasNameLsas(), true);
+  lsdbStatus.clearNameLsas();
+  BOOST_CHECK_EQUAL(lsdbStatus.hasNameLsas(), false);
+}
+
+BOOST_AUTO_TEST_CASE(LsdbStatusOutputStream)
+{
+  LsdbStatus lsdbStatus;
+
+  LsaInfo lsaInfo;
+  lsaInfo.setOriginRouter("test");
+  lsaInfo.setSequenceNumber(128);
+  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
+
+  // AdjacencyLsa
+  AdjacencyLsa adjacencyLsa;
+  adjacencyLsa.setLsaInfo(lsaInfo);
+
+  Adjacency adjacency1;
+  adjacency1.setName("adjacency1");
+  adjacency1.setUri("adjacency1");
+  adjacency1.setCost(128);
+  adjacencyLsa.addAdjacency(adjacency1);
+
+  lsdbStatus.addAdjacencyLsa(adjacencyLsa);
+
+  // CoordinateLsa
+  CoordinateLsa coordinateLsa;
+  coordinateLsa.setLsaInfo(lsaInfo);
+
+  coordinateLsa.setHyperbolicRadius(1.65);
+  coordinateLsa.setHyperbolicAngle(1.78);
+
+  lsdbStatus.addCoordinateLsa(coordinateLsa);
+
+  // NameLsa
+  NameLsa nameLsa;
+  nameLsa.setLsaInfo(lsaInfo);
+  nameLsa.addName("name1");
+
+  lsdbStatus.addNameLsa(nameLsa);
+
+  std::ostringstream os;
+  os << lsdbStatus;
+
+  BOOST_CHECK_EQUAL(os.str(), "LsdbStatus("
+                                "AdjacencyLsa("
+                                  "LsaInfo("
+                                    "OriginRouter: /test, "
+                                    "SequenceNumber: 128, "
+                                    "ExpirationPeriod: 10000 milliseconds), "
+                                  "Adjacency(Name: /adjacency1, Uri: adjacency1, Cost: 128)), "
+                                "CoordinateLsa("
+                                  "LsaInfo("
+                                    "OriginRouter: /test, "
+                                    "SequenceNumber: 128, "
+                                    "ExpirationPeriod: 10000 milliseconds), "
+                                  "HyperbolicRadius: 1.65, "
+                                  "HyperbolicAngle: 1.78), "
+                                "NameLsa("
+                                  "LsaInfo("
+                                    "OriginRouter: /test, "
+                                    "SequenceNumber: 128, "
+                                    "ExpirationPeriod: 10000 milliseconds), "
+                                  "Name: /name1))");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace tlv
+} // namespace nlsr
