tests: randomize port used in multicast transport tests
Change-Id: I6030317ad10cf6f3c81f29c2a3898b41a1982c0e
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index 24d7e26..474d520 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -53,10 +53,10 @@
remoteConnect(address);
- face = make_unique<Face>(make_unique<DummyLinkService>(),
- make_unique<UnicastUdpTransport>(std::move(sock), persistency, 3_s));
- transport = static_cast<UnicastUdpTransport*>(face->getTransport());
- receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
+ m_face = make_unique<Face>(make_unique<DummyLinkService>(),
+ make_unique<UnicastUdpTransport>(std::move(sock), persistency, 3_s));
+ transport = static_cast<UnicastUdpTransport*>(m_face->getTransport());
+ receivedPackets = &static_cast<DummyLinkService*>(m_face->getLinkService())->receivedPackets;
BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
@@ -75,7 +75,7 @@
remoteRead(std::vector<uint8_t>& buf, bool needToCheck = true)
{
remoteSocket.async_receive(boost::asio::buffer(buf),
- [this, needToCheck] (const boost::system::error_code& error, size_t) {
+ [this, needToCheck] (const auto& error, size_t) {
if (needToCheck) {
BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
}
@@ -104,7 +104,7 @@
std::vector<RxPacket>* receivedPackets = nullptr;
private:
- unique_ptr<Face> face;
+ unique_ptr<Face> m_face;
};
} // namespace nfd::tests