fw: reorder function params to make the strategy API more uniform
Also add a non-const overload of Face::getCounters to avoid const_cast
Refs: #5173
Change-Id: Iff0bfbdedb90e68a373090cf3f247d9a7501f58d
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index 78eb795..afe009f 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -275,7 +275,7 @@
auto& pit = topo.getForwarder(nodeB).getPit();
auto pitEntry = pit.insert(*interest).first;
- topo.getForwarder(nodeB).onOutgoingInterest(pitEntry, linkBC->getFace(nodeB), *interest);
+ topo.getForwarder(nodeB).onOutgoingInterest(*interest, linkBC->getFace(nodeB), pitEntry);
this->advanceClocks(time::milliseconds(100));
interest->refreshNonce();
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index cd519b5..5066cca 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -88,7 +88,7 @@
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.back().outFaceId, face2->getId());
@@ -100,7 +100,7 @@
std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
periodicalRetxFrom4 = [&] {
pitEntry->insertOrUpdateInRecord(*face4, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face4, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face4, 0), pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
if (nSent > nSentLast) {
@@ -132,7 +132,7 @@
for (int i = 0; i < 3; ++i) {
this->advanceClocks(TICK, BestRouteStrategy::RETX_SUPPRESSION_MAX * 2);
pitEntry->insertOrUpdateInRecord(*face5, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face5, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face5, 0), pitEntry);
}
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 3);
BOOST_CHECK_NE(strategy.sendInterestHistory[0].outFaceId, face1->getId());
diff --git a/tests/daemon/fw/dummy-strategy.cpp b/tests/daemon/fw/dummy-strategy.cpp
index 3a6e338..439efd1 100644
--- a/tests/daemon/fw/dummy-strategy.cpp
+++ b/tests/daemon/fw/dummy-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -44,23 +44,18 @@
DummyStrategy::DummyStrategy(Forwarder& forwarder, const Name& name)
: Strategy(forwarder)
- , afterReceiveInterest_count(0)
- , beforeSatisfyInterest_count(0)
- , afterContentStoreHit_count(0)
- , afterReceiveData_count(0)
- , afterReceiveNack_count(0)
{
this->setInstanceName(name);
}
void
-DummyStrategy::afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+DummyStrategy::afterReceiveInterest(const Interest& interest, const FaceEndpoint&,
const shared_ptr<pit::Entry>& pitEntry)
{
++afterReceiveInterest_count;
if (interestOutFace != nullptr) {
- this->sendInterest(pitEntry, *interestOutFace, interest);
+ this->sendInterest(interest, *interestOutFace, pitEntry);
}
else {
this->rejectPendingInterest(pitEntry);
@@ -68,39 +63,39 @@
}
void
-DummyStrategy::beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data)
-{
- ++beforeSatisfyInterest_count;
-
- Strategy::beforeSatisfyInterest(pitEntry, ingress, data);
-}
-
-void
-DummyStrategy::afterContentStoreHit(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data)
+DummyStrategy::afterContentStoreHit(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry)
{
++afterContentStoreHit_count;
- Strategy::afterContentStoreHit(pitEntry, ingress, data);
+ Strategy::afterContentStoreHit(data, ingress, pitEntry);
}
void
-DummyStrategy::afterReceiveData(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data)
+DummyStrategy::beforeSatisfyInterest(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry)
+{
+ ++beforeSatisfyInterest_count;
+
+ Strategy::beforeSatisfyInterest(data, ingress, pitEntry);
+}
+
+void
+DummyStrategy::afterReceiveData(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry)
{
++afterReceiveData_count;
- Strategy::afterReceiveData(pitEntry, ingress, data);
+ Strategy::afterReceiveData(data, ingress, pitEntry);
}
void
-DummyStrategy::afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+DummyStrategy::afterReceiveNack(const lp::Nack& nack, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry)
{
++afterReceiveNack_count;
- Strategy::afterReceiveNack(ingress, nack, pitEntry);
+ Strategy::afterReceiveNack(nack, ingress, pitEntry);
}
void
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index aacc1e4..f24d990 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -47,37 +47,39 @@
static Name
getStrategyName(uint64_t version = std::numeric_limits<uint64_t>::max());
- /** \brief constructor
+ /**
+ * \brief Constructor
*
- * \p name is recorded unchanged as \p getInstanceName() , and will not automatically
- * gain a version number when instantiated without a version number.
+ * \p name is recorded unchanged as getInstanceName(), and will not automatically
+ * gain a version number when instantiated without a version number.
*/
explicit
DummyStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
- /** \brief after receive Interest trigger
+ /**
+ * \brief After receive Interest trigger
*
- * If \p interestOutFace is not null, Interest is forwarded to that face and endpoint via send Interest action;
- * otherwise, reject pending Interest action is invoked.
+ * If interestOutFace is not null, \p interest is forwarded to that face;
+ * otherwise, rejectPendingInterest() is invoked.
*/
void
- afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+ afterReceiveInterest(const Interest& interest, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry) override;
void
- beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override;
+ afterContentStoreHit(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override;
void
- afterContentStoreHit(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override;
+ beforeSatisfyInterest(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override;
void
- afterReceiveData(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override;
+ afterReceiveData(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override;
void
- afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+ afterReceiveNack(const lp::Nack& nack, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry) override;
void
@@ -97,11 +99,11 @@
}
public:
- int afterReceiveInterest_count;
- int beforeSatisfyInterest_count;
- int afterContentStoreHit_count;
- int afterReceiveData_count;
- int afterReceiveNack_count;
+ int afterReceiveInterest_count = 0;
+ int afterContentStoreHit_count = 0;
+ int beforeSatisfyInterest_count = 0;
+ int afterReceiveData_count = 0;
+ int afterReceiveNack_count = 0;
// a collection of names of PIT entries that afterNewNextHop() was called on
std::vector<Name> afterNewNextHopCalls;
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index e3b3a19..12ced16 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -165,14 +165,14 @@
pitA->insertOrUpdateInRecord(*face1, *interestA1);
auto interestA2 = makeInterest("/A", false, nullopt, 1698);
- auto outA2 = forwarder.onOutgoingInterest(pitA, *face2, *interestA2);
+ auto outA2 = forwarder.onOutgoingInterest(*interestA2, *face2, pitA);
BOOST_REQUIRE(outA2 != nullptr);
BOOST_CHECK_EQUAL(outA2->getLastNonce(), 1698);
// This packet will be dropped because HopLimit=0
auto interestA3 = makeInterest("/A", false, nullopt, 9876);
interestA3->setHopLimit(0);
- auto outA3 = forwarder.onOutgoingInterest(pitA, *face2, *interestA3);
+ auto outA3 = forwarder.onOutgoingInterest(*interestA3, *face2, pitA);
BOOST_CHECK(outA3 == nullptr);
BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
@@ -275,47 +275,47 @@
// local face, /localhost: OK
strategy.afterReceiveInterest_count = 0;
auto i1 = makeInterest("/localhost/A1");
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *i1);
+ forwarder.onIncomingInterest(*i1, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 1);
// non-local face, /localhost: violate
strategy.afterReceiveInterest_count = 0;
auto i2 = makeInterest("/localhost/A2");
- forwarder.onIncomingInterest(FaceEndpoint(*face2, 0), *i2);
+ forwarder.onIncomingInterest(*i2, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 0);
// local face, non-/localhost: OK
strategy.afterReceiveInterest_count = 0;
auto i3 = makeInterest("/A3");
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *i3);
+ forwarder.onIncomingInterest(*i3, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 1);
// non-local face, non-/localhost: OK
strategy.afterReceiveInterest_count = 0;
auto i4 = makeInterest("/A4");
- forwarder.onIncomingInterest(FaceEndpoint(*face2, 0), *i4);
+ forwarder.onIncomingInterest(*i4, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 1);
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 0);
// local face, /localhost: OK
auto d1 = makeData("/localhost/B1");
- forwarder.onIncomingData(FaceEndpoint(*face1, 0), *d1);
+ forwarder.onIncomingData(*d1, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 1);
// non-local face, /localhost: violate
auto d2 = makeData("/localhost/B2");
- forwarder.onIncomingData(FaceEndpoint(*face2, 0), *d2);
+ forwarder.onIncomingData(*d2, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 1);
// local face, non-/localhost: OK
auto d3 = makeData("/B3");
- forwarder.onIncomingData(FaceEndpoint(*face1, 0), *d3);
+ forwarder.onIncomingData(*d3, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 2);
// non-local face, non-/localhost: OK
auto d4 = makeData("/B4");
- forwarder.onIncomingData(FaceEndpoint(*face2, 0), *d4);
+ forwarder.onIncomingData(*d4, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 3);
}
@@ -330,31 +330,31 @@
auto interest1 = makeInterest("/A/1");
strategyA.afterReceiveInterest_count = 0;
strategyA.interestOutFace = face2;
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *interest1);
+ forwarder.onIncomingInterest(*interest1, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveInterest_count, 1);
auto interest2 = makeInterest("/B/2", true);
strategyB.afterReceiveInterest_count = 0;
strategyB.interestOutFace = face2;
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *interest2);
+ forwarder.onIncomingInterest(*interest2, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategyB.afterReceiveInterest_count, 1);
this->advanceClocks(1_ms, 5_ms);
auto data1 = makeData("/A/1");
strategyA.beforeSatisfyInterest_count = 0;
- forwarder.onIncomingData(FaceEndpoint(*face2, 0), *data1);
+ forwarder.onIncomingData(*data1, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(strategyA.beforeSatisfyInterest_count, 1);
auto data2 = makeData("/B/2/b");
strategyB.beforeSatisfyInterest_count = 0;
- forwarder.onIncomingData(FaceEndpoint(*face2, 0), *data2);
+ forwarder.onIncomingData(*data2, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(strategyB.beforeSatisfyInterest_count, 1);
auto interest3 = makeInterest("/A/3", false, 30_ms);
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *interest3);
+ forwarder.onIncomingInterest(*interest3, FaceEndpoint(*face1, 0));
auto interest4 = makeInterest("/B/4", false, 5_s);
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *interest4);
+ forwarder.onIncomingInterest(*interest4, FaceEndpoint(*face1, 0));
}
BOOST_AUTO_TEST_CASE(IncomingData)
@@ -378,7 +378,7 @@
pitC->insertOrUpdateInRecord(*face4, *interestC);
auto dataD = makeData("/A/B/C/D");
- forwarder.onIncomingData(FaceEndpoint(*face3, 0), *dataD);
+ forwarder.onIncomingData(*dataD, FaceEndpoint(*face3, 0));
this->advanceClocks(1_ms, 5_ms);
BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
@@ -446,14 +446,14 @@
auto nack1 = makeNack(*interest1, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
- forwarder.onIncomingNack(FaceEndpoint(*face1, 0), nack1);
+ forwarder.onIncomingNack(nack1, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 1);
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
auto nack2 = makeNack(*interest2, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
- forwarder.onIncomingNack(FaceEndpoint(*face1, 0), nack2);
+ forwarder.onIncomingNack(nack2, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 1);
@@ -467,7 +467,7 @@
auto nack3 = makeNack(*makeInterest("/yEcw5HhdM", false, nullopt, 243), lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
- forwarder.onIncomingNack(FaceEndpoint(*face1, 0), nack3);
+ forwarder.onIncomingNack(nack3, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
@@ -479,7 +479,7 @@
auto nack4a = makeNack(*interest4, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
- forwarder.onIncomingNack(FaceEndpoint(*face2, 0), nack4a);
+ forwarder.onIncomingNack(nack4a, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
@@ -487,7 +487,7 @@
auto nack4b = makeNack(*makeInterest("/Etab4KpY", false, nullopt, 294), lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
- forwarder.onIncomingNack(FaceEndpoint(*face1, 0), nack4b);
+ forwarder.onIncomingNack(nack4b, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
@@ -495,7 +495,7 @@
pit4->insertOrUpdateOutRecord(*face3, *interest4);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
- forwarder.onIncomingNack(FaceEndpoint(*face3, 0), nack4a);
+ forwarder.onIncomingNack(nack4a, FaceEndpoint(*face3, 0));
BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
}
@@ -522,7 +522,7 @@
pit1->insertOrUpdateInRecord(*face1, *interest1);
face2->sentNacks.clear();
- BOOST_CHECK(!forwarder.onOutgoingNack(pit1, *face2, nackHeader));
+ BOOST_CHECK(!forwarder.onOutgoingNack(nackHeader, *face2, pit1));
BOOST_CHECK_EQUAL(face2->sentNacks.size(), 0);
// send Nack with correct Nonce
@@ -534,7 +534,7 @@
face1->sentNacks.clear();
face2->sentNacks.clear();
- BOOST_CHECK(forwarder.onOutgoingNack(pit2, *face1, nackHeader));
+ BOOST_CHECK(forwarder.onOutgoingNack(nackHeader, *face1, pit2));
BOOST_REQUIRE_EQUAL(face1->sentNacks.size(), 1);
BOOST_CHECK_EQUAL(face1->sentNacks.back().getReason(), lp::NackReason::CONGESTION);
BOOST_CHECK_EQUAL(face1->sentNacks.back().getInterest().getNonce(), 152);
@@ -545,7 +545,7 @@
BOOST_CHECK(inRecord2a == pit2->in_end());
// send Nack with correct Nonce
- BOOST_CHECK(forwarder.onOutgoingNack(pit2, *face2, nackHeader));
+ BOOST_CHECK(forwarder.onOutgoingNack(nackHeader, *face2, pit2));
BOOST_CHECK_EQUAL(face1->sentNacks.size(), 1);
BOOST_REQUIRE_EQUAL(face2->sentNacks.size(), 1);
BOOST_CHECK_EQUAL(face2->sentNacks.back().getReason(), lp::NackReason::CONGESTION);
@@ -560,7 +560,7 @@
pit2->insertOrUpdateInRecord(*face3, *interest2c);
face3->sentNacks.clear();
- BOOST_CHECK(!forwarder.onOutgoingNack(pit2, *face3, nackHeader));
+ BOOST_CHECK(!forwarder.onOutgoingNack(nackHeader, *face3, pit2));
BOOST_CHECK_EQUAL(face3->sentNacks.size(), 0);
// don't send Nack to face with invalid ID
@@ -568,7 +568,7 @@
pit1->insertOrUpdateInRecord(*face4, *interest1b);
face4->sentNacks.clear();
- BOOST_CHECK(!forwarder.onOutgoingNack(pit1, *face4, nackHeader));
+ BOOST_CHECK(!forwarder.onOutgoingNack(nackHeader, *face4, pit1));
BOOST_CHECK_EQUAL(face4->sentNacks.size(), 0);
}
@@ -643,7 +643,6 @@
// interest should be forwarded only once, as long as Nonce is in Dead Nonce List
BOOST_ASSERT(25_ms * 40 < forwarder.getDeadNonceList().getLifetime());
this->advanceClocks(25_ms, 40);
-
BOOST_CHECK_EQUAL(face2->sentInterests.size(), 1);
// It's unnecessary to check that Interest with duplicate Nonce can be forwarded again
@@ -658,12 +657,12 @@
auto face1 = addFace();
auto interest = makeInterest("/hcLSAsQ9A", false, 2_s, 61883075);
- DeadNonceList& dnl = forwarder.getDeadNonceList();
+ auto& dnl = forwarder.getDeadNonceList();
dnl.add(interest->getName(), interest->getNonce());
- Pit& pit = forwarder.getPit();
- BOOST_REQUIRE_EQUAL(pit.size(), 0);
+ auto& pit = forwarder.getPit();
+ BOOST_CHECK_EQUAL(pit.size(), 0);
- forwarder.onIncomingInterest(FaceEndpoint(*face1, 0), *interest);
+ forwarder.onIncomingInterest(*interest, FaceEndpoint(*face1, 0));
this->advanceClocks(100_ms, 20_s);
BOOST_CHECK_EQUAL(pit.size(), 0);
}
@@ -674,7 +673,7 @@
auto data = makeData("/A");
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 0);
- forwarder.onIncomingData(FaceEndpoint(*face1, 0), *data);
+ forwarder.onIncomingData(*data, FaceEndpoint(*face1, 0));
this->advanceClocks(1_ms, 10_ms);
BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 1);
}
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index a75bf30..90e4b1e 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -87,7 +87,7 @@
auto pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 1);
@@ -98,7 +98,7 @@
pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face2, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face2, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2, 0), pitEntry);
// Since the interest is the same as the one sent out earlier, the PIT entry should not be
// rejected, as any data coming back must be able to satisfy the original interest from face 1
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
@@ -164,7 +164,7 @@
auto pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face3, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 2);
BOOST_TEST(didSendInterestTo(*face1));
@@ -180,7 +180,7 @@
std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
periodicalRetxFrom4 = [&] {
pitEntry->insertOrUpdateInRecord(*face3, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
if (nSent > nSentLast) {
@@ -208,7 +208,7 @@
auto pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 0);
}
@@ -228,7 +228,7 @@
auto interest = makeInterest("/t8ZiSOi3");
auto pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
// forwarded to faces 2 and 3
BOOST_TEST(strategy.sendInterestHistory.size() == 2);
@@ -243,7 +243,7 @@
interest->refreshNonce();
pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face2, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face2, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2, 0), pitEntry);
// forwarded only to face 1, suppressed on face 3
BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -257,7 +257,7 @@
interest->refreshNonce();
pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face3, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
// suppressed on face 1, forwarded on face 2 (and suppression window doubles)
BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -271,7 +271,7 @@
interest->refreshNonce();
pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face3, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
// forwarded only to face 1, suppressed on face 2
BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -285,7 +285,7 @@
interest->refreshNonce();
pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
// forwarded to faces 2 and 3
BOOST_TEST(strategy.sendInterestHistory.size() == 2);
@@ -304,7 +304,7 @@
auto pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 1);
@@ -492,12 +492,12 @@
auto interest = makeInterest("ndn:/localhop/H0D6i5fc");
auto pitEntry = this->pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*this->inFace1, *interest);
- this->strategy.afterReceiveInterest(FaceEndpoint(*this->inFace1, 0), *interest, pitEntry);
+ this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->inFace1, 0), pitEntry);
if (this->inFace2 != nullptr) {
auto interest2 = makeInterest("ndn:/localhop/H0D6i5fc");
pitEntry->insertOrUpdateInRecord(*this->inFace2, *interest2);
- this->strategy.afterReceiveInterest(FaceEndpoint(*this->inFace2, 0), *interest2, pitEntry);
+ this->strategy.afterReceiveInterest(*interest2, FaceEndpoint(*this->inFace2, 0), pitEntry);
}
this->strategy.sendInterestHistory.clear();
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index 4b5345e..099d031 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -62,10 +62,10 @@
}
void
- afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+ afterReceiveInterest(const Interest& interest, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry) override
{
- DummyStrategy::afterReceiveInterest(ingress, interest, pitEntry);
+ DummyStrategy::afterReceiveInterest(interest, ingress, pitEntry);
if (afterReceiveInterest_count <= 1) {
setExpiryTimer(pitEntry, 190_ms);
@@ -73,10 +73,21 @@
}
void
- beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override
+ afterContentStoreHit(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override
{
- DummyStrategy::beforeSatisfyInterest(pitEntry, ingress, data);
+ if (afterContentStoreHit_count == 0) {
+ setExpiryTimer(pitEntry, 190_ms);
+ }
+
+ DummyStrategy::afterContentStoreHit(data, ingress, pitEntry);
+ }
+
+ void
+ beforeSatisfyInterest(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override
+ {
+ DummyStrategy::beforeSatisfyInterest(data, ingress, pitEntry);
if (beforeSatisfyInterest_count <= 2) {
setExpiryTimer(pitEntry, 190_ms);
@@ -84,19 +95,8 @@
}
void
- afterContentStoreHit(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override
- {
- if (afterContentStoreHit_count == 0) {
- setExpiryTimer(pitEntry, 190_ms);
- }
-
- DummyStrategy::afterContentStoreHit(pitEntry, ingress, data);
- }
-
- void
- afterReceiveData(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override
+ afterReceiveData(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override
{
++afterReceiveData_count;
@@ -104,14 +104,14 @@
setExpiryTimer(pitEntry, 290_ms);
}
- this->sendDataToAll(pitEntry, ingress.face, data);
+ this->sendDataToAll(data, pitEntry, ingress.face);
}
void
- afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+ afterReceiveNack(const lp::Nack& nack, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry) override
{
- DummyStrategy::afterReceiveNack(ingress, nack, pitEntry);
+ DummyStrategy::afterReceiveNack(nack, ingress, pitEntry);
if (afterReceiveNack_count <= 1) {
setExpiryTimer(pitEntry, 50_ms);
diff --git a/tests/daemon/fw/random-strategy.t.cpp b/tests/daemon/fw/random-strategy.t.cpp
index 4822e4c..d2291c5 100644
--- a/tests/daemon/fw/random-strategy.t.cpp
+++ b/tests/daemon/fw/random-strategy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -78,22 +78,22 @@
// Send 1000 Interests
for (int i = 0; i < 1000; ++i) {
- shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA" + std::to_string(i));
- shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
+ auto interest = makeInterest("ndn:/BzgFBchqA" + std::to_string(i));
+ auto pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*face1, *interest);
- strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+ strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
}
- // Map outFaceId -> SentInterests.
- std::unordered_map<int, int> faceInterestMap;
+ // Map outFaceId -> SentInterests
+ std::unordered_map<FaceId, int> faceInterestMap;
for (const auto& i : strategy.sendInterestHistory) {
faceInterestMap[i.outFaceId]++;
}
// Check that all faces received at least 10 Interest
for (const auto& x : faceInterestMap) {
- BOOST_CHECK_GE(x.second, 10);
+ BOOST_TEST(x.second >= 10);
}
}
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index 5811652..9b5f588 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -108,7 +108,7 @@
pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
auto f = [&] {
- this->strategy.afterReceiveNack(FaceEndpoint(*this->face3, 0), nack3, pitEntry);
+ this->strategy.afterReceiveNack(nack3, FaceEndpoint(*this->face3, 0), pitEntry);
};
BOOST_REQUIRE(this->strategy.waitForAction(f, this->limitedIo, 2));
@@ -144,7 +144,7 @@
lp::Nack nack3 = makeNack(*interest1, lp::NackReason::CONGESTION);
pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
- this->strategy.afterReceiveNack(FaceEndpoint(*this->face3, 0), nack3, pitEntry);
+ this->strategy.afterReceiveNack(nack3, FaceEndpoint(*this->face3, 0), pitEntry);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0); // don't send Nack until all upstreams have Nacked
@@ -152,7 +152,7 @@
pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
auto f = [&] {
- this->strategy.afterReceiveNack(FaceEndpoint(*this->face4, 0), nack4, pitEntry);
+ this->strategy.afterReceiveNack(nack4, FaceEndpoint(*this->face4, 0), pitEntry);
};
BOOST_REQUIRE(this->strategy.waitForAction(f, this->limitedIo));
@@ -186,7 +186,7 @@
lp::Nack nack4 = makeNack(*interest2, lp::NackReason::CONGESTION);
pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
- this->strategy.afterReceiveNack(FaceEndpoint(*this->face4, 0), nack4, pitEntry);
+ this->strategy.afterReceiveNack(nack4, FaceEndpoint(*this->face4, 0), pitEntry);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0);
}
@@ -333,13 +333,13 @@
lp::Nack nack3 = makeNack(*interest1, Combination::getX());
pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
- strategy.afterReceiveNack(FaceEndpoint(*face3, 0), nack3, pitEntry);
+ strategy.afterReceiveNack(nack3, FaceEndpoint(*face3, 0), pitEntry);
BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0);
lp::Nack nack4 = makeNack(*interest1, Combination::getY());
pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
- strategy.afterReceiveNack(FaceEndpoint(*face4, 0), nack4, pitEntry);
+ strategy.afterReceiveNack(nack4, FaceEndpoint(*face4, 0), pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].pitInterest.wireEncode(),
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index 93a6367..cec64c4 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -165,7 +165,7 @@
pitEntry->insertOrUpdateInRecord(*this->face1, *interest);
auto f = [&] {
- this->strategy.afterReceiveInterest(FaceEndpoint(*this->face1, 0), *interest, pitEntry);
+ this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->face1, 0), pitEntry);
};
BOOST_REQUIRE(this->strategy.waitForAction(f, this->limitedIo, 2));
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 5c6c552..6fd052e 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -128,7 +128,7 @@
pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->localFace3, 0), *interest, pitEntry); },
+ [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3, 0), pitEntry); },
this->limitedIo));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 1);
@@ -147,7 +147,7 @@
pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->localFace3, 0), *interest, pitEntry); },
+ [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3, 0), pitEntry); },
this->limitedIo, T::willRejectPitEntry() + T::willSendNackNoRoute()));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
@@ -170,7 +170,7 @@
pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->localFace3, 0), *interest, pitEntry); },
+ [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3, 0), pitEntry); },
this->limitedIo));
BOOST_REQUIRE_EQUAL(this->strategy.sendInterestHistory.size(), 1);
@@ -190,7 +190,7 @@
pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->nonLocalFace1, 0), *interest, pitEntry); },
+ [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1, 0), pitEntry); },
this->limitedIo, T::willRejectPitEntry() + T::willSendNackNoRoute()));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
@@ -213,7 +213,7 @@
pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->nonLocalFace1, 0), *interest, pitEntry); },
+ [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1, 0), pitEntry); },
this->limitedIo));
BOOST_REQUIRE_EQUAL(this->strategy.sendInterestHistory.size(), 1);
@@ -236,7 +236,7 @@
pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveNack(FaceEndpoint(*this->localFace4, 0), nack, pitEntry); },
+ [&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4, 0), pitEntry); },
this->limitedIo, T::canProcessNack()));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
@@ -261,7 +261,7 @@
pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
BOOST_REQUIRE(this->strategy.waitForAction(
- [&] { this->strategy.afterReceiveNack(FaceEndpoint(*this->localFace4, 0), nack, pitEntry); },
+ [&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4, 0), pitEntry); },
this->limitedIo, T::canProcessNack()));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index b9ed2ff..03c2f77 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -103,8 +103,8 @@
protected:
pit::OutRecord*
- sendInterest(const shared_ptr<pit::Entry>& pitEntry, Face& egress,
- const Interest& interest) override
+ sendInterest(const Interest& interest, Face& egress,
+ const shared_ptr<pit::Entry>& pitEntry) override
{
sendInterestHistory.push_back({pitEntry->getInterest(), egress.getId(), interest});
auto it = pitEntry->insertOrUpdateOutRecord(egress, interest);
@@ -121,8 +121,8 @@
}
bool
- sendNack(const shared_ptr<pit::Entry>& pitEntry, Face& egress,
- const lp::NackHeader& header) override
+ sendNack(const lp::NackHeader& header, Face& egress,
+ const shared_ptr<pit::Entry>& pitEntry) override
{
sendNackHistory.push_back({pitEntry->getInterest(), egress.getId(), header});
pitEntry->deleteInRecord(egress);
diff --git a/tests/daemon/fw/unsolicited-data-policy.t.cpp b/tests/daemon/fw/unsolicited-data-policy.t.cpp
index 21894ca..bc95d4f 100644
--- a/tests/daemon/fw/unsolicited-data-policy.t.cpp
+++ b/tests/daemon/fw/unsolicited-data-policy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -94,18 +94,18 @@
template<typename Policy, bool shouldAdmitLocal, bool shouldAdmitNonLocal>
struct FaceScopePolicyTest
{
- typedef Policy PolicyType;
- typedef std::integral_constant<bool, shouldAdmitLocal> ShouldAdmitLocal;
- typedef std::integral_constant<bool, shouldAdmitNonLocal> ShouldAdmitNonLocal;
+ using PolicyType = Policy;
+ using ShouldAdmitLocal = std::integral_constant<bool, shouldAdmitLocal>;
+ using ShouldAdmitNonLocal = std::integral_constant<bool, shouldAdmitNonLocal>;
};
-typedef boost::mpl::vector<
+using FaceScopePolicyTests = boost::mpl::vector<
FaceScopePolicyTest<void, false, false>, // default policy
FaceScopePolicyTest<DropAllUnsolicitedDataPolicy, false, false>,
FaceScopePolicyTest<AdmitLocalUnsolicitedDataPolicy, true, false>,
FaceScopePolicyTest<AdmitNetworkUnsolicitedDataPolicy, false, true>,
FaceScopePolicyTest<AdmitAllUnsolicitedDataPolicy, true, true>
-> FaceScopePolicyTests;
+>;
BOOST_AUTO_TEST_CASE_TEMPLATE(FaceScopePolicy, T, FaceScopePolicyTests)
{
@@ -115,16 +115,16 @@
ndn::nfd::FACE_SCOPE_LOCAL);
faceTable.add(face1);
- shared_ptr<Data> data1 = makeData("/unsolicited-from-local");
- forwarder.onIncomingData(FaceEndpoint(*face1, 0), *data1);
+ auto data1 = makeData("/unsolicited-from-local");
+ forwarder.onIncomingData(*data1, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(isInCs(*data1), T::ShouldAdmitLocal::value);
auto face2 = make_shared<DummyFace>("dummy://", "dummy://",
ndn::nfd::FACE_SCOPE_NON_LOCAL);
faceTable.add(face2);
- shared_ptr<Data> data2 = makeData("/unsolicited-from-non-local");
- forwarder.onIncomingData(FaceEndpoint(*face2, 0), *data2);
+ auto data2 = makeData("/unsolicited-from-non-local");
+ forwarder.onIncomingData(*data2, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(isInCs(*data2), T::ShouldAdmitNonLocal::value);
}