face: Face::getLocalUri
refs #1396
Change-Id: Icf02ae0a4136b6da3f6388cdce2f861bec44e940
diff --git a/tests/face/dummy-face.hpp b/tests/face/dummy-face.hpp
index 4e4bb57..9c7252c 100644
--- a/tests/face/dummy-face.hpp
+++ b/tests/face/dummy-face.hpp
@@ -21,7 +21,7 @@
{
public:
DummyFaceImpl()
- : FaceBase(FaceUri("dummy://"))
+ : FaceBase(FaceUri("dummy://"), FaceUri("dummy://"))
{
}
diff --git a/tests/face/ethernet.cpp b/tests/face/ethernet.cpp
index 12eef0f..1224ee0 100644
--- a/tests/face/ethernet.cpp
+++ b/tests/face/ethernet.cpp
@@ -99,9 +99,10 @@
BOOST_CHECK(!face->isOnDemand());
BOOST_CHECK_EQUAL(face->isLocal(), false);
- BOOST_CHECK_EQUAL(face->getUri().toString(),
- "ether://" + m_interfaces.front()->name + "/" +
- ethernet::getDefaultMulticastAddress().toString(':'));
+ BOOST_CHECK_EQUAL(face->getRemoteUri().toString(),
+ "ether://" + ethernet::getDefaultMulticastAddress().toString(':'));
+ BOOST_CHECK_EQUAL(face->getLocalUri().toString(),
+ "dev://" + m_interfaces.front()->name);
Interest interest1("ndn:/TpnzGvW9R");
Data data1 ("ndn:/KfczhUqVix");
diff --git a/tests/face/tcp.cpp b/tests/face/tcp.cpp
index 6fe74e4..b98107e 100644
--- a/tests/face/tcp.cpp
+++ b/tests/face/tcp.cpp
@@ -38,16 +38,16 @@
void
channel1_onFaceCreated(const shared_ptr<Face>& newFace)
{
- BOOST_CHECK(!static_cast<bool>(m_face1));
- m_face1 = newFace;
- m_face1->onReceiveInterest +=
+ BOOST_CHECK(!static_cast<bool>(face1));
+ face1 = newFace;
+ face1->onReceiveInterest +=
bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- m_face1->onReceiveData +=
+ face1->onReceiveData +=
bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- m_face1->onFail +=
+ face1->onFail +=
bind(&EndToEndFixture::face1_onFail, this);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
@@ -55,45 +55,45 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onReceiveInterest(const Interest& interest)
{
- m_face1_receivedInterests.push_back(interest);
+ face1_receivedInterests.push_back(interest);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onReceiveData(const Data& data)
{
- m_face1_receivedDatas.push_back(data);
+ face1_receivedDatas.push_back(data);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onFail()
{
- m_face1.reset();
- m_limitedIo.afterOp();
+ face1.reset();
+ limitedIo.afterOp();
}
void
channel2_onFaceCreated(const shared_ptr<Face>& newFace)
{
- BOOST_CHECK(!static_cast<bool>(m_face2));
- m_face2 = newFace;
- m_face2->onReceiveInterest +=
+ BOOST_CHECK(!static_cast<bool>(face2));
+ face2 = newFace;
+ face2->onReceiveInterest +=
bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- m_face2->onReceiveData +=
+ face2->onReceiveData +=
bind(&EndToEndFixture::face2_onReceiveData, this, _1);
- m_face2->onFail +=
+ face2->onFail +=
bind(&EndToEndFixture::face2_onFail, this);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
@@ -101,37 +101,37 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onReceiveInterest(const Interest& interest)
{
- m_face2_receivedInterests.push_back(interest);
+ face2_receivedInterests.push_back(interest);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onReceiveData(const Data& data)
{
- m_face2_receivedDatas.push_back(data);
+ face2_receivedDatas.push_back(data);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onFail()
{
- m_face2.reset();
- m_limitedIo.afterOp();
+ face2.reset();
+ limitedIo.afterOp();
}
void
channel_onFaceCreated(const shared_ptr<Face>& newFace)
{
- m_faces.push_back(newFace);
- m_limitedIo.afterOp();
+ faces.push_back(newFace);
+ limitedIo.afterOp();
}
void
@@ -139,26 +139,26 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
checkFaceList(size_t shouldBe)
{
- BOOST_CHECK_EQUAL(m_faces.size(), shouldBe);
+ BOOST_CHECK_EQUAL(faces.size(), shouldBe);
}
public:
- LimitedIo m_limitedIo;
+ LimitedIo limitedIo;
- shared_ptr<Face> m_face1;
- std::vector<Interest> m_face1_receivedInterests;
- std::vector<Data> m_face1_receivedDatas;
- shared_ptr<Face> m_face2;
- std::vector<Interest> m_face2_receivedInterests;
- std::vector<Data> m_face2_receivedDatas;
+ shared_ptr<Face> face1;
+ std::vector<Interest> face1_receivedInterests;
+ std::vector<Data> face1_receivedDatas;
+ shared_ptr<Face> face2;
+ std::vector<Interest> face2_receivedInterests;
+ std::vector<Data> face2_receivedDatas;
- std::list< shared_ptr<Face> > m_faces;
+ std::list< shared_ptr<Face> > faces;
};
@@ -180,23 +180,24 @@
bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot connect or cannot accept connection");
- BOOST_REQUIRE(static_cast<bool>(m_face1));
- BOOST_REQUIRE(static_cast<bool>(m_face2));
+ BOOST_REQUIRE(static_cast<bool>(face1));
+ BOOST_REQUIRE(static_cast<bool>(face2));
- BOOST_CHECK(m_face1->isOnDemand());
- BOOST_CHECK(!m_face2->isOnDemand());
+ BOOST_CHECK(face1->isOnDemand());
+ BOOST_CHECK(!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
+ BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "tcp4://127.0.0.1:20070");
+ BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "tcp4://127.0.0.1:20070");
+ // face1 has an unknown remoteUri, since the source port is automatically chosen by OS
- BOOST_CHECK_EQUAL(m_face1->isLocal(), true);
- BOOST_CHECK_EQUAL(m_face2->isLocal(), true);
+ BOOST_CHECK_EQUAL(face1->isLocal(), true);
+ BOOST_CHECK_EQUAL(face2->isLocal(), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(m_face1)), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(m_face2)), true);
+ BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
+ BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
// integrated tests needs to check that TcpFace for non-loopback fails these tests...
@@ -214,36 +215,36 @@
data1.setSignature(fakeSignature);
data2.setSignature(fakeSignature);
- m_face1->sendInterest(interest1);
- m_face1->sendInterest(interest1);
- m_face1->sendInterest(interest1);
- m_face1->sendData (data1 );
- m_face2->sendInterest(interest2);
- m_face2->sendData (data2 );
- m_face2->sendData (data2 );
- m_face2->sendData (data2 );
+ face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
+ face1->sendData (data1 );
+ face2->sendInterest(interest2);
+ face2->sendData (data2 );
+ face2->sendData (data2 );
+ face2->sendData (data2 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(8, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+ BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
- const FaceCounters& counters1 = m_face1->getCounters();
+ const FaceCounters& counters1 = face1->getCounters();
BOOST_CHECK_EQUAL(counters1.getInInterest() , 1);
BOOST_CHECK_EQUAL(counters1.getInData() , 3);
BOOST_CHECK_EQUAL(counters1.getOutInterest(), 3);
BOOST_CHECK_EQUAL(counters1.getOutData() , 1);
- const FaceCounters& counters2 = m_face2->getCounters();
+ const FaceCounters& counters2 = face2->getCounters();
BOOST_CHECK_EQUAL(counters2.getInInterest() , 3);
BOOST_CHECK_EQUAL(counters2.getInData() , 1);
BOOST_CHECK_EQUAL(counters2.getOutInterest(), 1);
@@ -264,20 +265,21 @@
bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot connect or cannot accept connection");
- BOOST_REQUIRE(static_cast<bool>(m_face1));
- BOOST_REQUIRE(static_cast<bool>(m_face2));
+ BOOST_REQUIRE(static_cast<bool>(face1));
+ BOOST_REQUIRE(static_cast<bool>(face2));
- BOOST_CHECK_EQUAL(m_face2->getUri().toString(), "tcp6://[::1]:20070");
- // face1 has an unknown URI, since the source port is automatically chosen by OS
+ BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "tcp6://[::1]:20070");
+ BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "tcp6://[::1]:20070");
+ // face1 has an unknown remoteUri, since the source port is automatically chosen by OS
- BOOST_CHECK_EQUAL(m_face1->isLocal(), true);
- BOOST_CHECK_EQUAL(m_face2->isLocal(), true);
+ BOOST_CHECK_EQUAL(face1->isLocal(), true);
+ BOOST_CHECK_EQUAL(face2->isLocal(), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(m_face1)), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(m_face2)), true);
+ BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
+ BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
// integrated tests needs to check that TcpFace for non-loopback fails these tests...
@@ -295,24 +297,24 @@
data1.setSignature(fakeSignature);
data2.setSignature(fakeSignature);
- m_face1->sendInterest(interest1);
- m_face1->sendData (data1 );
- m_face2->sendInterest(interest2);
- m_face2->sendData (data2 );
+ face1->sendInterest(interest1);
+ face1->sendData (data1 );
+ face2->sendInterest(interest2);
+ face2->sendData (data2 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(4, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+ BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
}
BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
@@ -330,11 +332,11 @@
bind(&EndToEndFixture::channel_onConnectFailed, this, _1),
time::seconds(4)); // very short timeout
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot connect or cannot accept connection");
- BOOST_CHECK_EQUAL(m_faces.size(), 2);
+ BOOST_CHECK_EQUAL(faces.size(), 2);
shared_ptr<TcpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
channel3->connect("127.0.0.1", "20070",
@@ -359,11 +361,11 @@
scheduler::schedule(time::milliseconds(500),
bind(&EndToEndFixture::checkFaceList, this, 4));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(4,// 2 connects and 2 accepts
+ BOOST_CHECK_MESSAGE(limitedIo.run(4,// 2 connects and 2 accepts
time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot connect or cannot accept multiple connections");
- BOOST_CHECK_EQUAL(m_faces.size(), 6);
+ BOOST_CHECK_EQUAL(faces.size(), 6);
}
@@ -382,24 +384,24 @@
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1),
time::seconds(4)); // very short timeout
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"TcpChannel error: cannot connect or cannot accept connection");
BOOST_CHECK_EQUAL(channel1->size(), 1);
BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_REQUIRE(static_cast<bool>(m_face1));
- BOOST_CHECK(static_cast<bool>(m_face2));
+ BOOST_REQUIRE(static_cast<bool>(face1));
+ BOOST_CHECK(static_cast<bool>(face2));
// Face::close must be invoked during io run to be counted as an op
- scheduler::schedule(time::milliseconds(100), bind(&Face::close, m_face1));
+ scheduler::schedule(time::milliseconds(100), bind(&Face::close, face1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
"FaceClosing error: cannot properly close faces");
// both faces should get closed
- BOOST_CHECK(!static_cast<bool>(m_face1));
- BOOST_CHECK(!static_cast<bool>(m_face2));
+ BOOST_CHECK(!static_cast<bool>(face1));
+ BOOST_CHECK(!static_cast<bool>(face2));
BOOST_CHECK_EQUAL(channel1->size(), 0);
BOOST_CHECK_EQUAL(channel2->size(), 0);
diff --git a/tests/face/udp.cpp b/tests/face/udp.cpp
index ea9d1cc..157602d 100644
--- a/tests/face/udp.cpp
+++ b/tests/face/udp.cpp
@@ -5,8 +5,6 @@
*/
#include "face/udp-factory.hpp"
-#include "core/face-uri.hpp"
-#include <ndn-cpp-dev/security/key-chain.hpp>
#include "tests/test-common.hpp"
#include "tests/core/limited-io.hpp"
@@ -165,25 +163,25 @@
void
channel1_onFaceCreated(const shared_ptr<Face>& newFace)
{
- BOOST_CHECK(!static_cast<bool>(m_face1));
+ BOOST_CHECK(!static_cast<bool>(face1));
channel1_onFaceCreatedNoCheck(newFace);
}
-
+
void
channel1_onFaceCreatedNoCheck(const shared_ptr<Face>& newFace)
{
- m_face1 = newFace;
- m_face1->onReceiveInterest +=
+ face1 = newFace;
+ face1->onReceiveInterest +=
bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- m_face1->onReceiveData +=
+ face1->onReceiveData +=
bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- m_face1->onFail +=
+ face1->onFail +=
bind(&EndToEndFixture::face1_onFail, this);
BOOST_CHECK_MESSAGE(true, "channel 1 face created");
- m_faces.push_back(m_face1);
+ faces.push_back(face1);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
@@ -191,48 +189,48 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onReceiveInterest(const Interest& interest)
{
- m_face1_receivedInterests.push_back(interest);
+ face1_receivedInterests.push_back(interest);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onReceiveData(const Data& data)
{
- m_face1_receivedDatas.push_back(data);
+ face1_receivedDatas.push_back(data);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onFail()
{
- m_face1.reset();
- m_limitedIo.afterOp();
+ face1.reset();
+ limitedIo.afterOp();
}
void
channel2_onFaceCreated(const shared_ptr<Face>& newFace)
{
- BOOST_CHECK(!static_cast<bool>(m_face2));
- m_face2 = newFace;
- m_face2->onReceiveInterest +=
+ BOOST_CHECK(!static_cast<bool>(face2));
+ face2 = newFace;
+ face2->onReceiveInterest +=
bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- m_face2->onReceiveData +=
+ face2->onReceiveData +=
bind(&EndToEndFixture::face2_onReceiveData, this, _1);
- m_face2->onFail +=
+ face2->onFail +=
bind(&EndToEndFixture::face2_onFail, this);
- m_faces.push_back(m_face2);
+ faces.push_back(face2);
BOOST_CHECK_MESSAGE(true, "channel 2 face created");
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
@@ -240,47 +238,47 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onReceiveInterest(const Interest& interest)
{
- m_face2_receivedInterests.push_back(interest);
+ face2_receivedInterests.push_back(interest);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onReceiveData(const Data& data)
{
- m_face2_receivedDatas.push_back(data);
+ face2_receivedDatas.push_back(data);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onFail()
{
- m_face2.reset();
- m_limitedIo.afterOp();
+ face2.reset();
+ limitedIo.afterOp();
}
void
channel3_onFaceCreated(const shared_ptr<Face>& newFace)
{
- BOOST_CHECK(!static_cast<bool>(m_face1));
- m_face3 = newFace;
- m_faces.push_back(newFace);
+ BOOST_CHECK(!static_cast<bool>(face1));
+ face3 = newFace;
+ faces.push_back(newFace);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
channel_onFaceCreated(const shared_ptr<Face>& newFace)
{
- m_faces.push_back(newFace);
- m_limitedIo.afterOp();
+ faces.push_back(newFace);
+ limitedIo.afterOp();
}
void
@@ -288,34 +286,34 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
channel_onConnectFailedOk(const std::string& reason)
{
//it's ok, it was supposed to fail
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
checkFaceList(size_t shouldBe)
{
- BOOST_CHECK_EQUAL(m_faces.size(), shouldBe);
+ BOOST_CHECK_EQUAL(faces.size(), shouldBe);
}
public:
- LimitedIo m_limitedIo;
+ LimitedIo limitedIo;
- shared_ptr<Face> m_face1;
- std::vector<Interest> m_face1_receivedInterests;
- std::vector<Data> m_face1_receivedDatas;
- shared_ptr<Face> m_face2;
- std::vector<Interest> m_face2_receivedInterests;
- std::vector<Data> m_face2_receivedDatas;
- shared_ptr<Face> m_face3;
+ shared_ptr<Face> face1;
+ std::vector<Interest> face1_receivedInterests;
+ std::vector<Data> face1_receivedDatas;
+ shared_ptr<Face> face2;
+ std::vector<Interest> face2_receivedInterests;
+ std::vector<Data> face2_receivedDatas;
+ shared_ptr<Face> face3;
- std::list< shared_ptr<Face> > m_faces;
+ std::list< shared_ptr<Face> > faces;
};
@@ -330,13 +328,14 @@
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect or cannot accept connection");
- BOOST_REQUIRE(static_cast<bool>(m_face2));
- BOOST_CHECK_EQUAL(m_face2->getUri().toString(), "udp4://127.0.0.1:20070");
- BOOST_CHECK_EQUAL(m_face2->isLocal(), false);
- // m_face1 is not created yet
+ BOOST_REQUIRE(static_cast<bool>(face2));
+ BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "udp4://127.0.0.1:20070");
+ BOOST_CHECK_EQUAL(face2->getLocalUri().toString(), "udp4://127.0.0.1:20071");
+ BOOST_CHECK_EQUAL(face2->isLocal(), false);
+ // face1 is not created yet
shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
@@ -363,61 +362,62 @@
data2.setSignature(fakeSignature);
data3.setSignature(fakeSignature);
- m_face2->sendInterest(interest2);
- m_face2->sendData (data2 );
- m_face2->sendData (data2 );
- m_face2->sendData (data2 );
+ face2->sendInterest(interest2);
+ face2->sendData (data2 );
+ face2->sendData (data2 );
+ face2->sendData (data2 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(5,//4 send + 1 listen return
+ BOOST_CHECK_MESSAGE(limitedIo.run(5,//4 send + 1 listen return
time::seconds(4)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE(static_cast<bool>(m_face1));
- BOOST_CHECK_EQUAL(m_face1->getUri().toString(), "udp4://127.0.0.1:20071");
- BOOST_CHECK_EQUAL(m_face1->isLocal(), false);
+ BOOST_REQUIRE(static_cast<bool>(face1));
+ BOOST_CHECK_EQUAL(face1->getRemoteUri().toString(), "udp4://127.0.0.1:20071");
+ BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "udp4://127.0.0.1:20070");
+ BOOST_CHECK_EQUAL(face1->isLocal(), false);
- m_face1->sendInterest(interest1);
- m_face1->sendInterest(interest1);
- m_face1->sendInterest(interest1);
- m_face1->sendData (data1 );
+ face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
+ face1->sendData (data1 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(4, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(4)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+ BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
//checking if the connection accepting mechanism works properly.
- m_face2->sendData (data3 );
- m_face2->sendInterest(interest3);
+ face2->sendData (data3 );
+ face2->sendInterest(interest3);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 2);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 4);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 4);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[1].getName(), interest3.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [3].getName(), data3.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [3].getName(), data3.getName());
- const FaceCounters& counters1 = m_face1->getCounters();
+ const FaceCounters& counters1 = face1->getCounters();
BOOST_CHECK_EQUAL(counters1.getInInterest() , 2);
BOOST_CHECK_EQUAL(counters1.getInData() , 4);
BOOST_CHECK_EQUAL(counters1.getOutInterest(), 3);
BOOST_CHECK_EQUAL(counters1.getOutData() , 1);
- const FaceCounters& counters2 = m_face2->getCounters();
+ const FaceCounters& counters2 = face2->getCounters();
BOOST_CHECK_EQUAL(counters2.getInInterest() , 3);
BOOST_CHECK_EQUAL(counters2.getInData() , 1);
BOOST_CHECK_EQUAL(counters2.getOutInterest(), 2);
@@ -435,13 +435,14 @@
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect or cannot accept connection");
- BOOST_REQUIRE(static_cast<bool>(m_face2));
- BOOST_CHECK_EQUAL(m_face2->getUri().toString(), "udp6://[::1]:20070");
- BOOST_CHECK_EQUAL(m_face2->isLocal(), false);
- // m_face1 is not created yet
+ BOOST_REQUIRE(static_cast<bool>(face2));
+ BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "udp6://[::1]:20070");
+ BOOST_CHECK_EQUAL(face2->getLocalUri().toString(), "udp6://[::1]:20071");
+ BOOST_CHECK_EQUAL(face2->isLocal(), false);
+ // face1 is not created yet
shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
@@ -468,49 +469,50 @@
data2.setSignature(fakeSignature);
data3.setSignature(fakeSignature);
- m_face2->sendInterest(interest2);
- m_face2->sendData (data2 );
+ face2->sendInterest(interest2);
+ face2->sendData (data2 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(3,//2 send + 1 listen return
+ BOOST_CHECK_MESSAGE(limitedIo.run(3,//2 send + 1 listen return
time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE(static_cast<bool>(m_face1));
- BOOST_CHECK_EQUAL(m_face1->getUri().toString(), "udp6://[::1]:20071");
- BOOST_CHECK_EQUAL(m_face1->isLocal(), false);
+ BOOST_REQUIRE(static_cast<bool>(face1));
+ BOOST_CHECK_EQUAL(face1->getRemoteUri().toString(), "udp6://[::1]:20071");
+ BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "udp6://[::1]:20070");
+ BOOST_CHECK_EQUAL(face1->isLocal(), false);
- m_face1->sendInterest(interest1);
- m_face1->sendData (data1 );
+ face1->sendInterest(interest1);
+ face1->sendData (data1 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+ BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
//checking if the connection accepting mechanism works properly.
- m_face2->sendData (data3 );
- m_face2->sendInterest(interest3);
+ face2->sendData (data3 );
+ face2->sendInterest(interest3);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 2);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 2);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 2);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[1].getName(), interest3.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [1].getName(), data3.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [1].getName(), data3.getName());
}
BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
@@ -531,10 +533,10 @@
bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect or cannot accept connection");
- BOOST_CHECK_EQUAL(m_faces.size(), 1);
+ BOOST_CHECK_EQUAL(faces.size(), 1);
shared_ptr<UdpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
channel3->connect("127.0.0.1", "20070",
@@ -555,25 +557,25 @@
scheduler::schedule(time::milliseconds(400), bind(&EndToEndFixture::checkFaceList, this, 2));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2,// 2 connects
+ BOOST_CHECK_MESSAGE(limitedIo.run(2,// 2 connects
time::seconds(4)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect or cannot accept multiple connections");
- BOOST_CHECK_EQUAL(m_faces.size(), 3);
+ BOOST_CHECK_EQUAL(faces.size(), 3);
- m_face2->sendInterest(interest1);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ face2->sendInterest(interest1);
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- BOOST_CHECK_EQUAL(m_faces.size(), 4);
+ BOOST_CHECK_EQUAL(faces.size(), 4);
- m_face3->sendInterest(interest2);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ face3->sendInterest(interest2);
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
- //channel1 should have created 2 faces, one when m_face2 sent an interest, one when m_face3 sent an interest
- BOOST_CHECK_EQUAL(m_faces.size(), 5);
+ //channel1 should have created 2 faces, one when face2 sent an interest, one when face3 sent an interest
+ BOOST_CHECK_EQUAL(faces.size(), 5);
BOOST_CHECK_THROW(channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
bind(&EndToEndFixture::channel_onConnectFailedOk, this, _1)),
UdpChannel::Error);
@@ -590,7 +592,7 @@
// bind(&EndToEndFixture::abortTestCase, this,
// "UdpChannel error: cannot connect or cannot accept connection"));
//
-// m_limitedIoRemaining = 1;
+// limitedIoRemaining = 1;
//
// shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
// shared_ptr<UdpChannel> channel2 = factory.createChannel("::1", "20071");
@@ -605,7 +607,7 @@
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// BOOST_REQUIRE(static_cast<bool>(m_face2));
+// BOOST_REQUIRE(static_cast<bool>(face2));
//
// abortEvent =
// scheduler.scheduleEvent(time::seconds(1),
@@ -630,57 +632,57 @@
// data2.setSignature(fakeSignature);
// data3.setSignature(fakeSignature);
//
-// m_face2->sendInterest(interest2);
-// m_face2->sendData (data2 );
+// face2->sendInterest(interest2);
+// face2->sendData (data2 );
//
-// m_limitedIoRemaining = 3; //2 send + 1 listen return
+// limitedIoRemaining = 3; //2 send + 1 listen return
// g_io.run();
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// BOOST_REQUIRE(static_cast<bool>(m_face1));
+// BOOST_REQUIRE(static_cast<bool>(face1));
//
-// m_face1->sendInterest(interest1);
-// m_face1->sendData (data1 );
+// face1->sendInterest(interest1);
+// face1->sendData (data1 );
//
// abortEvent =
// scheduler.scheduleEvent(time::seconds(1),
// bind(&EndToEndFixture::abortTestCase, this,
// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// m_limitedIoRemaining = 2;
+// limitedIoRemaining = 2;
// g_io.run();
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
-// BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
-// BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
-// BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+// BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+// BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
+// BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+// BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
//
-// BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
-// BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
-// BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
-// BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+// BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+// BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+// BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+// BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
//
// //checking if the connection accepting mechanism works properly.
//
-// m_face2->sendData (data3 );
-// m_face2->sendInterest(interest3);
+// face2->sendData (data3 );
+// face2->sendInterest(interest3);
//
// abortEvent =
// scheduler.scheduleEvent(time::seconds(1),
// bind(&EndToEndFixture::abortTestCase, this,
// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// m_limitedIoRemaining = 2;
+// limitedIoRemaining = 2;
// g_io.run();
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 2);
-// BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 2);
+// BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
+// BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 2);
//
-// BOOST_CHECK_EQUAL(m_face1_receivedInterests[1].getName(), interest3.getName());
-// BOOST_CHECK_EQUAL(m_face1_receivedDatas [1].getName(), data3.getName());
+// BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
+// BOOST_CHECK_EQUAL(face1_receivedDatas [1].getName(), data3.getName());
//
//}
@@ -710,12 +712,12 @@
// bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
// bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
//
-// m_limitedIoRemaining = 1;
+// limitedIoRemaining = 1;
// g_io.run();
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// BOOST_CHECK_EQUAL(m_faces.size(), 1);
+// BOOST_CHECK_EQUAL(faces.size(), 1);
//
// shared_ptr<UdpChannel> channel3 = factory.createChannel("::1", "20072");
// channel3->connect("::1", "20070",
@@ -735,7 +737,7 @@
// static_cast<UdpChannel::ConnectFailedCallback>(bind(&EndToEndFixture::
// channel_onConnectFailed, this, _1))));
//
-// m_limitedIoRemaining = 2; // 2 connects
+// limitedIoRemaining = 2; // 2 connects
// abortEvent =
// scheduler.scheduleEvent(time::seconds(4),
// bind(&EndToEndFixture::abortTestCase, this,
@@ -747,33 +749,33 @@
// g_io.run();
// g_io.reset();
//
-// BOOST_CHECK_EQUAL(m_faces.size(), 3);
+// BOOST_CHECK_EQUAL(faces.size(), 3);
//
//
-// m_face2->sendInterest(interest1);
+// face2->sendInterest(interest1);
// abortEvent =
// scheduler.scheduleEvent(time::seconds(1),
// bind(&EndToEndFixture::abortTestCase, this,
// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// m_limitedIoRemaining = 1;
+// limitedIoRemaining = 1;
// g_io.run();
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// BOOST_CHECK_EQUAL(m_faces.size(), 4);
+// BOOST_CHECK_EQUAL(faces.size(), 4);
//
-// m_face3->sendInterest(interest2);
+// face3->sendInterest(interest2);
// abortEvent =
// scheduler.scheduleEvent(time::seconds(1),
// bind(&EndToEndFixture::abortTestCase, this,
// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// m_limitedIoRemaining = 1;
+// limitedIoRemaining = 1;
// g_io.run();
// g_io.reset();
// scheduler.cancelEvent(abortEvent);
//
-// //channel1 should have created 2 faces, one when m_face2 sent an interest, one when m_face3 sent an interest
-// BOOST_CHECK_EQUAL(m_faces.size(), 5);
+// //channel1 should have created 2 faces, one when face2 sent an interest, one when face3 sent an interest
+// BOOST_CHECK_EQUAL(faces.size(), 5);
// BOOST_CHECK_THROW(channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,
// this,
// _1),
@@ -798,24 +800,24 @@
bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect or cannot accept connection");
BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_CHECK(static_cast<bool>(m_face2));
+ BOOST_CHECK(static_cast<bool>(face2));
// Face::close must be invoked during io run to be counted as an op
- scheduler::schedule(time::milliseconds(100), bind(&Face::close, m_face2));
+ scheduler::schedule(time::milliseconds(100), bind(&Face::close, face2));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
"FaceClosing error: cannot properly close faces");
- BOOST_CHECK(!static_cast<bool>(m_face2));
+ BOOST_CHECK(!static_cast<bool>(face2));
BOOST_CHECK_EQUAL(channel2->size(), 0);
}
-
+
BOOST_FIXTURE_TEST_CASE(ClosingIdleFace, EndToEndFixture)
{
Interest interest1("ndn:/TpnzGvW9R");
@@ -834,55 +836,55 @@
channel2->connect("127.0.0.1", "20070",
bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot connect or cannot accept connection");
- m_face2->sendInterest(interest1);
- BOOST_CHECK(!m_face2->isOnDemand());
+ face2->sendInterest(interest1);
+ BOOST_CHECK(!face2->isOnDemand());
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2,//1 send + 1 listen return
+ BOOST_CHECK_MESSAGE(limitedIo.run(2,//1 send + 1 listen return
time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_CHECK_EQUAL(m_faces.size(), 2);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(2)) == LimitedIo::EXCEED_TIME,
+
+ BOOST_CHECK_EQUAL(faces.size(), 2);
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(2)) == LimitedIo::EXCEED_TIME,
"Idle face should be still open because has been used recently");
- BOOST_CHECK_EQUAL(m_faces.size(), 2);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_EQUAL(faces.size(), 2);
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
"Closing idle face error: face should be closed by now");
-
+
//the face on listen should be closed now
BOOST_CHECK_EQUAL(channel1->size(), 0);
- //checking that m_face2 has not been closed
+ //checking that face2 has not been closed
BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_REQUIRE(static_cast<bool>(m_face2));
-
- m_face2->sendInterest(interest2);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2,//1 send + 1 listen return
+ BOOST_REQUIRE(static_cast<bool>(face2));
+
+ face2->sendInterest(interest2);
+ BOOST_CHECK_MESSAGE(limitedIo.run(2,//1 send + 1 listen return
time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UdpChannel error: cannot send or receive Interest/Data packets");
//channel1 should have created a new face by now
BOOST_CHECK_EQUAL(channel1->size(), 1);
BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_REQUIRE(static_cast<bool>(m_face1));
- BOOST_CHECK(m_face1->isOnDemand());
-
+ BOOST_REQUIRE(static_cast<bool>(face1));
+ BOOST_CHECK(face1->isOnDemand());
+
channel1->connect("127.0.0.1", "20071",
bind(&EndToEndFixture::channel1_onFaceCreatedNoCheck, this, _1),
bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1,//1 connect
+ BOOST_CHECK_MESSAGE(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,
+ BOOST_CHECK(!face1->isOnDemand());
+
+ //the connect should have set face1 as permanent face,
//but it shouln't have created any additional faces
BOOST_CHECK_EQUAL(channel1->size(), 1);
BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_CHECK_MESSAGE(m_limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_TIME,
+ BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_TIME,
"Idle face should be still open because it's permanent now");
//both faces are permanent, nothing should have changed
BOOST_CHECK_EQUAL(channel1->size(), 1);
diff --git a/tests/face/unix-stream.cpp b/tests/face/unix-stream.cpp
index da474f6..2c7c177 100644
--- a/tests/face/unix-stream.cpp
+++ b/tests/face/unix-stream.cpp
@@ -5,7 +5,6 @@
*/
#include "face/unix-stream-factory.hpp"
-#include <ndn-cpp-dev/security/key-chain.hpp>
#include "tests/test-common.hpp"
#include "tests/core/limited-io.hpp"
@@ -44,20 +43,20 @@
{
BOOST_CHECK_MESSAGE(!error, error.message());
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
channel1_onFaceCreated(const shared_ptr<Face>& newFace)
{
- BOOST_CHECK(!static_cast<bool>(m_face1));
- m_face1 = static_pointer_cast<UnixStreamFace>(newFace);
- m_face1->onReceiveInterest +=
+ BOOST_CHECK(!static_cast<bool>(face1));
+ face1 = static_pointer_cast<UnixStreamFace>(newFace);
+ face1->onReceiveInterest +=
bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- m_face1->onReceiveData +=
+ face1->onReceiveData +=
bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
@@ -65,47 +64,47 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onReceiveInterest(const Interest& interest)
{
- m_face1_receivedInterests.push_back(interest);
+ face1_receivedInterests.push_back(interest);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face1_onReceiveData(const Data& data)
{
- m_face1_receivedDatas.push_back(data);
+ face1_receivedDatas.push_back(data);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onReceiveInterest(const Interest& interest)
{
- m_face2_receivedInterests.push_back(interest);
+ face2_receivedInterests.push_back(interest);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
face2_onReceiveData(const Data& data)
{
- m_face2_receivedDatas.push_back(data);
+ face2_receivedDatas.push_back(data);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
channel_onFaceCreated(const shared_ptr<Face>& newFace)
{
- m_faces.push_back(static_pointer_cast<UnixStreamFace>(newFace));
+ faces.push_back(static_pointer_cast<UnixStreamFace>(newFace));
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
void
@@ -113,20 +112,20 @@
{
BOOST_CHECK_MESSAGE(false, reason);
- m_limitedIo.afterOp();
+ limitedIo.afterOp();
}
protected:
- LimitedIo m_limitedIo;
+ LimitedIo limitedIo;
- shared_ptr<UnixStreamFace> m_face1;
- std::vector<Interest> m_face1_receivedInterests;
- std::vector<Data> m_face1_receivedDatas;
- shared_ptr<UnixStreamFace> m_face2;
- std::vector<Interest> m_face2_receivedInterests;
- std::vector<Data> m_face2_receivedDatas;
+ shared_ptr<UnixStreamFace> face1;
+ std::vector<Interest> face1_receivedInterests;
+ std::vector<Data> face1_receivedDatas;
+ shared_ptr<UnixStreamFace> face2;
+ std::vector<Interest> face2_receivedInterests;
+ std::vector<Data> face2_receivedDatas;
- std::list< shared_ptr<UnixStreamFace> > m_faces;
+ std::list< shared_ptr<UnixStreamFace> > faces;
};
@@ -143,20 +142,22 @@
client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
bind(&EndToEndFixture::client_onConnect, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot connect or cannot accept connection");
- BOOST_REQUIRE(static_cast<bool>(m_face1));
+ BOOST_REQUIRE(static_cast<bool>(face1));
- std::string face1uri = m_face1->getUri().toString();
- BOOST_CHECK_EQUAL(face1uri.find("unix:///"), 0); // third '/' is the path separator
- BOOST_CHECK_EQUAL(face1uri.rfind(CHANNEL_PATH1),
- face1uri.size() - std::string(CHANNEL_PATH1).size());
+ BOOST_CHECK_EQUAL(face1->getRemoteUri().getScheme(), "fd");
+ BOOST_CHECK_NO_THROW(boost::lexical_cast<int>(face1->getRemoteUri().getHost()));
+ std::string face1localUri = face1->getLocalUri().toString();
+ BOOST_CHECK_EQUAL(face1localUri.find("unix:///"), 0); // third '/' is the path separator
+ BOOST_CHECK_EQUAL(face1localUri.rfind(CHANNEL_PATH1),
+ face1localUri.size() - std::string(CHANNEL_PATH1).size());
- m_face2 = make_shared<UnixStreamFace>(client);
- m_face2->onReceiveInterest +=
+ face2 = make_shared<UnixStreamFace>(client);
+ face2->onReceiveInterest +=
bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- m_face2->onReceiveData +=
+ face2->onReceiveData +=
bind(&EndToEndFixture::face2_onReceiveData, this, _1);
Interest interest1("ndn:/TpnzGvW9R");
@@ -173,35 +174,35 @@
data1.setSignature(fakeSignature);
data2.setSignature(fakeSignature);
- m_face1->sendInterest(interest1);
- m_face1->sendInterest(interest1);
- m_face1->sendInterest(interest1);
- m_face1->sendData (data1 );
- m_face2->sendInterest(interest2);
- m_face2->sendData (data2 );
- m_face2->sendData (data2 );
- m_face2->sendData (data2 );
+ face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
+ face1->sendData (data1 );
+ face2->sendInterest(interest2);
+ face2->sendData (data2 );
+ face2->sendData (data2 );
+ face2->sendData (data2 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(8, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+ BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
- const FaceCounters& counters1 = m_face1->getCounters();
+ const FaceCounters& counters1 = face1->getCounters();
BOOST_CHECK_EQUAL(counters1.getInInterest() , 1);
BOOST_CHECK_EQUAL(counters1.getInData() , 3);
BOOST_CHECK_EQUAL(counters1.getOutInterest(), 3);
BOOST_CHECK_EQUAL(counters1.getOutData() , 1);
- const FaceCounters& counters2 = m_face2->getCounters();
+ const FaceCounters& counters2 = face2->getCounters();
BOOST_CHECK_EQUAL(counters2.getInInterest() , 3);
BOOST_CHECK_EQUAL(counters2.getInData() , 1);
BOOST_CHECK_EQUAL(counters2.getOutInterest(), 1);
@@ -221,36 +222,32 @@
client1->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
bind(&EndToEndFixture::client_onConnect, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot connect or cannot accept connection");
- BOOST_CHECK_EQUAL(m_faces.size(), 1);
+ BOOST_CHECK_EQUAL(faces.size(), 1);
shared_ptr<stream_protocol::socket> client2 =
make_shared<stream_protocol::socket>(boost::ref(g_io));
client2->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
bind(&EndToEndFixture::client_onConnect, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot accept multiple connections");
- BOOST_CHECK_EQUAL(m_faces.size(), 2);
+ BOOST_CHECK_EQUAL(faces.size(), 2);
// now close one of the faces
- m_faces.front()->close();
+ faces.front()->close();
// we should still be able to send/receive with the other one
- m_face1 = m_faces.back();
- m_face1->onReceiveInterest +=
- bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- m_face1->onReceiveData +=
- bind(&EndToEndFixture::face1_onReceiveData, this, _1);
+ face1 = faces.back();
+ face1->onReceiveInterest += bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
+ face1->onReceiveData += bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- m_face2 = make_shared<UnixStreamFace>(client2);
- m_face2->onReceiveInterest +=
- bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- m_face2->onReceiveData +=
- bind(&EndToEndFixture::face2_onReceiveData, this, _1);
+ face2 = make_shared<UnixStreamFace>(client2);
+ face2->onReceiveInterest += bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
+ face2->onReceiveData += bind(&EndToEndFixture::face2_onReceiveData, this, _1);
Interest interest1("ndn:/TpnzGvW9R");
Data data1 ("ndn:/KfczhUqVix");
@@ -266,23 +263,23 @@
data1.setSignature(fakeSignature);
data2.setSignature(fakeSignature);
- m_face1->sendInterest(interest1);
- m_face1->sendData (data1 );
- m_face2->sendInterest(interest2);
- m_face2->sendData (data2 );
+ face1->sendInterest(interest1);
+ face1->sendData (data1 );
+ face2->sendInterest(interest2);
+ face2->sendData (data2 );
- BOOST_CHECK_MESSAGE(m_limitedIo.run(4, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+ BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+ BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
}
static inline void
@@ -303,15 +300,15 @@
client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
bind(&EndToEndFixture::client_onConnect, this, _1));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot connect or cannot accept connection");
- BOOST_REQUIRE(static_cast<bool>(m_face1));
+ BOOST_REQUIRE(static_cast<bool>(face1));
- m_face2 = make_shared<UnixStreamFace>(client);
- m_face2->onReceiveInterest +=
+ face2 = make_shared<UnixStreamFace>(client);
+ face2->onReceiveInterest +=
bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- m_face2->onReceiveData +=
+ face2->onReceiveData +=
bind(&EndToEndFixture::face2_onReceiveData, this, _1);
Interest interest1("ndn:/TpnzGvW9R");
@@ -328,44 +325,44 @@
data1.setSignature(fakeSignature);
data2.setSignature(fakeSignature);
- m_face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
- m_face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+ face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+ face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
- BOOST_CHECK(m_face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(m_face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+ BOOST_CHECK(face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+ BOOST_CHECK(face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
- m_face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
- m_face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+ face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+ face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
- BOOST_CHECK(m_face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(m_face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+ BOOST_CHECK(face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+ BOOST_CHECK(face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
////////////////////////////////////////////////////////
interest1.setIncomingFaceId(11);
interest1.setNextHopFaceId(111);
- m_face1->sendInterest(interest1);
+ face1->sendInterest(interest1);
data1.setIncomingFaceId(22);
data1.getLocalControlHeader().setNextHopFaceId(222);
- m_face1->sendData (data1);
+ face1->sendData (data1);
//
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
// sending allows only IncomingFaceId, receiving allows only NextHopFaceId
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), false);
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
+ BOOST_CHECK_EQUAL(face2_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), false);
- BOOST_CHECK_EQUAL(m_face2_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(m_face2_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
+ BOOST_CHECK_EQUAL(face2_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
+ BOOST_CHECK_EQUAL(face2_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
////////////////////////////////////////////////////////
@@ -388,18 +385,18 @@
client->async_send(interestWithHeader, bind(&noOp));
client->async_send(dataWithHeader, bind(&noOp));
- BOOST_CHECK_MESSAGE(m_limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+ BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
"UnixStreamChannel error: cannot send or receive Interest/Data packets");
- BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+ BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), true);
- BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getNextHopFaceId(), 111);
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), true);
+ BOOST_CHECK_EQUAL(face1_receivedInterests[0].getNextHopFaceId(), 111);
- BOOST_CHECK_EQUAL(m_face1_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(m_face1_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
+ BOOST_CHECK_EQUAL(face1_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
+ BOOST_CHECK_EQUAL(face1_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
}
BOOST_AUTO_TEST_SUITE_END()