tests: replace Boost.MPL with Mp11
Change-Id: I2e8410f4acb7f25b5cb9d7846f05163414095cc7
diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index d86f669..f56e32a 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,7 +26,7 @@
#include "unicast-udp-transport-fixture.hpp"
#include "multicast-udp-transport-fixture.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -35,7 +35,7 @@
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestDatagramTransport)
-using DatagramTransportFixtures = boost::mpl::vector<
+using DatagramTransportFixtures = boost::mp11::mp_list<
GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(UnicastUdpTransportFixture),
IpTransportFixture<MulticastUdpTransportFixture, AddressFamily::V4, AddressScope::Global, MulticastInterface::Yes>,
IpTransportFixture<MulticastUdpTransportFixture, AddressFamily::V6, AddressScope::LinkLocal, MulticastInterface::Yes>,
diff --git a/tests/daemon/face/multicast-udp-transport.t.cpp b/tests/daemon/face/multicast-udp-transport.t.cpp
index 2457e6d..2080335 100644
--- a/tests/daemon/face/multicast-udp-transport.t.cpp
+++ b/tests/daemon/face/multicast-udp-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,7 +25,7 @@
#include "multicast-udp-transport-fixture.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -34,7 +34,7 @@
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestMulticastUdpTransport)
-using MulticastUdpTransportFixtures = boost::mpl::vector<
+using MulticastUdpTransportFixtures = boost::mp11::mp_list<
IpTransportFixture<MulticastUdpTransportFixture, AddressFamily::V4, AddressScope::Global, MulticastInterface::Yes>,
IpTransportFixture<MulticastUdpTransportFixture, AddressFamily::V6, AddressScope::LinkLocal, MulticastInterface::Yes>,
IpTransportFixture<MulticastUdpTransportFixture, AddressFamily::V6, AddressScope::Global, MulticastInterface::Yes>
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index c827900..90e7b65 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,7 +27,7 @@
#include "unix-stream-transport-fixture.hpp"
#include <boost/asio/read.hpp>
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -36,7 +36,7 @@
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestStreamTransport)
-using StreamTransportFixtures = boost::mpl::vector<
+using StreamTransportFixtures = boost::mp11::mp_list<
GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(TcpTransportFixture),
UnixStreamTransportFixture
>;
diff --git a/tests/daemon/face/tcp-channel.t.cpp b/tests/daemon/face/tcp-channel.t.cpp
index 8937f5b..c7c142f 100644
--- a/tests/daemon/face/tcp-channel.t.cpp
+++ b/tests/daemon/face/tcp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,16 +27,14 @@
#include "test-ip.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTcpChannel, TcpChannelFixture)
-using AddressFamilies = boost::mpl::vector<
- std::integral_constant<AddressFamily, AddressFamily::V4>,
- std::integral_constant<AddressFamily, AddressFamily::V6>>;
+using AddressFamilies = boost::mp11::mp_list_c<AddressFamily, AddressFamily::V4, AddressFamily::V6>;
BOOST_AUTO_TEST_CASE_TEMPLATE(ConnectTimeout, F, AddressFamilies)
{
diff --git a/tests/daemon/face/tcp-transport.t.cpp b/tests/daemon/face/tcp-transport.t.cpp
index 9e52dfd..1f1929c 100644
--- a/tests/daemon/face/tcp-transport.t.cpp
+++ b/tests/daemon/face/tcp-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,7 +25,7 @@
#include "tcp-transport-fixture.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -34,7 +34,7 @@
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTcpTransport, IpTransportFixture<TcpTransportFixture>)
-using TcpTransportFixtures = boost::mpl::vector<
+using TcpTransportFixtures = boost::mp11::mp_list<
GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(TcpTransportFixture)
>;
diff --git a/tests/daemon/face/tcp-udp-channel.t.cpp b/tests/daemon/face/tcp-udp-channel.t.cpp
index cd57b80..851426e 100644
--- a/tests/daemon/face/tcp-udp-channel.t.cpp
+++ b/tests/daemon/face/tcp-udp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
#include "test-ip.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -43,7 +43,7 @@
using Address = IpAddressTypeFromFamily<AF>;
};
-using FixtureAndAddressList = boost::mpl::vector<
+using FixtureAndAddressList = boost::mp11::mp_list<
FixtureAndAddress<TcpChannelFixture, AddressFamily::V4>,
FixtureAndAddress<TcpChannelFixture, AddressFamily::V6>,
FixtureAndAddress<UdpChannelFixture, AddressFamily::V4>,
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index d405e68..800dde9 100644
--- a/tests/daemon/face/transport.t.cpp
+++ b/tests/daemon/face/transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,18 +31,14 @@
#include "tests/daemon/face/dummy-link-service.hpp"
#include "tests/daemon/face/dummy-transport.hpp"
-#include <boost/mpl/fold.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/lambda.hpp>
-#include <boost/mpl/map.hpp>
-#include <boost/mpl/pair.hpp>
-#include <boost/mpl/push_back.hpp>
-#include <boost/mpl/set.hpp>
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/algorithm.hpp>
+#include <boost/mp11/bind.hpp>
+#include <boost/mp11/map.hpp>
+#include <boost/mp11/set.hpp>
namespace nfd::tests {
-namespace mpl = boost::mpl;
+using namespace boost::mp11;
using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -68,90 +64,49 @@
BOOST_CHECK_EQUAL(transport->persistencyHistory.back(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
}
-/** \brief A macro to declare a TransportState as a integral constant.
- * \note we cannot use mpl::integral_c because TransportState is not an integral type
- */
-#define TRANSPORT_STATE_C(X) mpl::int_<static_cast<int>(TransportState::X)>
+// Map from every TransportState to a valid state transition sequence
+// for entering this state from UP.
+using StateInitSequence = mp_list<
+ mp_list_c<TransportState, TransportState::UP /* nothing to do, state is already UP */>,
+ mp_list_c<TransportState, TransportState::DOWN, TransportState::DOWN>,
+ mp_list_c<TransportState, TransportState::CLOSING, TransportState::CLOSING>,
+ mp_list_c<TransportState, TransportState::FAILED, TransportState::FAILED>,
+ mp_list_c<TransportState, TransportState::CLOSED, TransportState::CLOSING, TransportState::CLOSED>
+>;
+static_assert(mp_is_map<StateInitSequence>());
-/** \brief A map from every TransportState to a valid state transition sequence
- * for entering this state from UP.
- */
-typedef mpl::map<
- mpl::pair<TRANSPORT_STATE_C(UP),
- mpl::vector<>>,
- mpl::pair<TRANSPORT_STATE_C(DOWN),
- mpl::vector<
- TRANSPORT_STATE_C(DOWN)
- >>,
- mpl::pair<TRANSPORT_STATE_C(CLOSING),
- mpl::vector<
- TRANSPORT_STATE_C(CLOSING)
- >>,
- mpl::pair<TRANSPORT_STATE_C(FAILED),
- mpl::vector<
- TRANSPORT_STATE_C(FAILED)
- >>,
- mpl::pair<TRANSPORT_STATE_C(CLOSED),
- mpl::vector<
- TRANSPORT_STATE_C(CLOSING),
- TRANSPORT_STATE_C(CLOSED)
- >>
-> StateEntering;
+using TransportStates = mp_map_keys<StateInitSequence>;
-/** \brief A sequence of all valid TransportStates.
- */
-typedef mpl::fold<StateEntering,
- mpl::vector<>,
- mpl::push_back<mpl::_1, mpl::first<mpl::_2>>
->::type States;
+// The set of all state transitions (cartesian product of TransportStates)
+using AllStateTransitions = mp_product<mp_list, TransportStates, TransportStates>;
-/** \brief A set of all valid state transitions.
- */
-typedef mpl::set<
- mpl::pair<TRANSPORT_STATE_C(UP), TRANSPORT_STATE_C(DOWN)>,
- mpl::pair<TRANSPORT_STATE_C(DOWN), TRANSPORT_STATE_C(UP)>,
- mpl::pair<TRANSPORT_STATE_C(UP), TRANSPORT_STATE_C(CLOSING)>,
- mpl::pair<TRANSPORT_STATE_C(UP), TRANSPORT_STATE_C(FAILED)>,
- mpl::pair<TRANSPORT_STATE_C(DOWN), TRANSPORT_STATE_C(CLOSING)>,
- mpl::pair<TRANSPORT_STATE_C(DOWN), TRANSPORT_STATE_C(FAILED)>,
- mpl::pair<TRANSPORT_STATE_C(CLOSING), TRANSPORT_STATE_C(CLOSED)>,
- mpl::pair<TRANSPORT_STATE_C(FAILED), TRANSPORT_STATE_C(CLOSED)>
-> ValidStateTransitions;
-
-/** \brief A metafunction to generate a sequence of all state transitions
- * from a specified state.
- */
-template<typename FromState, typename Result>
-struct StateTransitionsFrom : mpl::fold<
- States,
- Result,
- mpl::push_back<mpl::_1, mpl::pair<FromState, mpl::_2>>>
-{
-};
-
-/** \brief A sequence of all state transitions.
- */
-typedef mpl::fold<
- States,
- mpl::vector<>,
- mpl::lambda<StateTransitionsFrom<mpl::_2, mpl::_1>>
->::type AllStateTransitions;
-
-#undef TRANSPORT_STATE_C
+// The set of *valid* state transitions
+using ValidStateTransitions = mp_list<
+ mp_list_c<TransportState, TransportState::UP, TransportState::DOWN>,
+ mp_list_c<TransportState, TransportState::UP, TransportState::CLOSING>,
+ mp_list_c<TransportState, TransportState::UP, TransportState::FAILED>,
+ mp_list_c<TransportState, TransportState::DOWN, TransportState::UP>,
+ mp_list_c<TransportState, TransportState::DOWN, TransportState::CLOSING>,
+ mp_list_c<TransportState, TransportState::DOWN, TransportState::FAILED>,
+ mp_list_c<TransportState, TransportState::CLOSING, TransportState::CLOSED>,
+ mp_list_c<TransportState, TransportState::FAILED, TransportState::CLOSED>
+>;
+// Sanity check that there are no duplicates
+static_assert(mp_is_set<ValidStateTransitions>());
+// Sanity check that ValidStateTransitions is a proper subset of AllStateTransitions
+static_assert(mp_all_of_q<ValidStateTransitions, mp_bind_front<mp_set_contains, AllStateTransitions>>());
+static_assert(mp_size<ValidStateTransitions>() < mp_size<AllStateTransitions>());
BOOST_AUTO_TEST_CASE_TEMPLATE(SetState, T, AllStateTransitions)
{
- auto transport = make_unique<DummyTransport>();
-
- auto from = static_cast<TransportState>(T::first::value);
- auto to = static_cast<TransportState>(T::second::value);
+ constexpr TransportState from = mp_first<T>::value;
+ constexpr TransportState to = mp_second<T>::value;
BOOST_TEST_INFO_SCOPE(from << " -> " << to);
- // enter from state
- using Steps = typename mpl::at<StateEntering, mpl::int_<T::first::value>>::type;
- mpl::for_each<Steps>([&transport] (int state) {
- transport->setState(static_cast<TransportState>(state));
- });
+ auto transport = make_unique<DummyTransport>();
+ // initialize transport to the 'from' state
+ using Steps = mp_rest<mp_map_find<StateInitSequence, mp_first<T>>>;
+ mp_for_each<Steps>([&transport] (auto state) { transport->setState(state); });
BOOST_REQUIRE_EQUAL(transport->getState(), from);
bool hasSignal = false;
@@ -162,11 +117,8 @@
});
// do transition
- bool isValid = from == to ||
- mpl::has_key<ValidStateTransitions,
- mpl::pair<mpl::int_<T::first::value>, mpl::int_<T::second::value>>
- >::value;
- if (isValid) {
+ constexpr bool isValid = (from == to) || mp_set_contains<ValidStateTransitions, T>();
+ if constexpr (isValid) {
BOOST_REQUIRE_NO_THROW(transport->setState(to));
BOOST_CHECK_EQUAL(hasSignal, from != to);
}
diff --git a/tests/daemon/face/udp-channel.t.cpp b/tests/daemon/face/udp-channel.t.cpp
index b95ac78..e16331e 100644
--- a/tests/daemon/face/udp-channel.t.cpp
+++ b/tests/daemon/face/udp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,16 +27,14 @@
#include "test-ip.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUdpChannel, UdpChannelFixture)
-using AddressFamilies = boost::mpl::vector<
- std::integral_constant<AddressFamily, AddressFamily::V4>,
- std::integral_constant<AddressFamily, AddressFamily::V6>>;
+using AddressFamilies = boost::mp11::mp_list_c<AddressFamily, AddressFamily::V4, AddressFamily::V6>;
BOOST_AUTO_TEST_CASE_TEMPLATE(DefaultMtu, F, AddressFamilies)
{
diff --git a/tests/daemon/face/unicast-udp-transport.t.cpp b/tests/daemon/face/unicast-udp-transport.t.cpp
index b85747d..144fed5 100644
--- a/tests/daemon/face/unicast-udp-transport.t.cpp
+++ b/tests/daemon/face/unicast-udp-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "unicast-udp-transport-fixture.hpp"
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/vector_c.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -35,7 +34,7 @@
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnicastUdpTransport, IpTransportFixture<UnicastUdpTransportFixture>)
-using UnicastUdpTransportFixtures = boost::mpl::vector<
+using UnicastUdpTransportFixtures = boost::mp11::mp_list<
GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(UnicastUdpTransportFixture)
>;
@@ -105,9 +104,9 @@
using RemoteCloseFixture = IpTransportFixture<UnicastUdpTransportFixture,
AddressFamily::Any, AddressScope::Loopback>;
-using RemoteClosePersistencies = boost::mpl::vector_c<ndn::nfd::FacePersistency,
- ndn::nfd::FACE_PERSISTENCY_ON_DEMAND,
- ndn::nfd::FACE_PERSISTENCY_PERSISTENT>;
+using RemoteClosePersistencies = boost::mp11::mp_list_c<ndn::nfd::FacePersistency,
+ ndn::nfd::FACE_PERSISTENCY_ON_DEMAND,
+ ndn::nfd::FACE_PERSISTENCY_PERSISTENT>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(RemoteClose, Persistency, RemoteClosePersistencies, RemoteCloseFixture)
{
diff --git a/tests/daemon/face/websocket-channel.t.cpp b/tests/daemon/face/websocket-channel.t.cpp
index 15d1a57..402f9c6 100644
--- a/tests/daemon/face/websocket-channel.t.cpp
+++ b/tests/daemon/face/websocket-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,16 +28,14 @@
#include "test-ip.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketChannel, WebSocketChannelFixture)
-using AddressFamilies = boost::mpl::vector<
- std::integral_constant<AddressFamily, AddressFamily::V4>,
- std::integral_constant<AddressFamily, AddressFamily::V6>>;
+using AddressFamilies = boost::mp11::mp_list_c<AddressFamily, AddressFamily::V4, AddressFamily::V6>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Uri, F, AddressFamilies)
{
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index d28d8a3..225cf80 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,7 +25,7 @@
#include "websocket-transport-fixture.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -34,7 +34,7 @@
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketTransport, IpTransportFixture<WebSocketTransportFixture>)
-using WebSocketTransportFixtures = boost::mpl::vector<
+using WebSocketTransportFixtures = boost::mp11::mp_list<
GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(WebSocketTransportFixture)
>;
@@ -55,7 +55,7 @@
BOOST_CHECK_EQUAL(this->transport->getSendQueueCapacity(), QUEUE_UNSUPPORTED);
}
-using StaticPropertiesV4MappedFixtures = boost::mpl::vector<
+using StaticPropertiesV4MappedFixtures = boost::mp11::mp_list<
IpTransportFixture<WebSocketTransportFixture, AddressFamily::V4, AddressScope::Loopback>,
IpTransportFixture<WebSocketTransportFixture, AddressFamily::V4, AddressScope::Global>
>;
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index aa18cdf..55254da 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -32,6 +32,8 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
+#include <boost/mp11/list.hpp>
+
namespace nfd::tests {
using MulticastStrategyTester = StrategyTester<fw::MulticastStrategy>;
@@ -470,7 +472,7 @@
}
};
-using Tests = boost::mpl::vector<
+using Tests = boost::mp11::mp_list<
BasicNonLocal,
NewFibLocal,
InFaceLocal,
diff --git a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
index cd46054..ebd2623 100644
--- a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
+++ b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "topology-tester.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -86,7 +86,7 @@
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyAdHocFace)
-using Strategies = boost::mpl::vector<
+using Strategies = boost::mp11::mp_list<
AsfStrategy,
BestRouteStrategy,
MulticastStrategy,
diff --git a/tests/daemon/fw/strategy-broadcast-medium.t.cpp b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
index 113faf5..e8e5acb 100644
--- a/tests/daemon/fw/strategy-broadcast-medium.t.cpp
+++ b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -38,7 +38,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "topology-tester.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -89,7 +89,7 @@
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyBroadcastMedium)
-using Strategies = boost::mpl::vector<
+using Strategies = boost::mp11::mp_list<
AsfStrategy,
BestRouteStrategy,
MulticastStrategy,
diff --git a/tests/daemon/fw/strategy-instantiation.t.cpp b/tests/daemon/fw/strategy-instantiation.t.cpp
index 0ac730c..ca59f3e 100644
--- a/tests/daemon/fw/strategy-instantiation.t.cpp
+++ b/tests/daemon/fw/strategy-instantiation.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@
#include "tests/test-common.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -46,23 +46,12 @@
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyInstantiation)
-template<typename S, bool CanAcceptParameters, uint64_t MinVersion>
-class Test
+template<typename S, bool CanAcceptParams, uint64_t MinVer>
+struct Test
{
-public:
using Strategy = S;
-
- static bool
- canAcceptParameters()
- {
- return CanAcceptParameters;
- }
-
- static uint64_t
- getMinVersion()
- {
- return MinVersion;
- }
+ static constexpr bool canAcceptParameters = CanAcceptParams;
+ static constexpr uint64_t minVersion = MinVer;
static Name
getVersionedStrategyName(uint64_t version)
@@ -71,7 +60,7 @@
}
};
-using Tests = boost::mpl::vector<
+using Tests = boost::mp11::mp_list<
Test<AccessStrategy, false, 1>,
Test<AsfStrategy, true, 4>,
Test<BestRouteStrategy, true, 5>,
@@ -89,26 +78,25 @@
{
BOOST_REQUIRE(T::Strategy::getStrategyName().at(-1).isVersion());
uint64_t maxVersion = T::Strategy::getStrategyName().at(-1).toVersion();
- BOOST_REQUIRE_LE(T::getMinVersion(), maxVersion);
+ BOOST_REQUIRE_LE(T::minVersion, maxVersion);
FaceTable faceTable;
Forwarder forwarder(faceTable);
- for (uint64_t version = T::getMinVersion(); version <= maxVersion; ++version) {
+ for (auto version = T::minVersion; version <= maxVersion; ++version) {
Name versionedName = T::getVersionedStrategyName(version);
- unique_ptr<typename T::Strategy> instance;
- BOOST_CHECK_NO_THROW(instance = make_unique<typename T::Strategy>(forwarder, versionedName));
+ auto instance = make_unique<typename T::Strategy>(forwarder, versionedName);
BOOST_CHECK_EQUAL(instance->getInstanceName(), versionedName);
- if (!T::canAcceptParameters()) {
+ if (!T::canAcceptParameters) {
Name nameWithParameters = Name(versionedName).append("param");
BOOST_CHECK_THROW(typename T::Strategy(forwarder, nameWithParameters), std::invalid_argument);
}
}
- if (T::getMinVersion() > 0) {
+ if (T::minVersion > 0) {
Name version0Name = T::getVersionedStrategyName(0);
BOOST_CHECK_THROW(typename T::Strategy(forwarder, version0Name), std::invalid_argument);
- Name earlyVersionName = T::getVersionedStrategyName(T::getMinVersion() - 1);
+ Name earlyVersionName = T::getVersionedStrategyName(T::minVersion - 1);
BOOST_CHECK_THROW(typename T::Strategy(forwarder, earlyVersionName), std::invalid_argument);
}
@@ -145,7 +133,7 @@
Forwarder m_forwarder{m_faceTable};
};
-using StrategiesWithRetxSuppressionExponential = boost::mpl::vector<
+using StrategiesWithRetxSuppressionExponential = boost::mp11::mp_list<
AsfStrategy,
BestRouteStrategy,
MulticastStrategy
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index 4b6961d..e7ed117 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -35,7 +35,7 @@
#include "topology-tester.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -83,7 +83,7 @@
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyNackReturn)
-using Strategies = boost::mpl::vector<
+using Strategies = boost::mp11::mp_list<
BestRouteStrategy,
RandomStrategy
>;
@@ -282,7 +282,7 @@
static constexpr lp::NackReason expectedResult{R};
};
-using NackReasonCombinations = boost::mpl::vector<
+using NackReasonCombinations = boost::mp11::mp_list<
NackReasonCombination<lp::NackReason::CONGESTION, lp::NackReason::CONGESTION, lp::NackReason::CONGESTION>,
NackReasonCombination<lp::NackReason::CONGESTION, lp::NackReason::DUPLICATE, lp::NackReason::CONGESTION>,
NackReasonCombination<lp::NackReason::CONGESTION, lp::NackReason::NO_ROUTE, lp::NackReason::CONGESTION>,
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index 3dfce2c..2e70e0e 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -39,7 +39,7 @@
#include "choose-strategy.hpp"
#include "strategy-tester.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -78,25 +78,16 @@
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyNoRoute)
-template<typename S, typename C>
-class Test
-{
-public:
- using Strategy = S;
- using Case = C;
-};
-
template<typename S>
-class EmptyNextHopList
+struct EmptyNextHopList
{
-public:
- Name
+ static Name
getInterestName()
{
return "/P";
}
- void
+ static void
insertFibEntry(StrategyNoRouteFixture<S>* fixture)
{
fixture->fib.insert(Name());
@@ -104,16 +95,15 @@
};
template<typename S>
-class NextHopIsDownstream
+struct NextHopIsDownstream
{
-public:
- Name
+ static Name
getInterestName()
{
return "/P";
}
- void
+ static void
insertFibEntry(StrategyNoRouteFixture<S>* fixture)
{
fib::Entry* entry = fixture->fib.insert(Name()).first;
@@ -122,16 +112,15 @@
};
template<typename S>
-class NextHopViolatesScope
+struct NextHopViolatesScope
{
-public:
- Name
+ static Name
getInterestName()
{
return "/localhop/P";
}
- void
+ static void
insertFibEntry(StrategyNoRouteFixture<S>* fixture)
{
fib::Entry* entry = fixture->fib.insert("/localhop").first;
@@ -140,27 +129,27 @@
}
};
-using Tests = boost::mpl::vector<
- Test<AsfStrategy, EmptyNextHopList<AsfStrategy>>,
- Test<AsfStrategy, NextHopIsDownstream<AsfStrategy>>,
- Test<AsfStrategy, NextHopViolatesScope<AsfStrategy>>,
+using Tests = boost::mp11::mp_list<
+ boost::mp11::mp_list<AsfStrategy, EmptyNextHopList<AsfStrategy>>,
+ boost::mp11::mp_list<AsfStrategy, NextHopIsDownstream<AsfStrategy>>,
+ boost::mp11::mp_list<AsfStrategy, NextHopViolatesScope<AsfStrategy>>,
- Test<BestRouteStrategy, EmptyNextHopList<BestRouteStrategy>>,
- Test<BestRouteStrategy, NextHopIsDownstream<BestRouteStrategy>>,
- Test<BestRouteStrategy, NextHopViolatesScope<BestRouteStrategy>>,
+ boost::mp11::mp_list<BestRouteStrategy, EmptyNextHopList<BestRouteStrategy>>,
+ boost::mp11::mp_list<BestRouteStrategy, NextHopIsDownstream<BestRouteStrategy>>,
+ boost::mp11::mp_list<BestRouteStrategy, NextHopViolatesScope<BestRouteStrategy>>,
- Test<RandomStrategy, EmptyNextHopList<RandomStrategy>>,
- Test<RandomStrategy, NextHopIsDownstream<RandomStrategy>>,
- Test<RandomStrategy, NextHopViolatesScope<RandomStrategy>>
+ boost::mp11::mp_list<RandomStrategy, EmptyNextHopList<RandomStrategy>>,
+ boost::mp11::mp_list<RandomStrategy, NextHopIsDownstream<RandomStrategy>>,
+ boost::mp11::mp_list<RandomStrategy, NextHopViolatesScope<RandomStrategy>>
>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(IncomingInterest,
- T, Tests, StrategyNoRouteFixture<typename T::Strategy>)
+ T, Tests, StrategyNoRouteFixture<boost::mp11::mp_first<T>>)
{
- typename T::Case scenario;
- scenario.insertFibEntry(this);
+ using Scenario = boost::mp11::mp_second<T>;
+ Scenario::insertFibEntry(this);
- auto interest = makeInterest(scenario.getInterestName());
+ auto interest = makeInterest(Scenario::getInterestName());
auto pitEntry = this->pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(*this->face1, *interest);
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 392becb..8bd96d1 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -39,7 +39,7 @@
#include "choose-strategy.hpp"
#include "strategy-tester.hpp"
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -85,31 +85,15 @@
BOOST_AUTO_TEST_SUITE(TestStrategyScopeControl)
template<typename S, bool WillSendNackNoRoute, bool CanProcessNack, bool WillRejectPitEntry>
-class Test
+struct Test
{
-public:
using Strategy = S;
-
- static bool
- willRejectPitEntry()
- {
- return WillRejectPitEntry;
- }
-
- static bool
- willSendNackNoRoute()
- {
- return WillSendNackNoRoute;
- }
-
- static bool
- canProcessNack()
- {
- return CanProcessNack;
- }
+ static constexpr bool canProcessNack = CanProcessNack;
+ static constexpr bool willRejectPitEntry = WillRejectPitEntry;
+ static constexpr bool willSendNackNoRoute = WillSendNackNoRoute;
};
-using Tests = boost::mpl::vector<
+using Tests = boost::mp11::mp_list<
Test<AccessStrategy, false, false, true>,
Test<AsfStrategy, true, false, true>,
Test<BestRouteStrategy, true, true, true>,
@@ -148,11 +132,11 @@
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3), pitEntry); },
- this->limitedIo, T::willRejectPitEntry() + T::willSendNackNoRoute()));
+ this->limitedIo, T::willRejectPitEntry + T::willSendNackNoRoute));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
- BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory.size(), T::willRejectPitEntry());
- if (T::willSendNackNoRoute()) {
+ BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory.size(), T::willRejectPitEntry);
+ if (T::willSendNackNoRoute) {
BOOST_REQUIRE_EQUAL(this->strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.back().header.getReason(), lp::NackReason::NO_ROUTE);
}
@@ -191,11 +175,11 @@
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1), pitEntry); },
- this->limitedIo, T::willRejectPitEntry() + T::willSendNackNoRoute()));
+ this->limitedIo, T::willRejectPitEntry + T::willSendNackNoRoute));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
- BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory.size(), T::willRejectPitEntry());
- if (T::willSendNackNoRoute()) {
+ BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory.size(), T::willRejectPitEntry);
+ if (T::willSendNackNoRoute) {
BOOST_REQUIRE_EQUAL(this->strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.back().header.getReason(), lp::NackReason::NO_ROUTE);
}
@@ -237,11 +221,11 @@
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4), pitEntry); },
- this->limitedIo, T::canProcessNack()));
+ this->limitedIo, T::canProcessNack));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory.size(), 0);
- if (T::canProcessNack()) {
+ if (T::canProcessNack) {
BOOST_REQUIRE_EQUAL(this->strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.back().header.getReason(), lp::NackReason::NO_ROUTE);
}
@@ -262,11 +246,11 @@
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4), pitEntry); },
- this->limitedIo, T::canProcessNack()));
+ this->limitedIo, T::canProcessNack));
BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory.size(), 0);
- if (T::canProcessNack()) {
+ if (T::canProcessNack) {
BOOST_REQUIRE_EQUAL(this->strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.back().header.getReason(), lp::NackReason::NO_ROUTE);
}
diff --git a/tests/daemon/fw/unsolicited-data-policy.t.cpp b/tests/daemon/fw/unsolicited-data-policy.t.cpp
index 67be5b2..c4a7097 100644
--- a/tests/daemon/fw/unsolicited-data-policy.t.cpp
+++ b/tests/daemon/fw/unsolicited-data-policy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,7 +31,7 @@
#include "tests/daemon/face/dummy-face.hpp"
#include <boost/logic/tribool.hpp>
-#include <boost/mpl/vector.hpp>
+#include <boost/mp11/list.hpp>
namespace nfd::tests {
@@ -40,7 +40,8 @@
class UnsolicitedDataPolicyFixture : public GlobalIoTimeFixture
{
protected:
- /** \tparam Policy policy type, or void to keep default policy
+ /**
+ * \tparam Policy The policy type, or `void` to keep the default policy.
*/
template<typename Policy>
void
@@ -89,15 +90,15 @@
BOOST_CHECK_EQUAL(policyNames.count("admit-all"), 1);
}
-template<typename Policy, bool shouldAdmitLocal, bool shouldAdmitNonLocal>
+template<typename P, bool Local, bool NonLocal>
struct FaceScopePolicyTest
{
- using PolicyType = Policy;
- using ShouldAdmitLocal = std::bool_constant<shouldAdmitLocal>;
- using ShouldAdmitNonLocal = std::bool_constant<shouldAdmitNonLocal>;
+ using PolicyType = P;
+ static constexpr bool shouldAdmitLocal = Local;
+ static constexpr bool shouldAdmitNonLocal = NonLocal;
};
-using FaceScopePolicyTests = boost::mpl::vector<
+using FaceScopePolicyTests = boost::mp11::mp_list<
FaceScopePolicyTest<void, false, false>, // default policy
FaceScopePolicyTest<DropAllUnsolicitedDataPolicy, false, false>,
FaceScopePolicyTest<AdmitLocalUnsolicitedDataPolicy, true, false>,
@@ -115,7 +116,7 @@
auto data1 = makeData("/unsolicited-from-local");
forwarder.onIncomingData(*data1, FaceEndpoint(*face1));
- BOOST_CHECK_EQUAL(isInCs(*data1), T::ShouldAdmitLocal::value);
+ BOOST_CHECK_EQUAL(isInCs(*data1), T::shouldAdmitLocal);
auto face2 = make_shared<DummyFace>("dummy://", "dummy://",
ndn::nfd::FACE_SCOPE_NON_LOCAL);
@@ -123,7 +124,7 @@
auto data2 = makeData("/unsolicited-from-non-local");
forwarder.onIncomingData(*data2, FaceEndpoint(*face2));
- BOOST_CHECK_EQUAL(isInCs(*data2), T::ShouldAdmitNonLocal::value);
+ BOOST_CHECK_EQUAL(isInCs(*data2), T::shouldAdmitNonLocal);
}
BOOST_AUTO_TEST_SUITE_END() // TestUnsolicitedDataPolicy
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 45ddc1f..8f789c6 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,13 +23,13 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
-#define BOOST_MPL_LIMIT_VECTOR_SIZE 40
-
#include "mgmt/face-manager.hpp"
#include "face/generic-link-service.hpp"
+
#include "face-manager-command-fixture.hpp"
+#include <boost/mp11/list.hpp>
+
namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Mgmt)
@@ -302,36 +302,35 @@
}
};
-namespace mpl = boost::mpl;
-
-// pairs of CreateCommand and Success/Failure status
-using TestCases = mpl::vector<
- mpl::pair<TcpFaceOnDemand, CommandFailure<406>>,
- mpl::pair<TcpFacePersistent, CommandSuccess>,
- mpl::pair<TcpFacePermanent, CommandSuccess>,
- mpl::pair<UdpFaceOnDemand, CommandFailure<406>>,
- mpl::pair<UdpFacePersistent, CommandSuccess>,
- mpl::pair<UdpFacePermanent, CommandSuccess>,
- mpl::pair<LocalTcpFaceLocalFieldsEnabled, CommandSuccess>,
- mpl::pair<LocalTcpFaceLocalFieldsDisabled, CommandSuccess>,
- mpl::pair<NonLocalUdpFaceLocalFieldsEnabled, CommandFailure<406>>,
- mpl::pair<NonLocalUdpFaceLocalFieldsDisabled, CommandSuccess>,
- mpl::pair<TcpFaceLpReliabilityEnabled, CommandSuccess>,
- mpl::pair<TcpFaceLpReliabilityDisabled, CommandSuccess>,
- mpl::pair<UdpFaceLpReliabilityEnabled, CommandSuccess>,
- mpl::pair<UdpFaceLpReliabilityDisabled, CommandSuccess>,
- mpl::pair<TcpFaceCongestionMarkingEnabled, CommandSuccess>,
- mpl::pair<TcpFaceCongestionMarkingDisabled, CommandSuccess>,
- mpl::pair<TcpFaceMtuOverride, CommandFailure<406>>,
- mpl::pair<UdpFaceMtuOverride, CommandSuccess>,
- mpl::pair<FaceUriMalformed, CommandFailure<400>>,
- mpl::pair<FaceUriNonCanonical, CommandFailure<400>>,
- mpl::pair<FaceUriUnsupportedScheme, CommandFailure<406>>>;
+// Pairs of CreateCommand and success/failure status
+using TestCases = boost::mp11::mp_list<
+ boost::mp11::mp_list<TcpFaceOnDemand, CommandFailure<406>>,
+ boost::mp11::mp_list<TcpFacePersistent, CommandSuccess>,
+ boost::mp11::mp_list<TcpFacePermanent, CommandSuccess>,
+ boost::mp11::mp_list<UdpFaceOnDemand, CommandFailure<406>>,
+ boost::mp11::mp_list<UdpFacePersistent, CommandSuccess>,
+ boost::mp11::mp_list<UdpFacePermanent, CommandSuccess>,
+ boost::mp11::mp_list<LocalTcpFaceLocalFieldsEnabled, CommandSuccess>,
+ boost::mp11::mp_list<LocalTcpFaceLocalFieldsDisabled, CommandSuccess>,
+ boost::mp11::mp_list<NonLocalUdpFaceLocalFieldsEnabled, CommandFailure<406>>,
+ boost::mp11::mp_list<NonLocalUdpFaceLocalFieldsDisabled, CommandSuccess>,
+ boost::mp11::mp_list<TcpFaceLpReliabilityEnabled, CommandSuccess>,
+ boost::mp11::mp_list<TcpFaceLpReliabilityDisabled, CommandSuccess>,
+ boost::mp11::mp_list<UdpFaceLpReliabilityEnabled, CommandSuccess>,
+ boost::mp11::mp_list<UdpFaceLpReliabilityDisabled, CommandSuccess>,
+ boost::mp11::mp_list<TcpFaceCongestionMarkingEnabled, CommandSuccess>,
+ boost::mp11::mp_list<TcpFaceCongestionMarkingDisabled, CommandSuccess>,
+ boost::mp11::mp_list<TcpFaceMtuOverride, CommandFailure<406>>,
+ boost::mp11::mp_list<UdpFaceMtuOverride, CommandSuccess>,
+ boost::mp11::mp_list<FaceUriMalformed, CommandFailure<400>>,
+ boost::mp11::mp_list<FaceUriNonCanonical, CommandFailure<400>>,
+ boost::mp11::mp_list<FaceUriUnsupportedScheme, CommandFailure<406>>
+>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(NewFace, T, TestCases, FaceManagerCommandFixture)
{
- using FaceType = typename T::first;
- using CreateResult = typename T::second;
+ using FaceType = boost::mp11::mp_first<T>;
+ using CreateResult = boost::mp11::mp_second<T>;
Interest req = makeControlCommandRequest("/localhost/nfd/faces/create", FaceType::getParameters());
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 6000380..ebc794a 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,17 +31,15 @@
#include <ndn-cxx/lp/tags.hpp>
-#include <thread>
-
#include <boost/logic/tribool.hpp>
+#include <boost/mp11/list.hpp>
+#include <thread>
namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(TestFaceManager)
-namespace mpl = boost::mpl;
-
class FaceManagerUpdateFixture : public FaceManagerCommandFixture
{
public:
@@ -202,15 +200,15 @@
});
}
-using UpdatePersistencyTests = mpl::vector<
- mpl::pair<DummyTransportBase<true>, CommandSuccess>,
- mpl::pair<DummyTransportBase<false>, CommandFailure<409>>
+using UpdatePersistencyTests = boost::mp11::mp_list<
+ boost::mp11::mp_list<DummyTransportBase<true>, CommandSuccess>,
+ boost::mp11::mp_list<DummyTransportBase<false>, CommandFailure<409>>
>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(UpdatePersistency, T, UpdatePersistencyTests, FaceManagerUpdateFixture)
{
- using TransportType = typename T::first;
- using ResultType = typename T::second;
+ using TransportType = boost::mp11::mp_first<T>;
+ using ResultType = boost::mp11::mp_second<T>;
auto face = make_shared<face::Face>(make_unique<face::GenericLinkService>(),
make_unique<TransportType>());
@@ -511,18 +509,18 @@
}
};
-using LocalFieldFaces = mpl::vector<
- mpl::pair<TcpLocalFieldsEnable, CommandSuccess>,
- mpl::pair<TcpLocalFieldsDisable, CommandSuccess>,
- mpl::pair<UdpLocalFieldsEnable, CommandFailure<409>>,
- mpl::pair<UdpLocalFieldsDisable, CommandSuccess>,
- mpl::pair<UdpLocalFieldsEnableNoMaskBit, CommandSuccess>
+using LocalFieldFaces = boost::mp11::mp_list<
+ boost::mp11::mp_list<TcpLocalFieldsEnable, CommandSuccess>,
+ boost::mp11::mp_list<TcpLocalFieldsDisable, CommandSuccess>,
+ boost::mp11::mp_list<UdpLocalFieldsEnable, CommandFailure<409>>,
+ boost::mp11::mp_list<UdpLocalFieldsDisable, CommandSuccess>,
+ boost::mp11::mp_list<UdpLocalFieldsEnableNoMaskBit, CommandSuccess>
>;
BOOST_AUTO_TEST_CASE_TEMPLATE(UpdateLocalFields, T, LocalFieldFaces)
{
- using TestType = typename T::first;
- using ResultType = typename T::second;
+ using TestType = boost::mp11::mp_first<T>;
+ using ResultType = boost::mp11::mp_second<T>;
createFace(TestType::getUri(), TestType::getPersistency(), {}, {},
TestType::getInitLocalFieldsEnabled());
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 65dcf05..43c69df 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -32,6 +32,7 @@
#include <ndn-cxx/mgmt/nfd/face-status.hpp>
#include <ndn-cxx/mgmt/nfd/rib-entry.hpp>
+#include <boost/mp11/algorithm.hpp>
#include <boost/property_tree/info_parser.hpp>
namespace nfd::tests {
@@ -303,21 +304,21 @@
}
};
-template<typename Fixture, auto Format>
+template<typename Fixture, typename Format>
struct FixtureWithFormat : public Fixture
{
- static constexpr ndn::security::SignedInterestFormat signedInterestFmt = Format;
+ static constexpr ndn::security::SignedInterestFormat signedInterestFmt = Format::value;
};
-using AllFixtures = boost::mpl::vector<
- FixtureWithFormat<UnauthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V02>,
- FixtureWithFormat<UnauthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V03>,
- FixtureWithFormat<LocalhostAuthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V02>,
- FixtureWithFormat<LocalhostAuthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V03>,
- FixtureWithFormat<LocalhopAuthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V02>,
- FixtureWithFormat<LocalhopAuthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V03>,
- FixtureWithFormat<AuthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V02>,
- FixtureWithFormat<AuthorizedRibManagerFixture, ndn::security::SignedInterestFormat::V03>
+using AllFixtures = boost::mp11::mp_product<
+ FixtureWithFormat,
+ boost::mp11::mp_list<UnauthorizedRibManagerFixture,
+ LocalhostAuthorizedRibManagerFixture,
+ LocalhopAuthorizedRibManagerFixture,
+ AuthorizedRibManagerFixture>,
+ boost::mp11::mp_list_c<ndn::security::SignedInterestFormat,
+ ndn::security::SignedInterestFormat::V02,
+ ndn::security::SignedInterestFormat::V03>
>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(CommandAuthorization, T, AllFixtures, T)
diff --git a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
index 85624c2..996ff37 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,6 +32,8 @@
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
+#include <boost/mp11/list.hpp>
+
namespace nfd::tests {
using namespace nfd::rib;
@@ -113,7 +115,7 @@
}
};
-using AdvertiseScenarios = boost::mpl::vector<AdvertiseSuccessScenario, AdvertiseFailureScenario>;
+using AdvertiseScenarios = boost::mp11::mp_list<AdvertiseSuccessScenario, AdvertiseFailureScenario>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Advertise, Scenario, AdvertiseScenarios)
{
@@ -191,7 +193,7 @@
}
};
-using WithdrawScenarios = boost::mpl::vector<WithdrawSuccessScenario, WithdrawFailureScenario>;
+using WithdrawScenarios = boost::mp11::mp_list<WithdrawSuccessScenario, WithdrawFailureScenario>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Withdraw, Scenario, WithdrawScenarios)
{