tests: replace Boost.MPL with Mp11
Change-Id: I2e8410f4acb7f25b5cb9d7846f05163414095cc7
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