diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
index 34f2d09..e4c68b3 100644
--- a/tests/daemon/face/dummy-face.hpp
+++ b/tests/daemon/face/dummy-face.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -55,7 +55,7 @@
             ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_POINT_TO_POINT);
 
   /** \brief changes face state
-   *  \pre current state is not CLOSED or FAILED
+   *  \throw std::runtime_error state transition is invalid
    */
   void
   setState(FaceState state);
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
new file mode 100644
index 0000000..0df019c
--- /dev/null
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -0,0 +1,186 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2016,  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/>.
+ */
+
+#include "table/cleanup.hpp"
+#include "fw/forwarder.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+namespace nfd {
+namespace tests {
+
+using namespace nfd::tests;
+
+BOOST_AUTO_TEST_SUITE(Table)
+BOOST_FIXTURE_TEST_SUITE(TestCleanup, BaseFixture)
+
+BOOST_AUTO_TEST_SUITE(FaceRemoval)
+
+BOOST_AUTO_TEST_CASE(Basic)
+{
+  NameTree nameTree(16);
+  Fib fib(nameTree);
+  Pit pit(nameTree);
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+
+  for (uint64_t i = 0; i < 300; ++i) {
+    Name name = Name("/P").appendVersion(i);
+
+    fib::Entry* fibEntry = fib.insert(name).first;
+    fibEntry->addNextHop(*face1, 0);
+
+    shared_ptr<Interest> interest = makeInterest(name);
+    shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
+    if ((i & 0x01) != 0) {
+      pitEntry->insertOrUpdateInRecord(face1, *interest);
+    }
+    if ((i & 0x02) != 0) {
+      pitEntry->insertOrUpdateOutRecord(face1, *interest);
+    }
+  }
+  BOOST_CHECK_EQUAL(fib.size(), 300);
+  BOOST_CHECK_EQUAL(pit.size(), 300);
+
+  cleanupOnFaceRemoval(nameTree, fib, pit, *face1);
+  BOOST_CHECK_EQUAL(fib.size(), 0);
+  BOOST_CHECK_EQUAL(pit.size(), 300);
+  for (const pit::Entry& pitEntry : pit) {
+    BOOST_CHECK_EQUAL(pitEntry.hasInRecords(), false);
+    BOOST_CHECK_EQUAL(pitEntry.hasOutRecords(), false);
+  }
+}
+
+BOOST_AUTO_TEST_CASE(RemoveFibNexthops)
+{
+  Forwarder forwarder;
+  NameTree& nameTree = forwarder.getNameTree();
+  Fib& fib = forwarder.getFib();
+
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  // {}
+  size_t nNameTreeEntriesBefore = nameTree.size();
+  BOOST_CHECK_EQUAL(fib.size(), 0);
+
+  fib::Entry* entryA = fib.insert("/A").first;
+  entryA->addNextHop(*face1, 0);
+  entryA->addNextHop(*face2, 0);
+  // {'/A':[1,2]}
+
+  fib::Entry* entryB = fib.insert("/B").first;
+  entryB->addNextHop(*face1, 0);
+  // {'/A':[1,2], '/B':[1]}
+
+  fib::Entry* entryC = fib.insert("/C").first;
+  entryC->addNextHop(*face2, 1);
+  // {'/A':[1,2], '/B':[1], '/C':[2]}
+
+  fib::Entry* entryB1 = fib.insert("/B/1").first;
+  entryB1->addNextHop(*face1, 0);
+  // {'/A':[1,2], '/B':[1], '/B/1':[1], '/C':[2]}
+
+  fib::Entry* entryB12 = fib.insert("/B/1/2").first;
+  entryB12->addNextHop(*face1, 0);
+  // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/C':[2]}
+
+  // ---- close face1 ----
+  face1->close();
+  BOOST_CHECK_EQUAL(face1->getState(), face::FaceState::CLOSED);
+  // {'/A':[2], '/C':[2]}
+  BOOST_CHECK_EQUAL(fib.size(), 2);
+
+  const fib::Entry& foundA = fib.findLongestPrefixMatch("/A");
+  BOOST_CHECK_EQUAL(foundA.getPrefix(), "/A");
+  BOOST_CHECK_EQUAL(foundA.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(&foundA.getNextHops().begin()->getFace(), face2.get());
+
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/B").getPrefix(), "/");
+
+  // ---- close face2 ----
+  face2->close();
+  BOOST_CHECK_EQUAL(face2->getState(), face::FaceState::CLOSED);
+  BOOST_CHECK_EQUAL(fib.size(), 0);
+  BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
+}
+
+BOOST_AUTO_TEST_CASE(DeletePitInOutRecords)
+{
+  Forwarder forwarder;
+  Pit& pit = forwarder.getPit();
+
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  // {}
+  BOOST_CHECK_EQUAL(pit.size(), 0);
+
+  shared_ptr<Interest> interestA = makeInterest("/A");
+  shared_ptr<pit::Entry> entryA = pit.insert(*interestA).first;
+  entryA->insertOrUpdateInRecord(face1, *interestA);
+  entryA->insertOrUpdateInRecord(face2, *interestA);
+  entryA->insertOrUpdateOutRecord(face1, *interestA);
+  entryA->insertOrUpdateOutRecord(face2, *interestA);
+  // {'/A':[1,2]}
+
+  shared_ptr<Interest> interestB = makeInterest("/B");
+  shared_ptr<pit::Entry> entryB = pit.insert(*interestB).first;
+  entryB->insertOrUpdateInRecord(face1, *interestB);
+  entryB->insertOrUpdateOutRecord(face1, *interestB);
+  // {'/A':[1,2], '/B':[1]}
+
+  shared_ptr<Interest> interestC = makeInterest("/C");
+  shared_ptr<pit::Entry> entryC = pit.insert(*interestC).first;
+  entryC->insertOrUpdateInRecord(face2, *interestC);
+  entryC->insertOrUpdateOutRecord(face2, *interestC);
+  // {'/A':[1,2], '/B':[1], '/C':[2]}
+  BOOST_CHECK_EQUAL(pit.size(), 3);
+
+  // ---- close face1 ----
+  face1->close();
+  BOOST_CHECK_EQUAL(face1->getState(), face::FaceState::CLOSED);
+  // {'/A':[2], '/B':[], '/C':[2]}
+  BOOST_CHECK_EQUAL(pit.size(), 3);
+
+  shared_ptr<pit::Entry> foundA = pit.find(*interestA);
+  BOOST_REQUIRE(foundA != nullptr);
+  BOOST_REQUIRE_EQUAL(foundA->getInRecords().size(), 1);
+  BOOST_CHECK_EQUAL(foundA->getInRecords().front().getFace(), face2);
+  BOOST_REQUIRE_EQUAL(foundA->getOutRecords().size(), 1);
+  BOOST_CHECK_EQUAL(foundA->getOutRecords().front().getFace(), face2);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // FaceRemovalCleanup
+
+BOOST_AUTO_TEST_SUITE_END() // TestCleanup
+BOOST_AUTO_TEST_SUITE_END() // Table
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 46a3bca..204c5a3 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -214,71 +214,6 @@
   BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(mABCD).getPrefix(), "/A/B/C");
 }
 
-BOOST_AUTO_TEST_CASE(RemoveNextHopFromAllEntries)
-{
-  shared_ptr<Face> face1 = make_shared<DummyFace>();
-  shared_ptr<Face> face2 = make_shared<DummyFace>();
-
-  NameTree nameTree;
-  Fib fib(nameTree);
-  // {}
-
-  Entry* entryA = fib.insert("/A").first;
-  entryA->addNextHop(*face1, 0);
-  entryA->addNextHop(*face2, 0);
-  // {'/A':[1,2]}
-
-  Entry* entryB = fib.insert("/B").first;
-  entryB->addNextHop(*face1, 0);
-  // {'/A':[1,2], '/B':[1]}
-  BOOST_CHECK_EQUAL(fib.size(), 2);
-
-  Entry* entryC = fib.insert("/C").first;
-  entryC->addNextHop(*face2, 1);
-  // {'/A':[1,2], '/B':[1], '/C':[2]}
-  BOOST_CHECK_EQUAL(fib.size(), 3);
-
-  Entry* entryB1 = fib.insert("/B/1").first;
-  entryB1->addNextHop(*face1, 0);
-  // {'/A':[1,2], '/B':[1], '/B/1':[1], '/C':[2]}
-  BOOST_CHECK_EQUAL(fib.size(), 4);
-
-  Entry* entryB12 = fib.insert("/B/1/2").first;
-  entryB12->addNextHop(*face1, 0);
-  // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/C':[2]}
-  BOOST_CHECK_EQUAL(fib.size(), 5);
-
-  /////////////
-
-  fib.removeNextHopFromAllEntries(*face1);
-  // {'/A':[2], '/C':[2]}
-  BOOST_CHECK_EQUAL(fib.size(), 2);
-
-  const Entry& foundA = fib.findLongestPrefixMatch("/A");
-  BOOST_CHECK_EQUAL(foundA.getPrefix(), "/A");
-  const NextHopList& nexthopsA = foundA.getNextHops();
-  BOOST_CHECK_EQUAL(nexthopsA.size(), 1);
-  BOOST_CHECK_EQUAL(&nexthopsA.begin()->getFace(), face2.get());
-
-  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/B").getPrefix(), "/");
-}
-
-BOOST_AUTO_TEST_CASE(RemoveNextHopFromManyEntries)
-{
-  NameTree nameTree(16);
-  Fib fib(nameTree);
-  shared_ptr<Face> face1 = make_shared<DummyFace>();
-
-  for (uint64_t i = 0; i < 300; ++i) {
-    Entry* entry = fib.insert(Name("/P").appendVersion(i)).first;
-    entry->addNextHop(*face1, 0);
-  }
-  BOOST_CHECK_EQUAL(fib.size(), 300);
-
-  fib.removeNextHopFromAllEntries(*face1);
-  BOOST_CHECK_EQUAL(fib.size(), 0);
-}
-
 void
 validateFindExactMatch(Fib& fib, const Name& target)
 {
