diff --git a/tests/daemon/fw/strategy.t.cpp b/tests/daemon/fw/strategy.t.cpp
index 72d43b4..11f3f38 100644
--- a/tests/daemon/fw/strategy.t.cpp
+++ b/tests/daemon/fw/strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -100,147 +100,7 @@
   BOOST_CHECK((strategy.removedFaces == std::vector<FaceId>{id2, id1}));
 }
 
-class LookupFibFixture : public BaseFixture
-{
-protected:
-  class TestStrategy : public DummyStrategy
-  {
-  public:
-    explicit
-    TestStrategy(Forwarder& forwarder)
-      : DummyStrategy(forwarder)
-    {
-    }
-
-    const fib::Entry&
-    lookupFib(const pit::Entry& pitEntry) const
-    {
-      return this->Strategy::lookupFib(pitEntry);
-    }
-  };
-
-  LookupFibFixture()
-    : strategy(forwarder)
-    , fib(forwarder.getFib())
-    , pit(forwarder.getPit())
-    , nrt(forwarder.getNetworkRegionTable())
-    , inFace(make_shared<DummyFace>())
-    , outFace(make_shared<DummyFace>())
-    , link(makeLink("/net/ndnsim", {{10, "/telia/terabits"}, {20, "/ucla/cs"}}))
-  {
-    forwarder.addFace(inFace);
-    forwarder.addFace(outFace);
-  }
-
-  const fib::Entry&
-  lookupFib(Interest& interest)
-  {
-    shared_ptr<pit::Entry> pitEntry = pit.insert(interest).first;
-    pitEntry->insertOrUpdateInRecord(*inFace, interest);
-    return strategy.lookupFib(*pitEntry);
-  }
-
-protected:
-  Forwarder forwarder;
-  TestStrategy strategy;
-  Fib& fib;
-  Pit& pit;
-  NetworkRegionTable& nrt;
-
-  shared_ptr<Face> inFace;
-  shared_ptr<Face> outFace;
-  shared_ptr<Link> link;
-};
-
-BOOST_FIXTURE_TEST_SUITE(LookupFib, LookupFibFixture)
-
-BOOST_AUTO_TEST_CASE(NoLink)
-{
-  fib.insert("/net/ndnsim").first->addNextHop(*outFace, 10);
-
-  auto interest = makeInterest("/net/ndnsim/www/index.html");
-  const fib::Entry& fibEntry = this->lookupFib(*interest);
-
-  BOOST_CHECK_EQUAL(fibEntry.getPrefix(), "/net/ndnsim");
-  BOOST_CHECK_EQUAL(interest->hasSelectedDelegation(), false);
-}
-
-BOOST_AUTO_TEST_CASE(ConsumerRegion)
-{
-  nrt.insert("/arizona/cs/avenir");
-  fib.insert("/").first->addNextHop(*outFace, 10);
-
-  auto interest = makeInterest("/net/ndnsim/www/index.html");
-  interest->setLink(link->wireEncode());
-  const fib::Entry& fibEntry = this->lookupFib(*interest);
-
-  BOOST_CHECK_EQUAL(fibEntry.getPrefix(), "/");
-  BOOST_CHECK_EQUAL(interest->hasSelectedDelegation(), false);
-}
-
-BOOST_AUTO_TEST_CASE(DefaultFreeFirstDelegation)
-{
-  nrt.insert("/arizona/cs/hobo");
-  fib.insert("/telia").first->addNextHop(*outFace, 20);
-  fib.insert("/ucla").first->addNextHop(*outFace, 10);
-
-  auto interest = makeInterest("/net/ndnsim/www/index.html");
-  interest->setLink(link->wireEncode());
-  const fib::Entry& fibEntry = this->lookupFib(*interest);
-
-  BOOST_CHECK_EQUAL(fibEntry.getPrefix(), "/telia");
-  BOOST_REQUIRE_EQUAL(interest->hasSelectedDelegation(), true);
-  BOOST_CHECK_EQUAL(interest->getSelectedDelegation(), "/telia/terabits");
-}
-
-BOOST_AUTO_TEST_CASE(DefaultFreeSecondDelegation)
-{
-  nrt.insert("/arizona/cs/hobo");
-  fib.insert("/ucla").first->addNextHop(*outFace, 10);
-
-  auto interest = makeInterest("/net/ndnsim/www/index.html");
-  interest->setLink(link->wireEncode());
-  const fib::Entry& fibEntry = this->lookupFib(*interest);
-
-  BOOST_CHECK_EQUAL(fibEntry.getPrefix(), "/ucla");
-  BOOST_REQUIRE_EQUAL(interest->hasSelectedDelegation(), true);
-  BOOST_CHECK_EQUAL(interest->getSelectedDelegation(), "/ucla/cs");
-}
-
-BOOST_AUTO_TEST_CASE(DefaultFreeHasSelectedDelegation)
-{
-  nrt.insert("/ucsd/caida/click");
-  fib.insert("/telia").first->addNextHop(*outFace, 10);
-  fib.insert("/ucla").first->addNextHop(*outFace, 10);
-
-  auto interest = makeInterest("/net/ndnsim/www/index.html");
-  interest->setLink(link->wireEncode());
-  interest->setSelectedDelegation("/ucla/cs");
-  const fib::Entry& fibEntry = this->lookupFib(*interest);
-
-  BOOST_CHECK_EQUAL(fibEntry.getPrefix(), "/ucla");
-  BOOST_REQUIRE_EQUAL(interest->hasSelectedDelegation(), true);
-  BOOST_CHECK_EQUAL(interest->getSelectedDelegation(), "/ucla/cs");
-}
-
-BOOST_AUTO_TEST_CASE(ProducerRegion)
-{
-  nrt.insert("/ucla/cs/spurs");
-  fib.insert("/").first->addNextHop(*outFace, 10);
-  fib.insert("/ucla").first->addNextHop(*outFace, 10);
-  fib.insert("/net/ndnsim").first->addNextHop(*outFace, 10);
-
-  auto interest = makeInterest("/net/ndnsim/www/index.html");
-  interest->setLink(link->wireEncode());
-  interest->setSelectedDelegation("/ucla/cs");
-  const fib::Entry& fibEntry = this->lookupFib(*interest);
-
-  BOOST_CHECK_EQUAL(fibEntry.getPrefix(), "/net/ndnsim");
-  BOOST_REQUIRE_EQUAL(interest->hasSelectedDelegation(), true);
-  BOOST_CHECK_EQUAL(interest->getSelectedDelegation(), "/ucla/cs");
-}
-
-BOOST_AUTO_TEST_SUITE_END() // LookupFib
+// LookupFib is tested in Fw/TestLinkForwarding test suite.
 
 BOOST_AUTO_TEST_SUITE_END() // TestStrategy
 BOOST_AUTO_TEST_SUITE_END() // Fw
