Replace Boost.MPL with Mp11

Change-Id: I9e0f3cd0169a733f602ff5fc1457f63d6499387d
This commit is contained in:
Davide Pesavento committed 2023-11-11 00:45:23 -05:00
1 parent 2f46d6543e
commit 49e1e87b24
35 files changed
+144 -158

No files matched your search

+1
View File
@@ -27,6 +27,7 @@
#include "ndn-cxx/impl/lp-field-tag.hpp"
#include "ndn-cxx/impl/pending-interest.hpp"
#include "ndn-cxx/impl/registered-prefix.hpp"
#include "ndn-cxx/lp/fields.hpp"
#include "ndn-cxx/lp/packet.hpp"
#include "ndn-cxx/lp/tags.hpp"
#include "ndn-cxx/mgmt/nfd/command-options.hpp"
+4 -2
View File
@@ -31,7 +31,8 @@
#include "ndn-cxx/lp/sequence.hpp"
#include "ndn-cxx/lp/tlv.hpp"
#include <boost/mpl/set.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/set.hpp>
namespace ndn::lp {
@@ -116,7 +117,7 @@ typedef FieldDecl<field_location_tags::Header,
/**
* \brief Set of all field declarations.
*/
using FieldSet = boost::mpl::set<
using FieldSet = boost::mp11::mp_list<
FragmentField,
SequenceField,
FragIndexField,
@@ -132,6 +133,7 @@ using FieldSet = boost::mpl::set<
NonDiscoveryField,
PrefixAnnouncementField
>;
static_assert(boost::mp11::mp_is_set<FieldSet>());
} // namespace ndn::lp
+10 -22
View File
@@ -20,10 +20,9 @@
*/
#include "ndn-cxx/lp/packet.hpp"
#include "ndn-cxx/lp/fields.hpp"
#include <boost/bind/bind.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/mp11/algorithm.hpp>
namespace ndn::lp {
@@ -54,28 +53,17 @@ struct FieldInfo
int8_t locationSortOrder = getLocationSortOrder<field_location_tags::Header>(); ///< sort order of field_location_tag
};
struct ExtractFieldInfo
{
using result_type = void;
template<typename T>
constexpr void
operator()(FieldInfo* info, const T&) const noexcept
{
if (T::TlvType::value != info->tlvType) {
return;
}
info->isRecognized = true;
info->canIgnore = false;
info->isRepeatable = T::IsRepeatable::value;
info->locationSortOrder = getLocationSortOrder<typename T::FieldLocation>();
}
};
FieldInfo::FieldInfo(uint32_t type) noexcept
: tlvType(type)
{
boost::mpl::for_each<FieldSet>(boost::bind(ExtractFieldInfo(), this, _1));
boost::mp11::mp_for_each<FieldSet>([this] (auto fieldDecl) {
if (tlvType == decltype(fieldDecl)::TlvType::value) {
isRecognized = true;
isRepeatable = decltype(fieldDecl)::IsRepeatable::value;
locationSortOrder = getLocationSortOrder<typename decltype(fieldDecl)::FieldLocation>();
}
});
if (!isRecognized) {
canIgnore = tlv::HEADER3_MIN <= tlvType &&
tlvType <= tlv::HEADER3_MAX &&
+3 -1
View File
@@ -22,7 +22,9 @@
#ifndef NDN_CXX_LP_PACKET_HPP
#define NDN_CXX_LP_PACKET_HPP
#include "ndn-cxx/lp/fields.hpp"
#include "ndn-cxx/encoding/block.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/lp/tlv.hpp"
/**
* @brief Contains classes and functions related to NDNLPv2.
+20 -25
View File
@@ -32,8 +32,9 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/set.hpp>
#include <regex>
#include <set>
@@ -550,25 +551,20 @@ public:
}
};
using CanonizeProviders = boost::mpl::vector<UdpCanonizeProvider*,
TcpCanonizeProvider*,
EtherCanonizeProvider*,
DevCanonizeProvider*,
UdpDevCanonizeProvider*>;
using CanonizeProviders = boost::mp11::mp_list<UdpCanonizeProvider,
TcpCanonizeProvider,
EtherCanonizeProvider,
DevCanonizeProvider,
UdpDevCanonizeProvider>;
static_assert(boost::mp11::mp_is_set<CanonizeProviders>());
using CanonizeProviderTable = std::map<std::string, shared_ptr<CanonizeProvider>>;
class CanonizeProviderTableInitializer
struct CanonizeProviderTableInitializer
{
public:
explicit
CanonizeProviderTableInitializer(CanonizeProviderTable& providerTable)
: m_providerTable(providerTable)
{
}
template<typename CP>
void
operator()(CP*)
operator()(boost::mp11::mp_identity<CP>)
{
shared_ptr<CanonizeProvider> cp = make_shared<CP>();
auto schemes = cp->getSchemes();
@@ -580,24 +576,23 @@ public:
}
}
private:
CanonizeProviderTable& m_providerTable;
};
static const CanonizeProvider*
getCanonizeProvider(const std::string& scheme)
{
static CanonizeProviderTable providerTable;
if (providerTable.empty()) {
boost::mpl::for_each<CanonizeProviders>(CanonizeProviderTableInitializer(providerTable));
BOOST_ASSERT(!providerTable.empty());
}
static const auto providerTable = [] {
using namespace boost::mp11;
CanonizeProviderTable table;
mp_for_each<mp_transform<mp_identity, CanonizeProviders>>(CanonizeProviderTableInitializer{table});
return table;
}();
auto it = providerTable.find(scheme);
return it == providerTable.end() ? nullptr : it->second.get();
}
bool
FaceUri::canCanonize(const std::string& scheme)
{
@@ -607,7 +602,7 @@ FaceUri::canCanonize(const std::string& scheme)
bool
FaceUri::isCanonical() const
{
const CanonizeProvider* cp = getCanonizeProvider(this->getScheme());
const auto* cp = getCanonizeProvider(getScheme());
if (cp == nullptr) {
return false;
}
@@ -620,7 +615,7 @@ FaceUri::canonize(const CanonizeSuccessCallback& onSuccess,
const CanonizeFailureCallback& onFailure,
boost::asio::io_context& io, time::nanoseconds timeout) const
{
const CanonizeProvider* cp = getCanonizeProvider(this->getScheme());
const auto* cp = getCanonizeProvider(getScheme());
if (cp == nullptr) {
if (onFailure) {
onFailure("scheme not supported");
+1
View File
@@ -22,6 +22,7 @@
#include "ndn-cxx/util/dummy-client-face.hpp"
#include "ndn-cxx/impl/lp-field-tag.hpp"
#include "ndn-cxx/lp/fields.hpp"
#include "ndn-cxx/lp/packet.hpp"
#include "ndn-cxx/lp/tags.hpp"
#include "ndn-cxx/mgmt/nfd/control-parameters.hpp"
+2 -3
View File
@@ -25,8 +25,7 @@
#include "ndn-cxx/encoding/tlv.hpp"
#include "tests/benchmarks/timed-execute.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/mp11/list.hpp>
#include <iostream>
@@ -71,7 +70,7 @@ struct ReadVarNumberAlignTest : public ReadVarNumberTest<WIRE_SIZE>
static_assert(sizeof(ReadVarNumberTest<WIRE_SIZE>::WIRE) == WIRE_SIZE);
};
using ReadVarNumberTests = boost::mpl::vector<
using ReadVarNumberTests = boost::mp11::mp_list<
ReadVarNumberAlignTest<1, 0>,
ReadVarNumberAlignTest<3, 0>,
ReadVarNumberAlignTest<3, 1>,
+2 -2
View File
@@ -35,7 +35,7 @@
#include <mutex>
#include <thread>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -116,7 +116,7 @@ protected:
Scheduler sched;
};
using Transports = boost::mpl::vector<UnixTransport, TcpTransport>;
using Transports = boost::mp11::mp_list<UnixTransport, TcpTransport>;
BOOST_AUTO_TEST_SUITE(Consumer)
+2 -2
View File
@@ -25,7 +25,7 @@
#include "tests/boost-test.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -52,7 +52,7 @@ public:
}
};
using Fixtures = boost::mpl::vector<TagHost, Interest, Data>;
using Fixtures = boost::mp11::mp_list<TagHost, Interest, Data>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(Basic, T, Fixtures, T)
{
+2 -1
View File
@@ -30,6 +30,7 @@
#include "tests/unit/io-key-chain-fixture.hpp"
#include <boost/logic/tribool.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -911,7 +912,7 @@ class WithEnvAndConfig : public WithEnv, public WithConfig
{
};
using ConfigOptions = boost::mpl::vector<WithEnv, WithConfig>;
using ConfigOptions = boost::mp11::mp_list<WithEnv, WithConfig>;
BOOST_FIXTURE_TEST_CASE(NoConfig, WithEnvAndConfig) // fixture configures test HOME and PIB/TPM path
{
+8 -8
View File
@@ -29,17 +29,17 @@
#include "tests/test-common.hpp"
#include "tests/unit/io-fixture.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
BOOST_AUTO_TEST_SUITE(Ims)
BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
using InMemoryStorages = boost::mpl::vector<InMemoryStoragePersistent,
InMemoryStorageFifo,
InMemoryStorageLfu,
InMemoryStorageLru>;
using InMemoryStorages = boost::mp11::mp_list<InMemoryStoragePersistent,
InMemoryStorageFifo,
InMemoryStorageLfu,
InMemoryStorageLru>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Insertion, T, InMemoryStorages)
{
@@ -371,9 +371,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(EraseCanonical, T, InMemoryStorages)
BOOST_CHECK_EQUAL(ims.size(), 6);
}
using InMemoryStoragesLimited = boost::mpl::vector<InMemoryStorageFifo,
InMemoryStorageLfu,
InMemoryStorageLru>;
using InMemoryStoragesLimited = boost::mp11::mp_list<InMemoryStorageFifo,
InMemoryStorageLfu,
InMemoryStorageLru>;
BOOST_AUTO_TEST_CASE_TEMPLATE(SetCapacity, T, InMemoryStoragesLimited)
{
+1
View File
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/lp/packet.hpp"
#include "ndn-cxx/lp/fields.hpp"
#include "ndn-cxx/prefix-announcement.hpp"
#include "tests/key-chain-fixture.hpp"
+1
View File
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/lp/pit-token.hpp"
#include "ndn-cxx/lp/fields.hpp"
#include "ndn-cxx/lp/packet.hpp"
#include "tests/boost-test.hpp"
+8 -6
View File
@@ -28,7 +28,7 @@
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -305,10 +305,12 @@ BOOST_AUTO_TEST_CASE(ConstructFromSpan)
BOOST_AUTO_TEST_SUITE(ConstructFromIterators) // Bug 2490
using ContainerTypes = boost::mpl::vector<std::vector<uint8_t>,
std::list<uint8_t>,
std::vector<int8_t>,
std::list<int8_t>>;
using ContainerTypes = boost::mp11::mp_list<
std::vector<uint8_t>,
std::list<uint8_t>,
std::vector<int8_t>,
std::list<int8_t>
>;
BOOST_AUTO_TEST_CASE_TEMPLATE(ZeroOctets, T, ContainerTypes)
{
@@ -540,7 +542,7 @@ public:
}
};
using ConventionTests = boost::mpl::vector<
using ConventionTests = boost::mp11::mp_list<
NumberWithMarker,
SegmentMarker,
SegmentTyped,
@@ -26,6 +26,8 @@
#include "tests/test-common.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mp11/list.hpp>
namespace ndn::tests {
using namespace ndn::security;
@@ -147,7 +149,7 @@ CertificateBundleFetcherFixture<Nack>::makeResponse(const Interest& interest)
face.receive(makeNack(interest, lp::NackReason::NO_ROUTE));
}
using SuccessWithBundle = boost::mpl::vector<BundleWithFinalBlockId, BundleWithoutFinalBlockId>;
using SuccessWithBundle = boost::mp11::mp_list<BundleWithFinalBlockId, BundleWithoutFinalBlockId>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(ValidateSuccessWithBundle, T, SuccessWithBundle,
CertificateBundleFetcherFixture<T>)
@@ -160,7 +162,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(ValidateSuccessWithBundle, T, SuccessWithBundle
}
}
using SuccessWithoutBundle = boost::mpl::vector<Nack, Timeout>;
using SuccessWithoutBundle = boost::mp11::mp_list<Nack, Timeout>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(ValidateSuccessWithoutBundle, T, SuccessWithoutBundle,
CertificateBundleFetcherFixture<T>)
@@ -27,6 +27,7 @@
#include "tests/test-common.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mp11/list.hpp>
#include <boost/range/adaptor/sliced.hpp>
#include <boost/range/adaptor/strided.hpp>
@@ -124,7 +125,7 @@ CertificateFetcherDirectFetchFixture<Nack>::makeResponse(const Interest& interes
face.receive(makeNack(interest, lp::NackReason::NO_ROUTE));
}
using Failures = boost::mpl::vector<Timeout, Nack>;
using Failures = boost::mp11::mp_list<Timeout, Nack>;
BOOST_FIXTURE_TEST_CASE(ValidateSuccessData, CertificateFetcherDirectFetchFixture<Cert>)
{
@@ -27,6 +27,8 @@
#include "tests/boost-test.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mp11/list.hpp>
namespace ndn::tests {
using namespace ndn::security;
@@ -91,7 +93,7 @@ CertificateFetcherFromNetworkFixture<Nack>::makeResponse(const Interest& interes
face.receive(nack);
}
using Failures = boost::mpl::vector<Timeout, Nack>;
using Failures = boost::mp11::mp_list<Timeout, Nack>;
BOOST_FIXTURE_TEST_CASE(ValidateSuccess, CertificateFetcherFromNetworkFixture<Cert>)
{
@@ -25,6 +25,8 @@
#include "tests/boost-test.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mp11/list.hpp>
namespace ndn::tests {
using namespace ndn::security;
@@ -44,7 +46,7 @@ using CertificateFetcherOfflineFixture = HierarchicalValidatorFixture<Validation
BOOST_FIXTURE_TEST_SUITE(TestCertificateFetcherOffline, CertificateFetcherOfflineFixture)
using Packets = boost::mpl::vector<InterestV03Pkt, DataPkt>;
using Packets = boost::mp11::mp_list<InterestV03Pkt, DataPkt>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Validate, Packet, Packets)
{
+2 -3
View File
@@ -28,8 +28,7 @@
#include "tests/unit/clock-fixture.hpp"
#include "tests/unit/test-home-env-saver.hpp"
#include <openssl/opensslv.h>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -530,7 +529,7 @@ struct Sha256Signing : protected KeyChainFixture, protected PacketType
}
};
using SigningTests = boost::mpl::vector<
using SigningTests = boost::mp11::mp_list<
RsaSigning<DataPkt>,
RsaSigning<InterestV02Pkt>,
RsaSigning<InterestV03Pkt>,
+2 -3
View File
@@ -21,13 +21,12 @@
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
#include "ndn-cxx/security/security-common.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
#include <boost/filesystem.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -57,7 +56,7 @@ public:
PibSqlite3 pib{m_path.string()};
};
using PibImpls = boost::mpl::vector<PibMemoryFixture, PibSqlite3Fixture>;
using PibImpls = boost::mp11::mp_list<PibMemoryFixture, PibSqlite3Fixture>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(TpmLocator, T, PibImpls, T)
{
-1
View File
@@ -23,7 +23,6 @@
#include "tests/boost-test.hpp"
#include <openssl/opensslv.h>
#include <boost/lexical_cast.hpp>
#include <sstream>
+2 -3
View File
@@ -37,9 +37,8 @@
#include "tests/boost-test.hpp"
#include <openssl/opensslv.h>
#include <boost/mpl/vector.hpp>
#include <set>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -50,7 +49,7 @@ using ndn::security::tpm::KeyHandle;
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(TestTpmBackEnd)
using TestBackEnds = boost::mpl::vector<
using TestBackEnds = boost::mp11::mp_list<
#if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) && defined(NDN_CXX_WITH_OSX_KEYCHAIN)
BackEndWrapperOsx,
#endif
@@ -35,7 +35,7 @@
#include "tests/boost-test.hpp"
#include <openssl/opensslv.h>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
#include <sstream>
namespace ndn::tests {
@@ -364,7 +364,7 @@ kAegdE+db4ojchAbcDLRcnzY+TUx5pTBqdBg+STMK7h36ZUn+KcMeizMRA==
)PEM";
};
using KeyTestDataSets = boost::mpl::vector<
using KeyTestDataSets = boost::mp11::mp_list<
#if OPENSSL_VERSION_NUMBER < 0x30000000L
// DES-encrypted keys
// .privateKeyPkcs8 uses either the PBES1 or PBES2 encryption scheme with DES-CBC-Pad (see RFC 8018)
@@ -645,7 +645,7 @@ public:
}
};
using KeyGenParams = boost::mpl::vector<
using KeyGenParams = boost::mp11::mp_list<
HmacKeyGenParams,
RsaKeyGenParams,
EcKeyGenParams
@@ -28,7 +28,7 @@
#include "tests/boost-test.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
#include <sstream>
@@ -68,7 +68,7 @@ struct EcKeyTestData
"5EJTDxq6ls5FoYLfThp8HOjuwGSz0qw8ocMqyku1y0V5peQ4rEPd0bwcpZd9svA=\n";
};
using KeyTestDataSets = boost::mpl::vector<RsaKeyTestData, EcKeyTestData>;
using KeyTestDataSets = boost::mp11::mp_list<RsaKeyTestData, EcKeyTestData>;
BOOST_AUTO_TEST_CASE_TEMPLATE(LoadAndSave, T, KeyTestDataSets)
{
@@ -24,8 +24,7 @@
#include "tests/boost-test.hpp"
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -76,9 +75,9 @@ BOOST_AUTO_TEST_CASE(EmptyStream)
BOOST_CHECK_EQUAL(os.str(), "");
}
using BadBits = boost::mpl::vector<
boost::mpl::integral_c<std::ios_base::iostate, std::ios_base::badbit>,
boost::mpl::integral_c<std::ios_base::iostate, std::ios_base::failbit>
using BadBits = boost::mp11::mp_list_c<std::ios_base::iostate,
std::ios_base::badbit,
std::ios_base::failbit
>;
BOOST_AUTO_TEST_CASE_TEMPLATE(BadStream, BadBit, BadBits)
@@ -33,8 +33,6 @@
#include "tests/boost-test.hpp"
#include <openssl/opensslv.h>
namespace ndn::tests {
using namespace ndn::security::transform;
@@ -24,7 +24,7 @@
#include "tests/boost-test.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -45,7 +45,7 @@ public:
BOOST_FIXTURE_TEST_SUITE(TestValidationPolicyAcceptAll, ValidationPolicyAcceptAllFixture)
using Packets = boost::mpl::vector<Interest, Data>;
using Packets = boost::mp11::mp_list<Interest, Data>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Validate, Packet, Packets)
{
@@ -28,7 +28,7 @@
#include "tests/test-common.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -339,10 +339,7 @@ BOOST_AUTO_TEST_SUITE_END() // Rejects
BOOST_AUTO_TEST_SUITE(Options)
using NonPositiveGracePeriods = boost::mpl::vector<
GracePeriodSeconds<0>,
GracePeriodSeconds<-1>
>;
using NonPositiveGracePeriods = boost::mp11::mp_list<GracePeriodSeconds<0>, GracePeriodSeconds<-1>>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(GraceNonPositive, GracePeriod, NonPositiveGracePeriods,
ValidationPolicyCommandInterestFixture<GracePeriod>)
@@ -30,6 +30,8 @@
#include "tests/unit/security/validator-config/common.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mp11/list.hpp>
namespace ndn::tests {
using ndn::security::ValidationPolicyConfig;
@@ -341,27 +343,29 @@ public:
}
};
using DataPolicies = boost::mpl::vector<LoadStringWithFileAnchor<Data>,
LoadFileWithFileAnchor<Data>,
LoadFileWithMultipleFileAnchors<Data>,
LoadSectionWithFileAnchor<Data>,
LoadStringWithBase64Anchor<Data>,
LoadStringWithDirAnchor<Data>,
LoadStringWithDirAnchor<Data, Refresh1h>,
LoadStringWithDirAnchor<Data, Refresh1m>,
LoadStringWithDirAnchor<Data, Refresh1s>
>;
using DataPolicies = boost::mp11::mp_list<
LoadStringWithFileAnchor<Data>,
LoadFileWithFileAnchor<Data>,
LoadFileWithMultipleFileAnchors<Data>,
LoadSectionWithFileAnchor<Data>,
LoadStringWithBase64Anchor<Data>,
LoadStringWithDirAnchor<Data>,
LoadStringWithDirAnchor<Data, Refresh1h>,
LoadStringWithDirAnchor<Data, Refresh1m>,
LoadStringWithDirAnchor<Data, Refresh1s>
>;
using InterestPolicies = boost::mpl::vector<LoadStringWithFileAnchor<Interest>,
LoadFileWithFileAnchor<Interest>,
LoadFileWithMultipleFileAnchors<Interest>,
LoadSectionWithFileAnchor<Interest>,
LoadStringWithBase64Anchor<Interest>,
LoadStringWithDirAnchor<Interest>,
LoadStringWithDirAnchor<Interest, Refresh1h>,
LoadStringWithDirAnchor<Interest, Refresh1m>,
LoadStringWithDirAnchor<Interest, Refresh1s>
>;
using InterestPolicies = boost::mp11::mp_list<
LoadStringWithFileAnchor<Interest>,
LoadFileWithFileAnchor<Interest>,
LoadFileWithMultipleFileAnchors<Interest>,
LoadSectionWithFileAnchor<Interest>,
LoadStringWithBase64Anchor<Interest>,
LoadStringWithDirAnchor<Interest>,
LoadStringWithDirAnchor<Interest, Refresh1h>,
LoadStringWithDirAnchor<Interest, Refresh1m>,
LoadStringWithDirAnchor<Interest, Refresh1s>
>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(ValidateData, Policy, DataPolicies, Policy)
{
@@ -687,7 +691,7 @@ BOOST_FIXTURE_TEST_CASE(Reload, HierarchicalValidatorFixture<ValidationPolicyCon
BOOST_CHECK_EQUAL(this->policy.m_interestRules.size(), 0);
}
using Packets = boost::mpl::vector<Interest, Data>;
using Packets = boost::mp11::mp_list<Interest, Data>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(TrustAnchorWildcard, Packet, Packets, ValidationPolicyConfigFixture<Packet>)
{
@@ -729,7 +733,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(TrustAnchorWildcard, Packet, Packets, Validatio
VALIDATE_SUCCESS(packet, "Policy should accept everything");
}
using RefreshPolicies = boost::mpl::vector<Refresh1h, Refresh1m, Refresh1s>;
using RefreshPolicies = boost::mp11::mp_list<Refresh1h, Refresh1m, Refresh1s>;
template<typename RefreshPolicy>
class RefreshPolicyFixture : public LoadStringWithDirAnchor<Data, RefreshPolicy>
@@ -28,7 +28,7 @@
#include "tests/test-common.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -322,10 +322,7 @@ BOOST_AUTO_TEST_CASE(TimestampReorderNegative)
VALIDATE_SUCCESS(i4, "Should succeed");
}
using NonPositiveGracePeriods = boost::mpl::vector<
GracePeriodSeconds<0>,
GracePeriodSeconds<-1>
>;
using NonPositiveGracePeriods = boost::mp11::mp_list<GracePeriodSeconds<0>, GracePeriodSeconds<-1>>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(GraceNonPositive, GracePeriod, NonPositiveGracePeriods,
ValidationPolicySignedInterestFixture<GracePeriod>)
@@ -24,7 +24,7 @@
#include "tests/boost-test.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestValidationPolicySimpleHierarchy,
HierarchicalValidatorFixture<security::ValidationPolicySimpleHierarchy>)
using Packets = boost::mpl::vector<InterestV03Pkt, DataPkt>;
using Packets = boost::mp11::mp_list<InterestV03Pkt, DataPkt>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Validate, Packet, Packets)
{
@@ -20,13 +20,13 @@
*/
#include "ndn-cxx/security/validator-config/checker.hpp"
#include "ndn-cxx/security/validation-policy.hpp"
#include "ndn-cxx/security/validation-state.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/validator-fixture.hpp"
#include "tests/unit/security/validator-config/common.hpp"
#include <boost/mp11/algorithm.hpp>
namespace ndn::tests {
using namespace ndn::security::validator_config;
@@ -283,7 +283,7 @@ public:
{false, false, false, true}};
};
using CheckerFixtures = boost::mpl::vector<
using CheckerFixtures = boost::mp11::mp_list<
NameRelationEqual,
NameRelationIsPrefixOf,
NameRelationIsStrictPrefixOf,
@@ -300,19 +300,16 @@ using CheckerFixtures = boost::mpl::vector<
>;
// Cartesian product of [DataPkt, InterestV02Pkt, InterestV03Pkt] and CheckerFixtures.
// Each element is a boost::mpl::pair<PktType, CheckerFixture>.
using Tests = boost::mpl::fold<
CheckerFixtures,
boost::mpl::vector<>,
boost::mpl::push_back<boost::mpl::push_back<boost::mpl::push_back<boost::mpl::_1,
boost::mpl::pair<DataPkt, boost::mpl::_2>>,
boost::mpl::pair<InterestV02Pkt, boost::mpl::_2>>,
boost::mpl::pair<InterestV03Pkt, boost::mpl::_2>>
>::type;
// Each element is an mp_list<PktType, Fixture>.
using Tests = boost::mp11::mp_product<
boost::mp11::mp_list,
boost::mp11::mp_list<DataPkt, InterestV02Pkt, InterestV03Pkt>,
CheckerFixtures
>;
BOOST_FIXTURE_TEST_CASE_TEMPLATE(Checks, T, Tests, T::second)
BOOST_FIXTURE_TEST_CASE_TEMPLATE(Checks, T, Tests, boost::mp11::mp_second<T>)
{
using PktType = typename T::first;
using PktType = boost::mp11::mp_first<T>;
BOOST_REQUIRE_EQUAL(this->outcomes.size(), this->names.size());
for (size_t i = 0; i < this->names.size(); ++i) {
@@ -326,7 +323,6 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(Checks, T, Tests, T::second)
this->template testChecker<PktType>(this->checker, tlv::SignatureSha256WithRsa, pktName, klName, expectedOutcome);
this->template testChecker<PktType>(this->checker, tlv::SignatureSha256WithEcdsa, pktName, klName, false);
klName = this->makeKeyLocatorCertName(this->names[j]);
this->template testChecker<PktType>(this->checker, tlv::SignatureSha256WithRsa, pktName, klName, expectedOutcome);
this->template testChecker<PktType>(this->checker, tlv::SignatureSha256WithEcdsa, pktName, klName, false);
@@ -25,7 +25,7 @@
#include "tests/unit/security/validator-fixture.hpp"
#include "tests/unit/security/validator-config/common.hpp"
#include <boost/mpl/vector_c.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -52,7 +52,7 @@ public:
shared_ptr<security::ValidationState> state;
};
using PktTypes = boost::mpl::vector<DataPkt, InterestV02Pkt, InterestV03Pkt>;
using PktTypes = boost::mp11::mp_list<DataPkt, InterestV02Pkt, InterestV03Pkt>;
BOOST_AUTO_TEST_SUITE(TestRule)
@@ -26,8 +26,7 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/test-common.hpp"
#include <openssl/opensslv.h>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -536,7 +535,7 @@ struct Sha256Dataset
// - .badSigInterestOldFormat is a valid and signed Interest packet that cannot be verified against
// .cert (signed using a different private key and in the old signed Interest format)
using SignatureDatasets = boost::mpl::vector<EcdsaDataset, RsaDataset>;
using SignatureDatasets = boost::mp11::mp_list<EcdsaDataset, RsaDataset>;
BOOST_AUTO_TEST_CASE_TEMPLATE(VerifySignature, Dataset, SignatureDatasets)
{
@@ -616,7 +615,7 @@ BOOST_FIXTURE_TEST_CASE(VerifyHmac, KeyChainFixture)
BOOST_CHECK(verifySignature(interestOldFormat, tpm, signingInfo.getSignerName(), DigestAlgorithm::SHA256));
}
using DigestDatasets = boost::mpl::vector<Sha256Dataset>;
using DigestDatasets = boost::mp11::mp_list<Sha256Dataset>;
BOOST_AUTO_TEST_CASE_TEMPLATE(VerifyDigest, Dataset, DigestDatasets)
{
+2 -2
View File
@@ -25,7 +25,7 @@
#include "tests/key-chain-fixture.hpp"
#include <boost/filesystem.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mp11/list.hpp>
namespace ndn::tests {
@@ -53,7 +53,7 @@ struct HexEncoding
std::istringstream stream{"486578456E63", std::ios_base::binary};
};
using Encodings = boost::mpl::vector<NoEncoding, Base64Encoding, HexEncoding>;
using Encodings = boost::mp11::mp_list<NoEncoding, Base64Encoding, HexEncoding>;
BOOST_AUTO_TEST_CASE_TEMPLATE(LoadBuffer, T, Encodings)
{