face: Implementing new "isOnDemand" flag
This flags replaces isPermanent flag in datagram faces, but with the
reversed logic (isPermanent = !isOnDemand)
Change-Id: I37ba604e5f105ca95a79a08b8cfc3d640df8b412
Refs: #1376
diff --git a/tests/face/ethernet.cpp b/tests/face/ethernet.cpp
index 2e731bf..4859da2 100644
--- a/tests/face/ethernet.cpp
+++ b/tests/face/ethernet.cpp
@@ -74,6 +74,8 @@
factory.createMulticastFace(interfaces[0], ethernet::getDefaultMulticastAddress());
BOOST_REQUIRE(static_cast<bool>(face));
+
+ BOOST_CHECK(!face->isOnDemand());
BOOST_CHECK_EQUAL(face->isLocal(), false);
BOOST_CHECK_EQUAL(face->getUri().toString(),
"ether://" + interfaces[0] + "/" +
diff --git a/tests/face/tcp.cpp b/tests/face/tcp.cpp
index 38ee797..d908804 100644
--- a/tests/face/tcp.cpp
+++ b/tests/face/tcp.cpp
@@ -182,6 +182,9 @@
BOOST_REQUIRE(static_cast<bool>(m_face1));
BOOST_REQUIRE(static_cast<bool>(m_face2));
+ BOOST_CHECK(m_face1->isOnDemand());
+ BOOST_CHECK(!m_face2->isOnDemand());
+
BOOST_CHECK_EQUAL(m_face2->getUri().toString(), "tcp4://127.0.0.1:20070");
// face1 has an unknown URI, since the source port is automatically chosen by OS
diff --git a/tests/face/udp.cpp b/tests/face/udp.cpp
index d4983bf..ea9d1cc 100644
--- a/tests/face/udp.cpp
+++ b/tests/face/udp.cpp
@@ -839,6 +839,7 @@
"UdpChannel error: cannot connect or cannot accept connection");
m_face2->sendInterest(interest1);
+ BOOST_CHECK(!m_face2->isOnDemand());
BOOST_CHECK_MESSAGE(m_limitedIo.run(2,//1 send + 1 listen return
time::seconds(1)) == LimitedIo::EXCEED_OPS,
@@ -865,6 +866,7 @@
BOOST_CHECK_EQUAL(channel1->size(), 1);
BOOST_CHECK_EQUAL(channel2->size(), 1);
BOOST_REQUIRE(static_cast<bool>(m_face1));
+ BOOST_CHECK(m_face1->isOnDemand());
channel1->connect("127.0.0.1", "20071",
bind(&EndToEndFixture::channel1_onFaceCreatedNoCheck, this, _1),
@@ -873,6 +875,8 @@
BOOST_CHECK_MESSAGE(m_limitedIo.run(1,//1 connect
time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect");
+
+ BOOST_CHECK(!m_face1->isOnDemand());
//the connect should have set m_face1 as permanent face,
//but it shouln't have created any additional faces
diff --git a/tests/mgmt/face-manager.cpp b/tests/mgmt/face-manager.cpp
index cca3671..45a609f 100644
--- a/tests/mgmt/face-manager.cpp
+++ b/tests/mgmt/face-manager.cpp
@@ -1039,7 +1039,8 @@
ndn::nfd::FaceEventNotification expectedFaceEvent(ndn::nfd::FACE_EVENT_CREATED,
1,
- dummy->getUri().toString());
+ dummy->getUri().toString(),
+ 0);
Block encodedResultOptions(resultOptions.wireEncode());
@@ -1099,7 +1100,7 @@
ndn::nfd::FaceEventNotification expectedFaceEvent(ndn::nfd::FACE_EVENT_DESTROYED,
dummy->getId(),
- dummy->getUri().toString());
+ dummy->getUri().toString(), 0);
getFace()->onReceiveData +=
bind(&FaceFixture::callbackDispatch, this, _1,