Compilation fixes after upgrade to NFD 0.6.6 and removal of old-style CS
Change-Id: I5472ae71675d8419d8d6c70990182ef028803087
diff --git a/tests/other/ndn-test.cpp b/tests/other/ndn-test.cpp
index c720bd6..da86f31 100644
--- a/tests/other/ndn-test.cpp
+++ b/tests/other/ndn-test.cpp
@@ -26,7 +26,6 @@
#include <sys/time.h>
#include "ns3/ndnSIM/utils/mem-usage.hpp"
-#include "ns3/ndnSIM/model/cs/ndn-content-store.hpp"
#include "ns3/ndnSIM/utils/mem-usage.hpp"
namespace ns3 {
@@ -63,7 +62,6 @@
printStats(std::ostream& os, Time nextPrintTime, double beginRealTime);
private:
- std::string m_oldContentStore;
size_t m_csSize;
double m_interestRate;
bool m_shouldEvaluatePit;
@@ -110,16 +108,9 @@
if (pitSize != 0)
pitCount += pitSize;
- if (true != true) {
- Ptr<ndn::ContentStore> cs = (*node)->GetObject<ndn::ContentStore>();
- if (cs != 0)
- csCount += cs->GetSize();
- }
- else {
- auto csSize = (*node)->GetObject<ndn::L3Protocol>()->getForwarder()->getCs().size();
- if (csSize != 0)
- csCount += csSize;
- }
+ auto csSize = (*node)->GetObject<ndn::L3Protocol>()->getForwarder()->getCs().size();
+ if (csSize != 0)
+ csCount += csSize;
}
os << "pit:" << pitCount << "\t";
@@ -163,9 +154,6 @@
// Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
CommandLine cmd;
- cmd.AddValue("old-cs", "Old content store to use "
- "(e.g., ns3::ndn::cs::Lru, ns3::ndn::cs::Lfu, ...)",
- m_oldContentStore);
cmd.AddValue("cs-size", "Maximum number of cached packets per node", m_csSize);
cmd.AddValue("rate", "Interest rate", m_interestRate);
cmd.AddValue("pit", "Perform PIT evaluation if this parameter is true",
@@ -189,10 +177,6 @@
ndn::StackHelper ndnHelper;
ndnHelper.setCsSize(m_csSize);
- if (!m_oldContentStore.empty()) {
- ndnHelper.SetOldContentStore(m_oldContentStore, "MaxSize", std::to_string(m_csSize));
- }
-
ndnHelper.InstallAll();
ndn::FibHelper::AddRoute(nodes.Get(0), "/", nodes.Get(1), 10);
diff --git a/tests/unit-tests/helper/ndn-link-control-helper.t.cpp b/tests/unit-tests/helper/ndn-link-control-helper.t.cpp
index 1e59f14..3d79ffa 100644
--- a/tests/unit-tests/helper/ndn-link-control-helper.t.cpp
+++ b/tests/unit-tests/helper/ndn-link-control-helper.t.cpp
@@ -18,7 +18,7 @@
**/
#include "helper/ndn-link-control-helper.hpp"
-#include "NFD/core/scheduler.hpp"
+#include "daemon/common/global.hpp"
#include "../tests-common.hpp"
@@ -54,16 +54,16 @@
Simulator::Schedule(Seconds(5.1), ndn::LinkControlHelper::FailLink, getNode("1"), getNode("2"));
Simulator::Schedule(Seconds(10.1), ndn::LinkControlHelper::UpLink, getNode("1"), getNode("2"));
- nfd::scheduler::schedule(time::milliseconds(5200), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(5200), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 6);
BOOST_CHECK_EQUAL(getFace("1", "2")->getCounters().nInData, 6);
});
- nfd::scheduler::schedule(time::milliseconds(10200), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(10200), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 6);
BOOST_CHECK_EQUAL(getFace("1", "2")->getCounters().nInData, 6);
});
- nfd::scheduler::schedule(time::milliseconds(15100), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(15100), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 11);
BOOST_CHECK_EQUAL(getFace("1", "2")->getCounters().nInData, 11);
});
@@ -119,27 +119,27 @@
"0s", "100s"}
});
- nfd::scheduler::schedule(time::milliseconds(10100), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(10100), [&] {
LinkControlHelper::FailLink(getNode("1"), getNode("2"));
});
// just before link failure
- nfd::scheduler::schedule(time::milliseconds(10050), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(10050), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 11);
BOOST_CHECK_EQUAL(getFace("3", "1")->getCounters().nInInterests, 11);
});
// just before link recovery
- nfd::scheduler::schedule(time::milliseconds(20050), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(20050), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 11);
BOOST_CHECK_EQUAL(getFace("3", "1")->getCounters().nInInterests, 21);
});
- nfd::scheduler::schedule(time::milliseconds(20100), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(20100), [&] {
LinkControlHelper::UpLink(getNode("1"), getNode("2"));
});
- nfd::scheduler::schedule(time::milliseconds(30050), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(30050), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 21);
BOOST_CHECK_EQUAL(getFace("3", "1")->getCounters().nInInterests, 31);
});
diff --git a/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp b/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
index cbcec2e..f1a8a14 100644
--- a/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
+++ b/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
@@ -149,9 +149,9 @@
this->setInstanceName(name);
}
- virtual void
- afterReceiveInterest(const Face& inFace, const Interest& interest,
- const shared_ptr<nfd::pit::Entry>& pitEntry)
+ void
+ afterReceiveInterest(const nfd::FaceEndpoint& ingress, const Interest& interest,
+ const shared_ptr<nfd::pit::Entry>& pitEntry) override
{
// this strategy doesn't forward interests
}
diff --git a/tests/unit-tests/model/ndn-old-content-store.t.cpp b/tests/unit-tests/model/ndn-old-content-store.t.cpp
deleted file mode 100644
index c2e9c43..0000000
--- a/tests/unit-tests/model/ndn-old-content-store.t.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2011-2016 Regents of the University of California.
- *
- * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
- * contributors.
- *
- * ndnSIM 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.
- *
- * ndnSIM 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
- * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-
-#include "../tests-common.hpp"
-
-namespace ns3 {
-namespace ndn {
-
-BOOST_FIXTURE_TEST_SUITE(ModelNdnOldContentStore, ScenarioHelperWithCleanupFixture)
-
-BOOST_AUTO_TEST_CASE(RandomPolicy)
-{
- Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("10Mbps"));
- Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
- Config::SetDefault("ns3::QueueBase::MaxSize", StringValue("20p"));
-
- getStackHelper().SetOldContentStore("ns3::ndn::cs::Random", "MaxSize", "10");
-
- createTopology({
- {"1", "2"},
- });
-
- addRoutes({
- {"1", "2", "/prefix", 1},
- });
-
- addApps({
- {"1", "ns3::ndn::ConsumerCbr",
- {{"Prefix", "/prefix"}, {"Frequency", "10"}},
- "0s", "9.99s"},
- {"2", "ns3::ndn::Producer",
- {{"Prefix", "/prefix"}, {"PayloadSize", "1024"}},
- "0s", "100s"}
- });
-
- Simulator::Stop(Seconds(20.001));
- Simulator::Run();
-
- std::map<std::string, std::vector<Name>> entries;
- for (const std::string& node : {"1", "2"}) {
- auto cs = getNode(node)->GetObject<ContentStore>();
- auto& nodeCs = entries[node];
- for (auto it = cs->Begin(); it != cs->End(); it = cs->Next(it)) {
- nodeCs.push_back(it->GetName());
- }
- }
-
- BOOST_CHECK_EQUAL(entries["1"].size(), 10);
- BOOST_CHECK_EQUAL(entries["2"].size(), 10);
- BOOST_CHECK(entries["1"] != entries["2"]); // this test has a small chance of failing
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace ndn
-} // namespace ns3
diff --git a/tests/unit-tests/ndn-cxx/face.t.cpp b/tests/unit-tests/ndn-cxx/face.t.cpp
index 6eb39c2..32a1c1c 100644
--- a/tests/unit-tests/ndn-cxx/face.t.cpp
+++ b/tests/unit-tests/ndn-cxx/face.t.cpp
@@ -220,9 +220,9 @@
m_face.expressInterest(Interest(Name(name).appendSegment(seqNo)).setCanBePrefix(true), std::bind([=] (const Data& data) {
onData(data.getName());
- m_event = m_scheduler.scheduleEvent(time::seconds(1),
- std::bind(&MultipleInterest::expressNextInterest, this,
- name, seqNo + 1, onData, onTimeout, onNack));
+ m_event = m_scheduler.schedule(time::seconds(1),
+ std::bind(&MultipleInterest::expressNextInterest, this,
+ name, seqNo + 1, onData, onTimeout, onNack));
}, _2),
std::bind(onNack),
std::bind(onTimeout));