face: TcpTransport
Change-Id: I3ff898225ad1b0c1178490f389048944e24a9f1b
Refs: #3166
diff --git a/tests/daemon/face/tcp.t.cpp b/tests/daemon/face/tcp.t.cpp
index bec87e1..cbb3946 100644
--- a/tests/daemon/face/tcp.t.cpp
+++ b/tests/daemon/face/tcp.t.cpp
@@ -24,7 +24,6 @@
*/
#include "face/tcp-channel.hpp"
-#include "face/tcp-face.hpp"
#include "face/tcp-factory.hpp"
#include "core/network-interface.hpp"
@@ -33,12 +32,13 @@
#include "dummy-stream-sender.hpp"
#include "packet-datasets.hpp"
-#include <ndn-cxx/security/key-chain.hpp>
-
namespace nfd {
namespace tests {
-BOOST_FIXTURE_TEST_SUITE(FaceTcp, BaseFixture)
+BOOST_AUTO_TEST_SUITE(Face)
+BOOST_FIXTURE_TEST_SUITE(TestTcp, BaseFixture)
+
+using nfd::Face;
BOOST_AUTO_TEST_CASE(ChannelMap)
{
@@ -102,14 +102,14 @@
"No channels available to connect to 127.0.0.1:6363"));
factory.createChannel("127.0.0.1", "20071");
-
+
factory.createFace(FaceUri("tcp4://127.0.0.1:20070"),
ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
bind([]{}),
bind(&FaceCreateFixture::failIfError, this, _1));
}
-BOOST_FIXTURE_TEST_CASE(UnsupportedFaceCreate, FaceCreateFixture)
+BOOST_AUTO_TEST_CASE(UnsupportedFaceCreate)
{
TcpFactory factory;
@@ -305,11 +305,6 @@
BOOST_CHECK_EQUAL(face1->isLocal(), true);
BOOST_CHECK_EQUAL(face2->isLocal(), 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...
-
shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
@@ -388,11 +383,6 @@
BOOST_CHECK_EQUAL(face1->isLocal(), true);
BOOST_CHECK_EQUAL(face2->isLocal(), 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...
-
shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
@@ -464,7 +454,6 @@
BOOST_CHECK_EQUAL(faces.size(), 6);
}
-
BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
{
TcpFactory factory;
@@ -504,7 +493,6 @@
BOOST_CHECK_EQUAL(channel2->size(), 0);
}
-
class SimpleEndToEndFixture : protected BaseFixture
{
public:
@@ -515,14 +503,6 @@
face->onReceiveData.connect(bind(&SimpleEndToEndFixture::onReceiveData, this, _1));
face->onFail.connect(bind(&SimpleEndToEndFixture::onFail, this, face));
- if (static_cast<bool>(dynamic_pointer_cast<LocalFace>(face))) {
- static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
- LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
- static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
- LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
- }
-
limitedIo.afterOp();
}
@@ -563,26 +543,6 @@
std::vector<Data> receivedDatas;
};
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(LocalFaceCorruptedInput, Dataset,
- CorruptedPackets, SimpleEndToEndFixture)
-{
- TcpFactory factory;
- tcp::Endpoint endpoint(boost::asio::ip::address_v4::from_string("127.0.0.1"), 20070);
-
- shared_ptr<TcpChannel> channel = factory.createChannel(endpoint);
- channel->listen(bind(&SimpleEndToEndFixture::onFaceCreated, this, _1),
- bind(&SimpleEndToEndFixture::onConnectFailed, this, _1));
- BOOST_REQUIRE_EQUAL(channel->isListening(), true);
-
- DummyStreamSender<boost::asio::ip::tcp, Dataset> sender;
- sender.start(endpoint);
-
- BOOST_CHECK_MESSAGE(limitedIo.run(LimitedIo::UNLIMITED_OPS,
- time::seconds(1)) == LimitedIo::EXCEED_TIME,
- "Exception thrown for " + Dataset::getName());
-}
-
BOOST_FIXTURE_TEST_CASE_TEMPLATE(FaceCorruptedInput, Dataset,
CorruptedPackets, SimpleEndToEndFixture)
{
@@ -787,7 +747,8 @@
}));
}
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestTcp
+BOOST_AUTO_TEST_SUITE_END() // Face
} // namespace tests
} // namespace nfd