Upgrade underlying NFD/ndn-cxx to version 0.6.5
Change-Id: If83629472f737c017bbd9109fe814a5d5ecc44d4
diff --git a/tests/unit-tests/NFD/ncc.t.cpp b/tests/unit-tests/NFD/ncc.t.cpp
index e53e00e..9884292 100644
--- a/tests/unit-tests/NFD/ncc.t.cpp
+++ b/tests/unit-tests/NFD/ncc.t.cpp
@@ -60,7 +60,7 @@
addApps({
{"A1", "ns3::ndn::ConsumerCbr",
{{"Prefix", "/prefix"}, {"Frequency", "1000"}},
- "0s", "5s"},
+ "0.1s", "1.1s"},
{"A3", "ns3::ndn::Producer",
{{"Prefix", "/prefix"}, {"PayloadSize", "1024"}},
"0s", "10s"},
@@ -79,11 +79,11 @@
Simulator::Stop(Seconds(5.2));
BOOST_CHECK_NO_THROW(Simulator::Run());
- BOOST_CHECK_EQUAL(getFace("A1", "A2")->getCounters().nOutInterests, 5000);
- BOOST_CHECK_EQUAL(getFace("A2", "A3")->getCounters().nOutInterests, 5000);
+ BOOST_CHECK_EQUAL(getFace("A1", "A2")->getCounters().nOutInterests, 1000);
+ BOOST_CHECK_EQUAL(getFace("A2", "A3")->getCounters().nOutInterests, 1000);
- BOOST_CHECK_EQUAL(getFace("A3", "A2")->getCounters().nOutData, 5000);
- BOOST_CHECK_EQUAL(getFace("A2", "A1")->getCounters().nOutData, 5000);
+ BOOST_CHECK_EQUAL(getFace("A3", "A2")->getCounters().nOutData, 1000);
+ BOOST_CHECK_EQUAL(getFace("A2", "A1")->getCounters().nOutData, 1000);
}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/unit-tests/helper/ndn-face-container.t.cpp b/tests/unit-tests/helper/ndn-face-container.t.cpp
deleted file mode 100644
index 4129cbc..0000000
--- a/tests/unit-tests/helper/ndn-face-container.t.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2011-2015 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 "helper/ndn-face-container.hpp"
-
-#include "ns3/node-container.h"
-#include "ns3/point-to-point-net-device.h"
-#include "ns3/node.h"
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/ndnSIM-module.h"
-
-#include "NFD/daemon/face/null-face.hpp"
-
-#include "../tests-common.hpp"
-
-namespace ns3 {
-namespace ndn {
-
-BOOST_FIXTURE_TEST_SUITE(HelperNdnFaceContainer, CleanupFixture)
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- FaceContainer c1;
- BOOST_CHECK_EQUAL(c1.GetN(), 0);
-
- c1.Add(nfd::face::makeNullFace(FaceUri("null://1")));
- BOOST_CHECK_EQUAL(c1.GetN(), 1);
-
- c1.Add(nfd::face::makeNullFace(FaceUri("null://2")));
- BOOST_CHECK_EQUAL(c1.GetN(), 2);
-
- FaceContainer c2(c1);
- BOOST_CHECK_EQUAL(c2.GetN(), c1.GetN());
-
- FaceContainer c3;
- BOOST_CHECK_EQUAL(c3.GetN(), 0);
-
- c3 = c1;
- BOOST_CHECK_EQUAL(c3.GetN(), c1.GetN());
-
- for (size_t i = 0; i < c1.GetN(); ++i) {
- BOOST_CHECK_EQUAL(c1.Get(i)->getLocalUri(), c2.Get(i)->getLocalUri());
- BOOST_CHECK_EQUAL(c1.Get(i)->getLocalUri(), c3.Get(i)->getLocalUri());
- }
-
- size_t pos = 0;
- for (FaceContainer::Iterator i = c1.Begin(); i != c1.End(); ++i, ++pos) {
- BOOST_CHECK_EQUAL((*i)->getLocalUri(), c2.Get(pos)->getLocalUri());
- BOOST_CHECK_EQUAL((*i)->getLocalUri(), c3.Get(pos)->getLocalUri());
- }
-}
-
-BOOST_AUTO_TEST_CASE(AddAll)
-{
- FaceContainer c1;
- c1.Add(nfd::face::makeNullFace(FaceUri("null://1")));
- c1.Add(nfd::face::makeNullFace(FaceUri("null://2")));
-
- FaceContainer c2(c1);
- c2.AddAll(c1);
- BOOST_CHECK_EQUAL(c2.GetN(), 4);
-
- FaceContainer c3(c1);
- c3.AddAll(c3);
- BOOST_CHECK_EQUAL(c3.GetN(), 4);
-
- Ptr<FaceContainer> c4 = Create<FaceContainer>(c1);
- c4->AddAll(c4);
-
- BOOST_CHECK_EQUAL_COLLECTIONS(c2.Begin(), c2.Begin() + c1.GetN(),
- c1.Begin(), c1.End());
-
- BOOST_CHECK_EQUAL_COLLECTIONS(c2.Begin() + c1.GetN(), c2.End(),
- c1.Begin(), c1.End());
-
- BOOST_CHECK_EQUAL_COLLECTIONS(c2.Begin(), c2.End(), c3.Begin(), c3.End());
- BOOST_CHECK_EQUAL_COLLECTIONS(c2.Begin(), c2.End(), c4->Begin(), c4->End());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace ndn
-} // namespace ns3
diff --git a/tests/unit-tests/helper/ndn-network-region-table-helper.t.cpp b/tests/unit-tests/helper/ndn-network-region-table-helper.t.cpp
index 41f2057..868b9dc 100644
--- a/tests/unit-tests/helper/ndn-network-region-table-helper.t.cpp
+++ b/tests/unit-tests/helper/ndn-network-region-table-helper.t.cpp
@@ -155,6 +155,7 @@
{
FactoryCallbackApp::Install(getNode("1"), [this] () -> shared_ptr<void> {
Interest i("/prefix/someData");
+ i.setCanBePrefix(false);
i.setForwardingHint(makeHint(Name("/otherPrefix")));
return make_shared<TesterApp>(i, this);
})
@@ -174,6 +175,7 @@
FactoryCallbackApp::Install(getNode("1"), [this] () -> shared_ptr<void> {
Interest i("/prefix/someData");
+ i.setCanBePrefix(false);
i.setForwardingHint(makeHint(Name("/otherPrefix")));
return make_shared<TesterApp>(i, this);
})
@@ -193,6 +195,7 @@
FactoryCallbackApp::Install(getNode("1"), [this] () -> shared_ptr<void> {
Interest i("/prefix/someData");
+ i.setCanBePrefix(false);
i.setForwardingHint(makeHint(Name("/otherPrefix")));
return make_shared<TesterApp>(i, this);
})
@@ -212,6 +215,7 @@
FactoryCallbackApp::Install(getNode("1"), [this] () -> shared_ptr<void> {
Interest i("/prefix/someData");
+ i.setCanBePrefix(false);
i.setForwardingHint(makeHint(Name("/otherPrefix/moreSpecific")));
return make_shared<TesterApp>(i, this);
})
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 a539141..cbcec2e 100644
--- a/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
+++ b/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
@@ -66,10 +66,10 @@
addApps({
{"A1", "ns3::ndn::ConsumerCbr",
{{"Prefix", "/prefix"}, {"Frequency", "1"}},
- "0s", "100s"},
+ "0.1s", "100s"},
{"A2", "ns3::ndn::ConsumerCbr",
{{"Prefix", "/prefix"}, {"Frequency", "1"}},
- "0s", "100s"},
+ "0.1s", "100s"},
});
}
};
@@ -78,7 +78,7 @@
BOOST_AUTO_TEST_CASE(DefaultStrategies)
{
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 0);
@@ -94,7 +94,7 @@
{
StrategyChoiceHelper::Install(getNode("A2"), "/prefix", "/localhost/nfd/strategy/multicast");
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 0);
@@ -114,7 +114,7 @@
StrategyChoiceHelper::Install(nodes, "/prefix", "/localhost/nfd/strategy/multicast");
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 5);
@@ -130,7 +130,7 @@
{
StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/multicast");
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 5);
@@ -171,7 +171,7 @@
{
StrategyChoiceHelper::Install<NullStrategy>(getNode("A2"), "/prefix");
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 0);
@@ -192,7 +192,7 @@
StrategyChoiceHelper::Install<NullStrategy>(nodes, "/prefix");
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 0);
@@ -209,7 +209,7 @@
{
StrategyChoiceHelper::InstallAll<NullStrategy>("/prefix");
- Simulator::Stop(Seconds(5.0));
+ Simulator::Stop(Seconds(5));
Simulator::Run();
BOOST_CHECK_EQUAL(getFace("A1", "B1")->getCounters().nOutInterests, 0);
diff --git a/tests/unit-tests/model/ndn-block-header.t.cpp b/tests/unit-tests/model/ndn-block-header.t.cpp
index a8e10a9..5dc65f1 100644
--- a/tests/unit-tests/model/ndn-block-header.t.cpp
+++ b/tests/unit-tests/model/ndn-block-header.t.cpp
@@ -51,6 +51,7 @@
{
Interest interest("/prefix");
interest.setNonce(10);
+ interest.setCanBePrefix(true);
lp::Packet lpPacket(interest.wireEncode());
nfd::face::Transport::Packet packet(lpPacket.wireEncode());
BlockHeader header(packet);
@@ -91,6 +92,7 @@
{
Interest interest("/prefix");
interest.setNonce(10);
+ interest.setCanBePrefix(true);
lp::Packet lpPacket;
lpPacket.add<::ndn::lp::SequenceField>(0); // to make sure that the NDNLP header is added
diff --git a/tests/unit-tests/model/ndn-l3-protocol.t.cpp b/tests/unit-tests/model/ndn-l3-protocol.t.cpp
index b8e51b8..cbfba58 100644
--- a/tests/unit-tests/model/ndn-l3-protocol.t.cpp
+++ b/tests/unit-tests/model/ndn-l3-protocol.t.cpp
@@ -62,6 +62,7 @@
return make_shared<TesterApp>([this] (::ndn::Face& face) {
for (const Name& dataset : requestedDatasets) {
Interest i(dataset);
+ i.setCanBePrefix(true);
face.expressInterest(i, [&] (const Interest& i, const Data& data) {
BOOST_TEST_MESSAGE(data.getName());
receivedDatasets.insert(data.getName().getPrefix(-2));
@@ -93,34 +94,6 @@
receivedDatasets.begin(), receivedDatasets.end());
}
-BOOST_AUTO_TEST_CASE(DisabledRibManager)
-{
- // Disable RIB manager
- disableRibManager();
-
- setupAndRun();
-
- BOOST_CHECK_EQUAL(requestedDatasets.size(), receivedDatasets.size() + 1);
-
- requestedDatasets.erase("/localhost/nfd/rib/list");
- BOOST_CHECK_EQUAL_COLLECTIONS(requestedDatasets.begin(), requestedDatasets.end(),
- receivedDatasets.begin(), receivedDatasets.end());
-}
-
-// BOOST_AUTO_TEST_CASE(DisabledFaceManager)
-// {
-// // Disable Face manager
-// disableFaceManager();
-
-// setupAndRun();
-
-// BOOST_CHECK_EQUAL(requestedDatasets.size(), receivedDatasets.size() + 1);
-
-// requestedDatasets.erase("/localhost/nfd/faces/list");
-// BOOST_CHECK_EQUAL_COLLECTIONS(requestedDatasets.begin(), requestedDatasets.end(),
-// receivedDatasets.begin(), receivedDatasets.end());
-// }
-
BOOST_AUTO_TEST_CASE(DisabledStrategyChoiceManager)
{
// Disable Strategy Choice Manager manager
diff --git a/tests/unit-tests/ndn-cxx/face.t.cpp b/tests/unit-tests/ndn-cxx/face.t.cpp
index f062728..6eb39c2 100644
--- a/tests/unit-tests/ndn-cxx/face.t.cpp
+++ b/tests/unit-tests/ndn-cxx/face.t.cpp
@@ -19,7 +19,6 @@
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/util/scheduler.hpp>
-#include <ndn-cxx/util/scheduler-scoped-event-id.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include "ns3/ndnSIM/helper/ndn-app-helper.hpp"
@@ -112,7 +111,7 @@
SingleInterest(const Name& name, const std::function<void(const Data&)>& onData,
const VoidCallback& onNack, const VoidCallback& onTimeout)
{
- m_face.expressInterest(Interest(name), std::bind([onData] (const Data& data) {
+ m_face.expressInterest(Interest(name).setCanBePrefix(true), std::bind([onData] (const Data& data) {
onData(data);
}, _2),
std::bind(onNack),
@@ -209,7 +208,6 @@
MultipleInterest(const Name& name, const NameCallback& onData, const VoidCallback& onTimeout,
const VoidCallback& onNack)
: m_scheduler(m_face.getIoService())
- , m_event(m_scheduler)
{
expressNextInterest(name, 0, onData, onTimeout, onNack);
}
@@ -219,7 +217,7 @@
expressNextInterest(const Name& name, uint32_t seqNo, const NameCallback& onData,
const VoidCallback& onTimeout, const VoidCallback& onNack)
{
- m_face.expressInterest(Interest(Name(name).appendSegment(seqNo)), std::bind([=] (const Data& data) {
+ 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),
@@ -267,7 +265,7 @@
public:
SingleInterestWithFaceShutdown()
{
- m_face.expressInterest(Interest(Name("/interest/to/timeout")),
+ m_face.expressInterest(Interest(Name("/interest/to/timeout")).setCanBePrefix(true),
std::bind([] {
BOOST_ERROR("Unexpected response");
}),
diff --git a/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp b/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
index 953eec1..7150139 100644
--- a/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
+++ b/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
@@ -89,12 +89,12 @@
BOOST_CHECK_EQUAL(buffer.str(),
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
-0.0417888 1 0 0 LastDelay 0.0417888 41788.8 1 2
-0.0417888 1 0 0 FullDelay 0.0417888 41788.8 1 2
+0.0417968 1 0 0 LastDelay 0.0417968 41796.8 1 2
+0.0417968 1 0 0 FullDelay 0.0417968 41796.8 1 2
2 2 0 0 LastDelay 0 0 1 0
2 2 0 0 FullDelay 0 0 1 0
-3.02089 2 0 1 LastDelay 0.0208944 20894.4 1 1
-3.02089 2 0 1 FullDelay 0.0208944 20894.4 1 1
+3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
+3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
)STR");
}
@@ -116,8 +116,8 @@
BOOST_CHECK_EQUAL(buffer.str(),
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
-0.0417888 1 0 0 LastDelay 0.0417888 41788.8 1 2
-0.0417888 1 0 0 FullDelay 0.0417888 41788.8 1 2
+0.0417968 1 0 0 LastDelay 0.0417968 41796.8 1 2
+0.0417968 1 0 0 FullDelay 0.0417968 41796.8 1 2
)STR");
}
@@ -138,8 +138,8 @@
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
2 2 0 0 LastDelay 0 0 1 0
2 2 0 0 FullDelay 0 0 1 0
-3.02089 2 0 1 LastDelay 0.0208944 20894.4 1 1
-3.02089 2 0 1 FullDelay 0.0208944 20894.4 1 1
+3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
+3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
)STR");
}
@@ -156,8 +156,8 @@
BOOST_CHECK(output->is_equal(
R"STR(2 2 0 0 LastDelay 0 0 1 0
2 2 0 0 FullDelay 0 0 1 0
-3.02089 2 0 1 LastDelay 0.0208944 20894.4 1 1
-3.02089 2 0 1 FullDelay 0.0208944 20894.4 1 1
+3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
+3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
)STR"));
}
diff --git a/tests/unit-tests/utils/tracers/ndn-l3-rate-tracer.t.cpp b/tests/unit-tests/utils/tracers/ndn-l3-rate-tracer.t.cpp
index ef000de..1a23ae4 100644
--- a/tests/unit-tests/utils/tracers/ndn-l3-rate-tracer.t.cpp
+++ b/tests/unit-tests/utils/tracers/ndn-l3-rate-tracer.t.cpp
@@ -86,7 +86,7 @@
<< "1 1 1 internal:// OutNacks 0 0 0 0\n"
<< "1 1 1 internal:// InSatisfiedInterests 0 0 0 0\n"
<< "1 1 1 internal:// InTimedOutInterests 0 0 0 0\n"
- << "1 1 1 internal:// OutSatisfiedInterests 2.4 0 3 0\n"
+ << "1 1 1 internal:// OutSatisfiedInterests 4 0 5 0\n"
<< "1 1 1 internal:// OutTimedOutInterests 0 0 0 0\n";
BOOST_CHECK(os.match_pattern());
@@ -96,7 +96,7 @@
<< "1 1 256 internal:// OutData 0 0 0 0\n"
<< "1 1 256 internal:// InNacks 0 0 0 0\n"
<< "1 1 256 internal:// OutNacks 0 0 0 0\n"
- << "1 1 256 internal:// InSatisfiedInterests 2.4 0 3 0\n"
+ << "1 1 256 internal:// InSatisfiedInterests 4 0 5 0\n"
<< "1 1 256 internal:// InTimedOutInterests 0 0 0 0\n"
<< "1 1 256 internal:// OutSatisfiedInterests 0 0 0 0\n"
<< "1 1 256 internal:// OutTimedOutInterests 0 0 0 0\n";
@@ -114,7 +114,7 @@
<< "1 1 257 appFace:// OutTimedOutInterests 0 0 0 0\n";
BOOST_CHECK(os.match_pattern());
- os << "1 1 -1 all SatisfiedInterests 2.4 0 3 0\n"
+ os << "1 1 -1 all SatisfiedInterests 4 0 5 0\n"
<< "1 1 -1 all TimedOutInterests 0.8 0 1 0\n";
BOOST_CHECK(os.match_pattern());
}