Move BOOST_CONCEPT_ASSERT to unit tests where possible
Change-Id: I0c6ae494eb7be4ab2ff422ba6d866ead9e75f4eb
diff --git a/examples/producer.cpp b/examples/producer.cpp
index e9f7e50..2456280 100644
--- a/examples/producer.cpp
+++ b/examples/producer.cpp
@@ -37,33 +37,34 @@
run()
{
m_face.setInterestFilter("/example/testApp/randomData",
- std::bind(&Producer::onInterest, this, _1, _2),
+ std::bind(&Producer::onInterest, this, _2),
nullptr, // RegisterPrefixSuccessCallback is optional
std::bind(&Producer::onRegisterFailed, this, _1, _2));
auto cert = m_keyChain.getPib().getDefaultIdentity().getDefaultKey().getDefaultCertificate();
m_certServeHandle = m_face.setInterestFilter(security::extractIdentityFromCertName(cert.getName()),
- [this, cert] (auto&&...) {
- m_face.put(cert);
- },
- std::bind(&Producer::onRegisterFailed, this, _1, _2));
+ [this, cert] (auto&&...) {
+ m_face.put(cert);
+ },
+ std::bind(&Producer::onRegisterFailed, this, _1, _2));
m_face.processEvents();
}
private:
void
- onInterest(const InterestFilter&, const Interest& interest)
+ onInterest(const Interest& interest)
{
std::cout << ">> I: " << interest << std::endl;
- constexpr std::string_view content{"Hello, world!"};
-
// Create Data packet
- auto data = std::make_shared<Data>(interest.getName());
+ auto data = std::make_shared<Data>();
+ data->setName(interest.getName());
data->setFreshnessPeriod(10_s);
- data->setContent(make_span(reinterpret_cast<const uint8_t*>(content.data()), content.size()));
- // in order for the consumer application to be able to validate the packet, you need to setup
+ constexpr std::string_view content{"Hello, world!"};
+ data->setContent({reinterpret_cast<const uint8_t*>(content.data()), content.size()});
+
+ // In order for the consumer application to be able to validate the packet, you need to setup
// the following keys:
// 1. Generate example trust anchor
//
@@ -91,7 +92,7 @@
onRegisterFailed(const Name& prefix, const std::string& reason)
{
std::cerr << "ERROR: Failed to register prefix '" << prefix
- << "' with the local forwarder (" << reason << ")" << std::endl;
+ << "' with the local forwarder (" << reason << ")\n";
m_face.shutdown();
}
diff --git a/ndn-cxx/data.cpp b/ndn-cxx/data.cpp
index 60a4aaa..4391d35 100644
--- a/ndn-cxx/data.cpp
+++ b/ndn-cxx/data.cpp
@@ -24,13 +24,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Data>));
-BOOST_CONCEPT_ASSERT((WireEncodable<Data>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Data>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Data>));
-static_assert(std::is_convertible_v<Data::Error*, tlv::Error*>,
- "Data::Error must inherit from tlv::Error");
-
Data::Data(const Name& name)
: m_name(name)
{
diff --git a/ndn-cxx/detail/common.hpp b/ndn-cxx/detail/common.hpp
index 631aa2f..9071d8c 100644
--- a/ndn-cxx/detail/common.hpp
+++ b/ndn-cxx/detail/common.hpp
@@ -111,7 +111,6 @@
/// \endcond
#include <boost/assert.hpp>
-#include <boost/concept_check.hpp>
#include <boost/core/noncopyable.hpp>
namespace ndn {
diff --git a/ndn-cxx/encoding/block-helpers.hpp b/ndn-cxx/encoding/block-helpers.hpp
index fc74354..653280d 100644
--- a/ndn-cxx/encoding/block-helpers.hpp
+++ b/ndn-cxx/encoding/block-helpers.hpp
@@ -257,7 +257,7 @@
* @param length length of value buffer
* @deprecated Use makeStringBlock()
*/
-[[deprecated("use makeStringBlock")]]
+[[deprecated("use makeStringBlock()")]]
inline Block
makeBinaryBlock(uint32_t type, const char* value, size_t length)
{
diff --git a/ndn-cxx/encoding/block.cpp b/ndn-cxx/encoding/block.cpp
index d2a4161..358871d 100644
--- a/ndn-cxx/encoding/block.cpp
+++ b/ndn-cxx/encoding/block.cpp
@@ -37,8 +37,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Block>));
-
constexpr size_t MAX_SIZE_OF_BLOCK_FROM_STREAM = MAX_NDN_PACKET_SIZE;
// ---- constructor, creation, assignment ----
diff --git a/ndn-cxx/encoding/block.hpp b/ndn-cxx/encoding/block.hpp
index b943982..c9cf885 100644
--- a/ndn-cxx/encoding/block.hpp
+++ b/ndn-cxx/encoding/block.hpp
@@ -246,6 +246,7 @@
/**
* @deprecated Use data()
*/
+ [[deprecated("use data()")]]
const uint8_t*
wire() const
{
diff --git a/ndn-cxx/impl/common-pch.hpp b/ndn-cxx/impl/common-pch.hpp
index 61dd2c1..c7fcd43 100644
--- a/ndn-cxx/impl/common-pch.hpp
+++ b/ndn-cxx/impl/common-pch.hpp
@@ -45,6 +45,7 @@
#include <boost/asio/basic_socket.hpp>
#include <boost/bind/bind.hpp>
#include <boost/chrono.hpp>
+#include <boost/concept_check.hpp>
#include <boost/endian/conversion.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/lexical_cast.hpp>
diff --git a/ndn-cxx/interest.cpp b/ndn-cxx/interest.cpp
index a7f919a..f5b1ea3 100644
--- a/ndn-cxx/interest.cpp
+++ b/ndn-cxx/interest.cpp
@@ -35,14 +35,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((WireEncodable<Interest>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Interest>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Interest>));
-static_assert(std::is_convertible_v<Interest::Error*, tlv::Error*>,
- "Interest::Error must inherit from tlv::Error");
-
-bool Interest::s_autoCheckParametersDigest = true;
-
Interest::Interest(const Name& name, time::milliseconds lifetime)
{
setName(name);
diff --git a/ndn-cxx/interest.hpp b/ndn-cxx/interest.hpp
index 4bf8e51..dff5f39 100644
--- a/ndn-cxx/interest.hpp
+++ b/ndn-cxx/interest.hpp
@@ -490,8 +490,6 @@
findFirstParameter(uint32_t type) const;
private:
- static bool s_autoCheckParametersDigest;
-
Name m_name;
std::vector<Name> m_forwardingHint;
mutable std::optional<Nonce> m_nonce;
@@ -509,6 +507,8 @@
std::vector<Block> m_parameters;
mutable Block m_wire;
+
+ static inline bool s_autoCheckParametersDigest = true;
};
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Interest);
diff --git a/ndn-cxx/key-locator.cpp b/ndn-cxx/key-locator.cpp
index c094c0c..03fae6b 100644
--- a/ndn-cxx/key-locator.cpp
+++ b/ndn-cxx/key-locator.cpp
@@ -27,13 +27,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<KeyLocator>));
-BOOST_CONCEPT_ASSERT((WireEncodable<KeyLocator>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<KeyLocator>));
-BOOST_CONCEPT_ASSERT((WireDecodable<KeyLocator>));
-static_assert(std::is_convertible_v<KeyLocator::Error*, tlv::Error*>,
- "KeyLocator::Error must inherit from tlv::Error");
-
constexpr size_t MAX_KEY_DIGEST_OCTETS_TO_SHOW = 8;
KeyLocator::KeyLocator() = default;
diff --git a/ndn-cxx/link.cpp b/ndn-cxx/link.cpp
index 568f0fd..976a722 100644
--- a/ndn-cxx/link.cpp
+++ b/ndn-cxx/link.cpp
@@ -25,13 +25,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Link>));
-BOOST_CONCEPT_ASSERT((WireEncodable<Link>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Link>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Link>));
-static_assert(std::is_convertible_v<Link::Error*, Data::Error*>,
- "Link::Error should inherit from Data::Error");
-
Link::Link() = default;
Link::Link(const Block& wire)
diff --git a/ndn-cxx/lp/field-decl.hpp b/ndn-cxx/lp/field-decl.hpp
index 3cbdb09..de264b7 100644
--- a/ndn-cxx/lp/field-decl.hpp
+++ b/ndn-cxx/lp/field-decl.hpp
@@ -22,11 +22,8 @@
#ifndef NDN_CXX_LP_FIELD_DECL_HPP
#define NDN_CXX_LP_FIELD_DECL_HPP
-#include "ndn-cxx/lp/empty-value.hpp"
-#include "ndn-cxx/lp/field.hpp"
-#include "ndn-cxx/lp/sequence.hpp"
-#include "ndn-cxx/lp/tlv.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
+#include "ndn-cxx/lp/empty-value.hpp"
#include "ndn-cxx/util/concepts.hpp"
#include <boost/concept/requires.hpp>
diff --git a/ndn-cxx/lp/field.hpp b/ndn-cxx/lp/field.hpp
index e1d2164..4ba87fa 100644
--- a/ndn-cxx/lp/field.hpp
+++ b/ndn-cxx/lp/field.hpp
@@ -22,9 +22,9 @@
#ifndef NDN_CXX_LP_FIELD_HPP
#define NDN_CXX_LP_FIELD_HPP
-#include "ndn-cxx/detail/common.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
-#include "ndn-cxx/util/concepts.hpp"
+
+#include <boost/concept/usage.hpp>
namespace ndn {
namespace lp {
@@ -65,6 +65,7 @@
static_assert(std::is_same_v<typename X::IsRepeatable::value_type, bool>, "");
static_assert(std::is_default_constructible_v<typename X::ValueType>, "");
static_assert(std::is_copy_constructible_v<typename X::ValueType>, "");
+
BOOST_CONCEPT_USAGE(Field)
{
Block wire;
diff --git a/ndn-cxx/lp/fields.hpp b/ndn-cxx/lp/fields.hpp
index f705b36..78444ee 100644
--- a/ndn-cxx/lp/fields.hpp
+++ b/ndn-cxx/lp/fields.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,21 +22,33 @@
#ifndef NDN_CXX_LP_FIELDS_HPP
#define NDN_CXX_LP_FIELDS_HPP
-#include "ndn-cxx/lp/field-decl.hpp"
-
#include "ndn-cxx/lp/cache-policy.hpp"
+#include "ndn-cxx/lp/empty-value.hpp"
+#include "ndn-cxx/lp/field.hpp"
+#include "ndn-cxx/lp/field-decl.hpp"
#include "ndn-cxx/lp/nack-header.hpp"
#include "ndn-cxx/lp/prefix-announcement-header.hpp"
+#include "ndn-cxx/lp/sequence.hpp"
+#include "ndn-cxx/lp/tlv.hpp"
#include <boost/mpl/set.hpp>
namespace ndn {
namespace lp {
+/**
+ * \brief Declare the Fragment field.
+ *
+ * The fragment (i.e., payload) is the range of bytes between two provided iterators.
+ * During encoding, these bytes are copied from the Buffer into the LpPacket.
+ */
+typedef FieldDecl<field_location_tags::Fragment,
+ std::pair<Buffer::const_iterator, Buffer::const_iterator>,
+ tlv::Fragment> FragmentField;
+
typedef FieldDecl<field_location_tags::Header,
Sequence,
tlv::Sequence> SequenceField;
-BOOST_CONCEPT_ASSERT((Field<SequenceField>));
typedef FieldDecl<field_location_tags::Header,
uint64_t,
@@ -44,7 +56,6 @@
false,
NonNegativeIntegerTag,
NonNegativeIntegerTag> FragIndexField;
-BOOST_CONCEPT_ASSERT((Field<FragIndexField>));
typedef FieldDecl<field_location_tags::Header,
uint64_t,
@@ -52,30 +63,14 @@
false,
NonNegativeIntegerTag,
NonNegativeIntegerTag> FragCountField;
-BOOST_CONCEPT_ASSERT((Field<FragCountField>));
typedef FieldDecl<field_location_tags::Header,
std::pair<Buffer::const_iterator, Buffer::const_iterator>,
tlv::PitToken> PitTokenField;
-BOOST_CONCEPT_ASSERT((Field<PitTokenField>));
typedef FieldDecl<field_location_tags::Header,
NackHeader,
tlv::Nack> NackField;
-BOOST_CONCEPT_ASSERT((Field<NackField>));
-
-typedef FieldDecl<field_location_tags::Header,
- uint64_t,
- tlv::NextHopFaceId,
- false,
- NonNegativeIntegerTag,
- NonNegativeIntegerTag> NextHopFaceIdField;
-BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>));
-
-typedef FieldDecl<field_location_tags::Header,
- CachePolicy,
- tlv::CachePolicy> CachePolicyField;
-BOOST_CONCEPT_ASSERT((Field<CachePolicyField>));
typedef FieldDecl<field_location_tags::Header,
uint64_t,
@@ -83,7 +78,17 @@
false,
NonNegativeIntegerTag,
NonNegativeIntegerTag> IncomingFaceIdField;
-BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>));
+
+typedef FieldDecl<field_location_tags::Header,
+ uint64_t,
+ tlv::NextHopFaceId,
+ false,
+ NonNegativeIntegerTag,
+ NonNegativeIntegerTag> NextHopFaceIdField;
+
+typedef FieldDecl<field_location_tags::Header,
+ CachePolicy,
+ tlv::CachePolicy> CachePolicyField;
typedef FieldDecl<field_location_tags::Header,
uint64_t,
@@ -91,42 +96,28 @@
false,
NonNegativeIntegerTag,
NonNegativeIntegerTag> CongestionMarkField;
-BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>));
typedef FieldDecl<field_location_tags::Header,
Sequence,
tlv::Ack,
true> AckField;
-BOOST_CONCEPT_ASSERT((Field<AckField>));
typedef FieldDecl<field_location_tags::Header,
Sequence,
tlv::TxSequence> TxSequenceField;
-BOOST_CONCEPT_ASSERT((Field<TxSequenceField>));
typedef FieldDecl<field_location_tags::Header,
EmptyValue,
tlv::NonDiscovery> NonDiscoveryField;
-BOOST_CONCEPT_ASSERT((Field<NonDiscoveryField>));
typedef FieldDecl<field_location_tags::Header,
PrefixAnnouncementHeader,
tlv::PrefixAnnouncement> PrefixAnnouncementField;
-BOOST_CONCEPT_ASSERT((Field<PrefixAnnouncementField>));
-/** \brief Declare the Fragment field.
- *
- * The fragment (i.e. payload) is the bytes between two provided iterators. During encoding,
- * these bytes are copied from the Buffer into the LpPacket.
+/**
+ * \brief Set of all field declarations.
*/
-typedef FieldDecl<field_location_tags::Fragment,
- std::pair<Buffer::const_iterator, Buffer::const_iterator>,
- tlv::Fragment> FragmentField;
-BOOST_CONCEPT_ASSERT((Field<FragmentField>));
-
-/** \brief Set of all field declarations.
- */
-typedef boost::mpl::set<
+using FieldSet = boost::mpl::set<
FragmentField,
SequenceField,
FragIndexField,
@@ -141,7 +132,7 @@
TxSequenceField,
NonDiscoveryField,
PrefixAnnouncementField
- > FieldSet;
+>;
} // namespace lp
} // namespace ndn
diff --git a/ndn-cxx/lp/packet.cpp b/ndn-cxx/lp/packet.cpp
index abe8f0c..d6fb3e8 100644
--- a/ndn-cxx/lp/packet.cpp
+++ b/ndn-cxx/lp/packet.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,7 +20,6 @@
*/
#include "ndn-cxx/lp/packet.hpp"
-#include "ndn-cxx/lp/fields.hpp"
#include <boost/bind/bind.hpp>
#include <boost/mpl/for_each.hpp>
diff --git a/ndn-cxx/meta-info.cpp b/ndn-cxx/meta-info.cpp
index 338da33..ce04687 100644
--- a/ndn-cxx/meta-info.cpp
+++ b/ndn-cxx/meta-info.cpp
@@ -27,17 +27,7 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((WireEncodable<MetaInfo>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<MetaInfo>));
-BOOST_CONCEPT_ASSERT((WireDecodable<MetaInfo>));
-static_assert(std::is_convertible_v<MetaInfo::Error*, tlv::Error*>,
- "MetaInfo::Error must inherit from tlv::Error");
-
-MetaInfo::MetaInfo()
- : m_type(tlv::ContentType_Blob)
- , m_freshnessPeriod(DEFAULT_FRESHNESS_PERIOD)
-{
-}
+MetaInfo::MetaInfo() = default;
MetaInfo::MetaInfo(const Block& block)
{
diff --git a/ndn-cxx/meta-info.hpp b/ndn-cxx/meta-info.hpp
index e504c5c..886e8a3 100644
--- a/ndn-cxx/meta-info.hpp
+++ b/ndn-cxx/meta-info.hpp
@@ -195,8 +195,8 @@
findAppMetaInfo(uint32_t tlvType) const;
private:
- uint32_t m_type;
- time::milliseconds m_freshnessPeriod;
+ uint32_t m_type = tlv::ContentType_Blob;
+ time::milliseconds m_freshnessPeriod = DEFAULT_FRESHNESS_PERIOD;
std::optional<name::Component> m_finalBlockId;
std::list<Block> m_appMetaInfo;
diff --git a/ndn-cxx/mgmt/control-response.cpp b/ndn-cxx/mgmt/control-response.cpp
index cae2496..ce0b0da 100644
--- a/ndn-cxx/mgmt/control-response.cpp
+++ b/ndn-cxx/mgmt/control-response.cpp
@@ -26,12 +26,6 @@
namespace ndn {
namespace mgmt {
-// BOOST_CONCEPT_ASSERT((boost::EqualityComparable<ControlResponse>));
-BOOST_CONCEPT_ASSERT((WireEncodable<ControlResponse>));
-BOOST_CONCEPT_ASSERT((WireDecodable<ControlResponse>));
-static_assert(std::is_convertible_v<ControlResponse::Error*, tlv::Error*>,
- "ControlResponse::Error must inherit from tlv::Error");
-
ControlResponse::ControlResponse() = default;
ControlResponse::ControlResponse(uint32_t code, const std::string& text)
diff --git a/ndn-cxx/mgmt/dispatcher.cpp b/ndn-cxx/mgmt/dispatcher.cpp
index 4bb1b7a..4a2079d 100644
--- a/ndn-cxx/mgmt/dispatcher.cpp
+++ b/ndn-cxx/mgmt/dispatcher.cpp
@@ -202,7 +202,7 @@
{
if (validateParams(*parameters)) {
handler(prefix, interest, *parameters,
- [=] (const auto& resp) { this->sendControlResponse(resp, interest); });
+ [=] (const auto& resp) { sendControlResponse(resp, interest); });
}
else {
sendControlResponse(ControlResponse(400, "failed in validating parameters"), interest);
@@ -223,8 +223,8 @@
void
Dispatcher::addStatusDataset(const PartialName& relPrefix,
- Authorization authorize,
- StatusDatasetHandler handle)
+ Authorization auth,
+ StatusDatasetHandler handler)
{
if (!m_topLevelPrefixes.empty()) {
NDN_THROW(std::domain_error("one or more top-level prefix has been added"));
@@ -234,18 +234,22 @@
NDN_THROW(std::out_of_range("status dataset name overlaps"));
}
- AuthorizationAcceptedCallback accepted =
- std::bind(&Dispatcher::processAuthorizedStatusDatasetInterest, this, _2, _3, std::move(handle));
- AuthorizationRejectedCallback rejected = [this] (auto&&... args) {
- afterAuthorizationRejected(std::forward<decltype(args)>(args)...);
- };
-
+ AuthorizationAcceptedCallback accept =
+ [this, handler = std::move(handler)] (auto&&, const auto& prefix, const auto& interest, auto&&) {
+ processAuthorizedStatusDatasetInterest(prefix, interest, handler);
+ };
+ AuthorizationRejectedCallback reject =
+ [this] (auto&&... args) {
+ afterAuthorizationRejected(std::forward<decltype(args)>(args)...);
+ };
// follow the general path if storage is a miss
- InterestHandler missContinuation = std::bind(&Dispatcher::processStatusDatasetInterest, this, _1, _2,
- std::move(authorize), std::move(accepted), std::move(rejected));
+ InterestHandler missContinuation =
+ [this, auth = std::move(auth), accept = std::move(accept), reject = std::move(reject)] (auto&&... args) {
+ processStatusDatasetInterest(std::forward<decltype(args)>(args)..., auth, accept, reject);
+ };
m_handlers[relPrefix] = [this, miss = std::move(missContinuation)] (auto&&... args) {
- this->queryStorage(std::forward<decltype(args)>(args)..., miss);
+ queryStorage(std::forward<decltype(args)>(args)..., miss);
};
}
@@ -315,7 +319,7 @@
// register a handler for the subscriber of this notification stream
// keep silent if Interest does not match a stored notification
m_handlers[relPrefix] = [this] (auto&&... args) {
- this->queryStorage(std::forward<decltype(args)>(args)..., nullptr);
+ queryStorage(std::forward<decltype(args)>(args)..., nullptr);
};
m_streams[relPrefix] = 0;
diff --git a/ndn-cxx/mgmt/nfd/channel-status.cpp b/ndn-cxx/mgmt/nfd/channel-status.cpp
index 98e72fc..f39f11a 100644
--- a/ndn-cxx/mgmt/nfd/channel-status.cpp
+++ b/ndn-cxx/mgmt/nfd/channel-status.cpp
@@ -22,13 +22,10 @@
#include "ndn-cxx/mgmt/nfd/channel-status.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<ChannelStatus>));
-
ChannelStatus::ChannelStatus() = default;
ChannelStatus::ChannelStatus(const Block& payload)
diff --git a/ndn-cxx/mgmt/nfd/control-parameters.cpp b/ndn-cxx/mgmt/nfd/control-parameters.cpp
index 1734272..9ec7234 100644
--- a/ndn-cxx/mgmt/nfd/control-parameters.cpp
+++ b/ndn-cxx/mgmt/nfd/control-parameters.cpp
@@ -22,18 +22,11 @@
#include "ndn-cxx/mgmt/nfd/control-parameters.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/string-helper.hpp"
namespace ndn {
namespace nfd {
-//BOOST_CONCEPT_ASSERT((boost::EqualityComparable<ControlParameters>));
-BOOST_CONCEPT_ASSERT((WireEncodable<ControlParameters>));
-BOOST_CONCEPT_ASSERT((WireDecodable<ControlParameters>));
-static_assert(std::is_convertible_v<ControlParameters::Error*, tlv::Error*>,
- "ControlParameters::Error must inherit from tlv::Error");
-
ControlParameters::ControlParameters()
: m_hasFields(CONTROL_PARAMETER_UBOUND)
{
diff --git a/ndn-cxx/mgmt/nfd/cs-info.cpp b/ndn-cxx/mgmt/nfd/cs-info.cpp
index 36cda7e..cfae566 100644
--- a/ndn-cxx/mgmt/nfd/cs-info.cpp
+++ b/ndn-cxx/mgmt/nfd/cs-info.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,20 +23,11 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<CsInfo>));
-
-CsInfo::CsInfo()
- : m_capacity(0)
- , m_nEntries(0)
- , m_nHits(0)
- , m_nMisses(0)
-{
-}
+CsInfo::CsInfo() = default;
CsInfo::CsInfo(const Block& block)
{
diff --git a/ndn-cxx/mgmt/nfd/cs-info.hpp b/ndn-cxx/mgmt/nfd/cs-info.hpp
index 095c86f..541c08c 100644
--- a/ndn-cxx/mgmt/nfd/cs-info.hpp
+++ b/ndn-cxx/mgmt/nfd/cs-info.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -127,11 +127,11 @@
private:
using FlagsBitSet = std::bitset<2>;
- uint64_t m_capacity;
+ uint64_t m_capacity = 0;
FlagsBitSet m_flags;
- uint64_t m_nEntries;
- uint64_t m_nHits;
- uint64_t m_nMisses;
+ uint64_t m_nEntries = 0;
+ uint64_t m_nHits = 0;
+ uint64_t m_nMisses = 0;
mutable Block m_wire;
};
diff --git a/ndn-cxx/mgmt/nfd/face-event-notification.cpp b/ndn-cxx/mgmt/nfd/face-event-notification.cpp
index 517064a..de5dc40 100644
--- a/ndn-cxx/mgmt/nfd/face-event-notification.cpp
+++ b/ndn-cxx/mgmt/nfd/face-event-notification.cpp
@@ -23,14 +23,11 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/string-helper.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((NotificationStreamItem<FaceEventNotification>));
-
FaceEventNotification::FaceEventNotification() = default;
FaceEventNotification::FaceEventNotification(const Block& block)
diff --git a/ndn-cxx/mgmt/nfd/face-query-filter.cpp b/ndn-cxx/mgmt/nfd/face-query-filter.cpp
index ef4158a..1cf2d5c 100644
--- a/ndn-cxx/mgmt/nfd/face-query-filter.cpp
+++ b/ndn-cxx/mgmt/nfd/face-query-filter.cpp
@@ -22,17 +22,10 @@
#include "ndn-cxx/mgmt/nfd/face-query-filter.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<FaceQueryFilter>));
-BOOST_CONCEPT_ASSERT((WireEncodable<FaceQueryFilter>));
-BOOST_CONCEPT_ASSERT((WireDecodable<FaceQueryFilter>));
-static_assert(std::is_convertible_v<FaceQueryFilter::Error*, tlv::Error*>,
- "FaceQueryFilter::Error must inherit from tlv::Error");
-
FaceQueryFilter::FaceQueryFilter() = default;
FaceQueryFilter::FaceQueryFilter(const Block& block)
diff --git a/ndn-cxx/mgmt/nfd/face-status.cpp b/ndn-cxx/mgmt/nfd/face-status.cpp
index a9b1c00..04b4bdb 100644
--- a/ndn-cxx/mgmt/nfd/face-status.cpp
+++ b/ndn-cxx/mgmt/nfd/face-status.cpp
@@ -23,25 +23,12 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/string-helper.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<FaceStatus>));
-
-FaceStatus::FaceStatus()
- : m_nInInterests(0)
- , m_nInData(0)
- , m_nInNacks(0)
- , m_nOutInterests(0)
- , m_nOutData(0)
- , m_nOutNacks(0)
- , m_nInBytes(0)
- , m_nOutBytes(0)
-{
-}
+FaceStatus::FaceStatus() = default;
FaceStatus::FaceStatus(const Block& block)
{
diff --git a/ndn-cxx/mgmt/nfd/face-status.hpp b/ndn-cxx/mgmt/nfd/face-status.hpp
index 893634b..7cd9da3 100644
--- a/ndn-cxx/mgmt/nfd/face-status.hpp
+++ b/ndn-cxx/mgmt/nfd/face-status.hpp
@@ -225,14 +225,14 @@
std::optional<time::nanoseconds> m_baseCongestionMarkingInterval;
std::optional<uint64_t> m_defaultCongestionThreshold;
std::optional<uint64_t> m_mtu;
- uint64_t m_nInInterests;
- uint64_t m_nInData;
- uint64_t m_nInNacks;
- uint64_t m_nOutInterests;
- uint64_t m_nOutData;
- uint64_t m_nOutNacks;
- uint64_t m_nInBytes;
- uint64_t m_nOutBytes;
+ uint64_t m_nInInterests = 0;
+ uint64_t m_nInData = 0;
+ uint64_t m_nInNacks = 0;
+ uint64_t m_nOutInterests = 0;
+ uint64_t m_nOutData = 0;
+ uint64_t m_nOutNacks = 0;
+ uint64_t m_nInBytes = 0;
+ uint64_t m_nOutBytes = 0;
};
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(FaceStatus);
diff --git a/ndn-cxx/mgmt/nfd/fib-entry.cpp b/ndn-cxx/mgmt/nfd/fib-entry.cpp
index e5438eb..d2c4f5a 100644
--- a/ndn-cxx/mgmt/nfd/fib-entry.cpp
+++ b/ndn-cxx/mgmt/nfd/fib-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,7 +23,6 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/ostream-joiner.hpp"
#include <boost/range/adaptor/reversed.hpp>
@@ -31,14 +30,7 @@
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<NextHopRecord>));
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<FibEntry>));
-
-NextHopRecord::NextHopRecord()
- : m_faceId(INVALID_FACE_ID)
- , m_cost(0)
-{
-}
+NextHopRecord::NextHopRecord() = default;
NextHopRecord::NextHopRecord(const Block& block)
{
diff --git a/ndn-cxx/mgmt/nfd/fib-entry.hpp b/ndn-cxx/mgmt/nfd/fib-entry.hpp
index ed1925e..b68071d 100644
--- a/ndn-cxx/mgmt/nfd/fib-entry.hpp
+++ b/ndn-cxx/mgmt/nfd/fib-entry.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,8 +22,8 @@
#ifndef NDN_CXX_MGMT_NFD_FIB_ENTRY_HPP
#define NDN_CXX_MGMT_NFD_FIB_ENTRY_HPP
+#include "ndn-cxx/encoding/nfd-constants.hpp"
#include "ndn-cxx/name.hpp"
-#include "ndn-cxx/encoding/block.hpp"
namespace ndn {
namespace nfd {
@@ -74,8 +74,8 @@
wireDecode(const Block& block);
private:
- uint64_t m_faceId;
- uint64_t m_cost;
+ uint64_t m_faceId = INVALID_FACE_ID;
+ uint64_t m_cost = 0;
mutable Block m_wire;
};
diff --git a/ndn-cxx/mgmt/nfd/forwarder-status.cpp b/ndn-cxx/mgmt/nfd/forwarder-status.cpp
index fc00be1..09b3971 100644
--- a/ndn-cxx/mgmt/nfd/forwarder-status.cpp
+++ b/ndn-cxx/mgmt/nfd/forwarder-status.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,29 +23,11 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<ForwarderStatus>));
-
-ForwarderStatus::ForwarderStatus()
- : m_nNameTreeEntries(0)
- , m_nFibEntries(0)
- , m_nPitEntries(0)
- , m_nMeasurementsEntries(0)
- , m_nCsEntries(0)
- , m_nInInterests(0)
- , m_nInData(0)
- , m_nInNacks(0)
- , m_nOutInterests(0)
- , m_nOutData(0)
- , m_nOutNacks(0)
- , m_nSatisfiedInterests(0)
- , m_nUnsatisfiedInterests(0)
-{
-}
+ForwarderStatus::ForwarderStatus() = default;
ForwarderStatus::ForwarderStatus(const Block& payload)
{
diff --git a/ndn-cxx/mgmt/nfd/forwarder-status.hpp b/ndn-cxx/mgmt/nfd/forwarder-status.hpp
index 5733c1f..e010732 100644
--- a/ndn-cxx/mgmt/nfd/forwarder-status.hpp
+++ b/ndn-cxx/mgmt/nfd/forwarder-status.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -79,23 +79,23 @@
ForwarderStatus&
setNfdVersion(const std::string& nfdVersion);
- const time::system_clock::TimePoint&
+ const time::system_clock::time_point&
getStartTimestamp() const
{
return m_startTimestamp;
}
ForwarderStatus&
- setStartTimestamp(const time::system_clock::TimePoint& startTimestamp);
+ setStartTimestamp(const time::system_clock::time_point& startTimestamp);
- const time::system_clock::TimePoint&
+ const time::system_clock::time_point&
getCurrentTimestamp() const
{
return m_currentTimestamp;
}
ForwarderStatus&
- setCurrentTimestamp(const time::system_clock::TimePoint& currentTimestamp);
+ setCurrentTimestamp(const time::system_clock::time_point& currentTimestamp);
uint64_t
getNNameTreeEntries() const
@@ -216,21 +216,21 @@
private:
std::string m_nfdVersion;
- time::system_clock::TimePoint m_startTimestamp;
- time::system_clock::TimePoint m_currentTimestamp;
- uint64_t m_nNameTreeEntries;
- uint64_t m_nFibEntries;
- uint64_t m_nPitEntries;
- uint64_t m_nMeasurementsEntries;
- uint64_t m_nCsEntries;
- uint64_t m_nInInterests;
- uint64_t m_nInData;
- uint64_t m_nInNacks;
- uint64_t m_nOutInterests;
- uint64_t m_nOutData;
- uint64_t m_nOutNacks;
- uint64_t m_nSatisfiedInterests;
- uint64_t m_nUnsatisfiedInterests;
+ time::system_clock::time_point m_startTimestamp;
+ time::system_clock::time_point m_currentTimestamp;
+ uint64_t m_nNameTreeEntries = 0;
+ uint64_t m_nFibEntries = 0;
+ uint64_t m_nPitEntries = 0;
+ uint64_t m_nMeasurementsEntries = 0;
+ uint64_t m_nCsEntries = 0;
+ uint64_t m_nInInterests = 0;
+ uint64_t m_nInData = 0;
+ uint64_t m_nInNacks = 0;
+ uint64_t m_nOutInterests = 0;
+ uint64_t m_nOutData = 0;
+ uint64_t m_nOutNacks = 0;
+ uint64_t m_nSatisfiedInterests = 0;
+ uint64_t m_nUnsatisfiedInterests = 0;
mutable Block m_wire;
};
diff --git a/ndn-cxx/mgmt/nfd/rib-entry.cpp b/ndn-cxx/mgmt/nfd/rib-entry.cpp
index 0356f68..73e7f43 100644
--- a/ndn-cxx/mgmt/nfd/rib-entry.cpp
+++ b/ndn-cxx/mgmt/nfd/rib-entry.cpp
@@ -23,7 +23,6 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/ostream-joiner.hpp"
#include "ndn-cxx/util/string-helper.hpp"
@@ -32,16 +31,7 @@
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<Route>));
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<RibEntry>));
-
-Route::Route()
- : m_faceId(INVALID_FACE_ID)
- , m_origin(ROUTE_ORIGIN_APP)
- , m_cost(0)
- , m_flags(ROUTE_FLAG_CHILD_INHERIT)
-{
-}
+Route::Route() = default;
Route::Route(const Block& block)
{
diff --git a/ndn-cxx/mgmt/nfd/rib-entry.hpp b/ndn-cxx/mgmt/nfd/rib-entry.hpp
index c91946f..24eb78b 100644
--- a/ndn-cxx/mgmt/nfd/rib-entry.hpp
+++ b/ndn-cxx/mgmt/nfd/rib-entry.hpp
@@ -22,9 +22,9 @@
#ifndef NDN_CXX_MGMT_NFD_RIB_ENTRY_HPP
#define NDN_CXX_MGMT_NFD_RIB_ENTRY_HPP
-#include "ndn-cxx/name.hpp"
-#include "ndn-cxx/encoding/block.hpp"
+#include "ndn-cxx/encoding/nfd-constants.hpp"
#include "ndn-cxx/mgmt/nfd/route-flags-traits.hpp"
+#include "ndn-cxx/name.hpp"
#include "ndn-cxx/util/time.hpp"
namespace ndn {
@@ -118,10 +118,10 @@
wireDecode(const Block& block);
private:
- uint64_t m_faceId;
- RouteOrigin m_origin;
- uint64_t m_cost;
- uint64_t m_flags;
+ uint64_t m_faceId = INVALID_FACE_ID;
+ RouteOrigin m_origin = ROUTE_ORIGIN_APP;
+ uint64_t m_cost = 0;
+ uint64_t m_flags = ROUTE_FLAG_CHILD_INHERIT;
std::optional<time::milliseconds> m_expirationPeriod;
mutable Block m_wire;
diff --git a/ndn-cxx/mgmt/nfd/strategy-choice.cpp b/ndn-cxx/mgmt/nfd/strategy-choice.cpp
index c2a7524..6ef45c5 100644
--- a/ndn-cxx/mgmt/nfd/strategy-choice.cpp
+++ b/ndn-cxx/mgmt/nfd/strategy-choice.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,13 +23,10 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-nfd.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace nfd {
-BOOST_CONCEPT_ASSERT((StatusDatasetItem<StrategyChoice>));
-
StrategyChoice::StrategyChoice() = default;
StrategyChoice::StrategyChoice(const Block& payload)
diff --git a/ndn-cxx/name-component.cpp b/ndn-cxx/name-component.cpp
index cc98046..abedc2c 100644
--- a/ndn-cxx/name-component.cpp
+++ b/ndn-cxx/name-component.cpp
@@ -35,13 +35,6 @@
namespace ndn {
namespace name {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Component>));
-BOOST_CONCEPT_ASSERT((WireEncodable<Component>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Component>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Component>));
-static_assert(std::is_convertible_v<Component::Error*, tlv::Error*>,
- "name::Component::Error must inherit from tlv::Error");
-
static Convention g_conventionEncoding = Convention::TYPED;
static Convention g_conventionDecoding = Convention::EITHER;
diff --git a/ndn-cxx/name.cpp b/ndn-cxx/name.cpp
index 1c158ce..9f38e4a 100644
--- a/ndn-cxx/name.cpp
+++ b/ndn-cxx/name.cpp
@@ -31,28 +31,12 @@
#include <sstream>
#include <boost/functional/hash.hpp>
#include <boost/range/adaptor/reversed.hpp>
-#include <boost/range/concepts.hpp>
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Name>));
-BOOST_CONCEPT_ASSERT((WireEncodable<Name>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Name>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Name>));
-BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::iterator>));
-BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::const_iterator>));
-BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::reverse_iterator>));
-BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::const_reverse_iterator>));
-BOOST_CONCEPT_ASSERT((boost::RandomAccessRangeConcept<Name>));
-static_assert(std::is_convertible_v<Name::Error*, tlv::Error*>,
- "Name::Error must inherit from tlv::Error");
-
// ---- constructors, encoding, decoding ----
-Name::Name()
- : m_wire(tlv::Name)
-{
-}
+Name::Name() = default;
Name::Name(const Block& wire)
: m_wire(wire)
diff --git a/ndn-cxx/name.hpp b/ndn-cxx/name.hpp
index a45c3fc..9968e5c 100644
--- a/ndn-cxx/name.hpp
+++ b/ndn-cxx/name.hpp
@@ -701,7 +701,7 @@
static constexpr size_t npos = std::numeric_limits<size_t>::max();
private:
- mutable Block m_wire;
+ mutable Block m_wire{tlv::Name};
};
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Name);
diff --git a/ndn-cxx/net/face-uri.cpp b/ndn-cxx/net/face-uri.cpp
index 239c0d2..0a40b5a 100644
--- a/ndn-cxx/net/face-uri.cpp
+++ b/ndn-cxx/net/face-uri.cpp
@@ -41,8 +41,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<FaceUri>));
-
FaceUri::FaceUri() = default;
FaceUri::FaceUri(const std::string& uri)
diff --git a/ndn-cxx/security/additional-description.cpp b/ndn-cxx/security/additional-description.cpp
index c5091ee..727cb57 100644
--- a/ndn-cxx/security/additional-description.cpp
+++ b/ndn-cxx/security/additional-description.cpp
@@ -21,20 +21,12 @@
#include "ndn-cxx/security/additional-description.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/ostream-joiner.hpp"
namespace ndn {
namespace security {
inline namespace v2 {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<AdditionalDescription>));
-BOOST_CONCEPT_ASSERT((WireEncodable<AdditionalDescription>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<AdditionalDescription>));
-BOOST_CONCEPT_ASSERT((WireDecodable<AdditionalDescription>));
-static_assert(std::is_convertible_v<AdditionalDescription::Error*, tlv::Error*>,
- "AdditionalDescription::Error must inherit from tlv::Error");
-
constexpr size_t KEY_OFFSET = 0;
constexpr size_t VALUE_OFFSET = 1;
diff --git a/ndn-cxx/security/certificate.cpp b/ndn-cxx/security/certificate.cpp
index 68f7c83..67706fd 100644
--- a/ndn-cxx/security/certificate.cpp
+++ b/ndn-cxx/security/certificate.cpp
@@ -31,11 +31,6 @@
namespace security {
inline namespace v2 {
-BOOST_CONCEPT_ASSERT((WireEncodable<Certificate>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Certificate>));
-static_assert(std::is_convertible_v<Certificate::Error*, Data::Error*>,
- "Certificate::Error must inherit from Data::Error");
-
Certificate::Certificate()
{
setContentType(tlv::ContentType_Key);
diff --git a/ndn-cxx/security/pib/certificate-container.cpp b/ndn-cxx/security/pib/certificate-container.cpp
index 76746ba..24f66ce 100644
--- a/ndn-cxx/security/pib/certificate-container.cpp
+++ b/ndn-cxx/security/pib/certificate-container.cpp
@@ -21,7 +21,6 @@
#include "ndn-cxx/security/pib/certificate-container.hpp"
#include "ndn-cxx/security/pib/pib-impl.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/logger.hpp"
namespace ndn {
@@ -30,8 +29,6 @@
NDN_LOG_INIT(ndn.security.CertificateContainer);
-NDN_CXX_ASSERT_FORWARD_ITERATOR(CertificateContainer::const_iterator);
-
CertificateContainer::const_iterator::const_iterator(NameSet::const_iterator it,
const CertificateContainer& container) noexcept
: m_it(it)
diff --git a/ndn-cxx/security/pib/identity-container.cpp b/ndn-cxx/security/pib/identity-container.cpp
index f91832e..6afeae0 100644
--- a/ndn-cxx/security/pib/identity-container.cpp
+++ b/ndn-cxx/security/pib/identity-container.cpp
@@ -22,7 +22,6 @@
#include "ndn-cxx/security/pib/identity-container.hpp"
#include "ndn-cxx/security/pib/impl/identity-impl.hpp"
#include "ndn-cxx/security/pib/pib-impl.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/logger.hpp"
namespace ndn {
@@ -31,8 +30,6 @@
NDN_LOG_INIT(ndn.security.IdentityContainer);
-NDN_CXX_ASSERT_FORWARD_ITERATOR(IdentityContainer::const_iterator);
-
IdentityContainer::const_iterator::const_iterator(NameSet::const_iterator it,
const IdentityContainer& container) noexcept
: m_it(it)
diff --git a/ndn-cxx/security/pib/key-container.cpp b/ndn-cxx/security/pib/key-container.cpp
index b2e2d60..c13c133 100644
--- a/ndn-cxx/security/pib/key-container.cpp
+++ b/ndn-cxx/security/pib/key-container.cpp
@@ -22,7 +22,6 @@
#include "ndn-cxx/security/pib/key-container.hpp"
#include "ndn-cxx/security/pib/impl/key-impl.hpp"
#include "ndn-cxx/security/pib/pib-impl.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/logger.hpp"
namespace ndn {
@@ -31,8 +30,6 @@
NDN_LOG_INIT(ndn.security.KeyContainer);
-NDN_CXX_ASSERT_FORWARD_ITERATOR(KeyContainer::const_iterator);
-
KeyContainer::const_iterator::const_iterator(NameSet::const_iterator it,
const KeyContainer& container) noexcept
: m_it(it)
diff --git a/ndn-cxx/security/safe-bag.cpp b/ndn-cxx/security/safe-bag.cpp
index d9928a5..b6e6997 100644
--- a/ndn-cxx/security/safe-bag.cpp
+++ b/ndn-cxx/security/safe-bag.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,14 +24,10 @@
#include "ndn-cxx/security/safe-bag.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
#include "ndn-cxx/encoding/tlv-security.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace security {
-BOOST_CONCEPT_ASSERT((WireEncodable<SafeBag>));
-BOOST_CONCEPT_ASSERT((WireDecodable<SafeBag>));
-
SafeBag::SafeBag() = default;
SafeBag::SafeBag(const Block& wire)
diff --git a/ndn-cxx/security/validity-period.cpp b/ndn-cxx/security/validity-period.cpp
index ff77747..c7f5b5d 100644
--- a/ndn-cxx/security/validity-period.cpp
+++ b/ndn-cxx/security/validity-period.cpp
@@ -21,24 +21,16 @@
#include "ndn-cxx/security/validity-period.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
-#include "ndn-cxx/util/concepts.hpp"
namespace ndn {
namespace security {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<ValidityPeriod>));
-BOOST_CONCEPT_ASSERT((WireEncodable<ValidityPeriod>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<ValidityPeriod>));
-BOOST_CONCEPT_ASSERT((WireDecodable<ValidityPeriod>));
-static_assert(std::is_convertible_v<ValidityPeriod::Error*, tlv::Error*>,
- "ValidityPeriod::Error must inherit from tlv::Error");
+using boost::chrono::time_point_cast;
constexpr size_t ISO_DATETIME_SIZE = 15;
constexpr size_t NOT_BEFORE_OFFSET = 0;
constexpr size_t NOT_AFTER_OFFSET = 1;
-using boost::chrono::time_point_cast;
-
ValidityPeriod
ValidityPeriod::makeRelative(time::seconds validFrom, time::seconds validUntil,
const time::system_clock::TimePoint& now)
diff --git a/ndn-cxx/signature-info.cpp b/ndn-cxx/signature-info.cpp
index 5188002..43fad2d 100644
--- a/ndn-cxx/signature-info.cpp
+++ b/ndn-cxx/signature-info.cpp
@@ -21,7 +21,6 @@
#include "ndn-cxx/signature-info.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
-#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/string-helper.hpp"
#include <algorithm>
@@ -29,13 +28,6 @@
namespace ndn {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<SignatureInfo>));
-BOOST_CONCEPT_ASSERT((WireEncodable<SignatureInfo>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<SignatureInfo>));
-BOOST_CONCEPT_ASSERT((WireDecodable<SignatureInfo>));
-static_assert(std::is_convertible_v<SignatureInfo::Error*, tlv::Error*>,
- "SignatureInfo::Error must inherit from tlv::Error");
-
SignatureInfo::SignatureInfo() = default;
SignatureInfo::SignatureInfo(tlv::SignatureTypeValue type, std::optional<KeyLocator> keyLocator)
diff --git a/ndn-cxx/util/concepts.hpp b/ndn-cxx/util/concepts.hpp
index de721b6..bcd336d 100644
--- a/ndn-cxx/util/concepts.hpp
+++ b/ndn-cxx/util/concepts.hpp
@@ -31,6 +31,7 @@
#include "ndn-cxx/encoding/block.hpp"
#include "ndn-cxx/encoding/encoding-buffer.hpp"
+#include <boost/concept_check.hpp>
#include <boost/concept/usage.hpp>
#include <boost/type_traits/has_equal_to.hpp>
#include <boost/type_traits/has_not_equal_to.hpp>
diff --git a/ndn-cxx/util/dummy-client-face.cpp b/ndn-cxx/util/dummy-client-face.cpp
index f187b12..51fd77e 100644
--- a/ndn-cxx/util/dummy-client-face.cpp
+++ b/ndn-cxx/util/dummy-client-face.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,7 +23,7 @@
#include "ndn-cxx/impl/lp-field-tag.hpp"
#include "ndn-cxx/lp/packet.hpp"
#include "ndn-cxx/lp/tags.hpp"
-#include "ndn-cxx/mgmt/nfd/controller.hpp"
+#include "ndn-cxx/mgmt/nfd/control-parameters.hpp"
#include "ndn-cxx/mgmt/nfd/control-response.hpp"
#include "ndn-cxx/transport/transport.hpp"
diff --git a/ndn-cxx/util/signal/connection.cpp b/ndn-cxx/util/signal/connection.cpp
index 1eb6a08..1cc3fa5 100644
--- a/ndn-cxx/util/signal/connection.cpp
+++ b/ndn-cxx/util/signal/connection.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -25,8 +25,6 @@
namespace util {
namespace signal {
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Connection>));
-
Connection::Connection(weak_ptr<DisconnectFunction> disconnect) noexcept
: m_disconnect(std::move(disconnect))
{
diff --git a/tests/unit/data.t.cpp b/tests/unit/data.t.cpp
index 5162f4d..5706a3e 100644
--- a/tests/unit/data.t.cpp
+++ b/tests/unit/data.t.cpp
@@ -37,6 +37,13 @@
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Data>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Data>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Data>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Data>));
+static_assert(std::is_convertible_v<Data::Error*, tlv::Error*>,
+ "Data::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestData)
const uint8_t CONTENT1[] = {0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x21};
diff --git a/tests/unit/encoding/block.t.cpp b/tests/unit/encoding/block.t.cpp
index 2c75944..f75eaf0 100644
--- a/tests/unit/encoding/block.t.cpp
+++ b/tests/unit/encoding/block.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -34,6 +34,8 @@
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Block>));
+
BOOST_AUTO_TEST_SUITE(Encoding)
BOOST_AUTO_TEST_SUITE(TestBlock)
diff --git a/tests/unit/face.t.cpp b/tests/unit/face.t.cpp
index 94a2649..9d622ed 100644
--- a/tests/unit/face.t.cpp
+++ b/tests/unit/face.t.cpp
@@ -35,7 +35,6 @@
namespace tests {
using ndn::util::DummyClientFace;
-using std::bind;
struct WantPrefixRegReply;
struct NoPrefixRegReply;
@@ -100,8 +99,8 @@
BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
++nData;
},
- bind([] { BOOST_FAIL("Unexpected Nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(40_ms);
@@ -116,9 +115,9 @@
size_t nTimeouts = 0;
face.expressInterest(*makeInterest("/Hello/World/a/2", false, 50_ms),
- bind([]{}),
- bind([]{}),
- bind([&nTimeouts] { ++nTimeouts; }));
+ std::bind([]{}),
+ std::bind([]{}),
+ std::bind([&nTimeouts] { ++nTimeouts; }));
advanceClocks(200_ms, 5);
BOOST_CHECK_EQUAL(nTimeouts, 1);
}
@@ -129,13 +128,13 @@
face.expressInterest(*makeInterest("/Hello/World", true, 50_ms),
[&] (const auto&, const auto&) { ++nData; },
- bind([] { BOOST_FAIL("Unexpected Nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
face.expressInterest(*makeInterest("/Hello/World/a", true, 50_ms),
[&] (const auto&, const auto&) { ++nData; },
- bind([] { BOOST_FAIL("Unexpected Nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(40_ms);
@@ -152,8 +151,8 @@
{
face.expressInterest(*makeInterest("/Hello/World", true),
nullptr,
- bind([] { BOOST_FAIL("Unexpected Nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(1_ms);
BOOST_CHECK_NO_THROW(do {
@@ -166,8 +165,8 @@
{
size_t nTimeouts = 0;
face.expressInterest(*makeInterest("/Hello/World", false, 50_ms),
- bind([] { BOOST_FAIL("Unexpected Data"); }),
- bind([] { BOOST_FAIL("Unexpected Nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
[&nTimeouts] (const Interest& i) {
BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
++nTimeouts;
@@ -184,8 +183,8 @@
BOOST_AUTO_TEST_CASE(EmptyTimeoutCallback)
{
face.expressInterest(*makeInterest("/Hello/World", false, 50_ms),
- bind([] { BOOST_FAIL("Unexpected Data"); }),
- bind([] { BOOST_FAIL("Unexpected Nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Nack"); }),
nullptr);
advanceClocks(40_ms);
@@ -201,14 +200,14 @@
auto interest = makeInterest("/Hello/World", false, 50_ms);
face.expressInterest(*interest,
- bind([] { BOOST_FAIL("Unexpected Data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Data"); }),
[&] (const Interest& i, const lp::Nack& n) {
BOOST_CHECK(i.getName().isPrefixOf(n.getInterest().getName()));
BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
BOOST_CHECK_EQUAL(n.getReason(), lp::NackReason::DUPLICATE);
++nNacks;
},
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(40_ms);
@@ -226,15 +225,15 @@
auto interest = makeInterest("/Hello/World", false, 50_ms, 1);
face.expressInterest(*interest,
- bind([] { BOOST_FAIL("Unexpected Data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Data"); }),
[&] (const auto&, const auto&) { ++nNacks; },
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
interest->setNonce(2);
face.expressInterest(*interest,
- bind([] { BOOST_FAIL("Unexpected Data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Data"); }),
[&] (const auto&, const auto&) { ++nNacks; },
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(40_ms);
@@ -249,9 +248,9 @@
BOOST_AUTO_TEST_CASE(EmptyNackCallback)
{
face.expressInterest(*makeInterest("/Hello/World"),
- bind([] { BOOST_FAIL("Unexpected Data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected Data"); }),
nullptr,
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(1_ms);
BOOST_CHECK_NO_THROW(do {
@@ -294,9 +293,9 @@
BOOST_AUTO_TEST_CASE(Handle)
{
auto hdl = face.expressInterest(*makeInterest("/Hello/World", true, 50_ms),
- bind([] { BOOST_FAIL("Unexpected data"); }),
- bind([] { BOOST_FAIL("Unexpected nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(1_ms);
hdl.cancel();
advanceClocks(1_ms);
@@ -306,9 +305,9 @@
// cancel after destructing face
auto face2 = make_unique<DummyClientFace>(m_io, m_keyChain);
auto hdl2 = face2->expressInterest(*makeInterest("/Hello/World", true, 50_ms),
- bind([] { BOOST_FAIL("Unexpected data"); }),
- bind([] { BOOST_FAIL("Unexpected nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(1_ms);
face2.reset();
advanceClocks(1_ms);
@@ -324,14 +323,14 @@
BOOST_AUTO_TEST_CASE(RemoveAllPendingInterests)
{
face.expressInterest(*makeInterest("/Hello/World/0", false, 50_ms),
- bind([] { BOOST_FAIL("Unexpected data"); }),
- bind([] { BOOST_FAIL("Unexpected nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
face.expressInterest(*makeInterest("/Hello/World/1", false, 50_ms),
- bind([] { BOOST_FAIL("Unexpected data"); }),
- bind([] { BOOST_FAIL("Unexpected nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(10_ms);
@@ -380,12 +379,12 @@
});
// second InterestFilter disallows loopback and should not receive Interest
face.setInterestFilter(InterestFilter("/").allowLoopback(false),
- bind([] { BOOST_ERROR("Unexpected Interest on second InterestFilter"); }));
+ std::bind([] { BOOST_ERROR("Unexpected Interest on second InterestFilter"); }));
face.expressInterest(*makeInterest("/A", true),
- bind([&] { hasData = true; }),
- bind([] { BOOST_FAIL("Unexpected nack"); }),
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([&] { hasData = true; }),
+ std::bind([] { BOOST_FAIL("Unexpected nack"); }),
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(1_ms);
BOOST_CHECK_EQUAL(hasInterest1, true); // Interest looped back
BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); // Interest sent to forwarder
@@ -401,12 +400,12 @@
{
bool hasInterest1 = false;
// register two Interest destinations
- face.setInterestFilter("/", bind([&] {
+ face.setInterestFilter("/", std::bind([&] {
hasInterest1 = true;
// sending Data right away from the first destination, don't care whether Interest goes to second destination
face.put(*makeData("/A/B"));
}));
- face.setInterestFilter("/", bind([]{}));
+ face.setInterestFilter("/", std::bind([]{}));
advanceClocks(10_ms);
face.receive(*makeInterest("/A", true));
@@ -421,7 +420,7 @@
BOOST_AUTO_TEST_CASE(PutNack)
{
- face.setInterestFilter("/", bind([]{})); // register one Interest destination so that face can accept Nacks
+ face.setInterestFilter("/", std::bind([]{})); // register one Interest destination so that face can accept Nacks
advanceClocks(10_ms);
BOOST_CHECK_EQUAL(face.sentNacks.size(), 0);
@@ -461,7 +460,7 @@
// sending Nack right away from the first destination, Interest should still go to second destination
face.put(makeNack(interest, lp::NackReason::CONGESTION));
});
- face.setInterestFilter("/", bind([&] { hasInterest2 = true; }));
+ face.setInterestFilter("/", std::bind([&] { hasInterest2 = true; }));
advanceClocks(10_ms);
auto interest = makeInterest("/A", false, std::nullopt, 14333271);
@@ -493,16 +492,16 @@
});
// second InterestFilter disallows loopback and should not receive Interest
face.setInterestFilter(InterestFilter("/").allowLoopback(false),
- bind([] { BOOST_ERROR("Unexpected Interest on second InterestFilter"); }));
+ std::bind([] { BOOST_ERROR("Unexpected Interest on second InterestFilter"); }));
auto interest = makeInterest("/A", false, std::nullopt, 28395852);
face.expressInterest(*interest,
- bind([] { BOOST_FAIL("Unexpected data"); }),
+ std::bind([] { BOOST_FAIL("Unexpected data"); }),
[&] (const Interest&, const lp::Nack& nack) {
hasNack = true;
BOOST_CHECK_EQUAL(nack.getReason(), lp::NackReason::CONGESTION);
},
- bind([] { BOOST_FAIL("Unexpected timeout"); }));
+ std::bind([] { BOOST_FAIL("Unexpected timeout"); }));
advanceClocks(1_ms);
BOOST_CHECK_EQUAL(hasInterest1, true); // Interest looped back
BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); // Interest sent to forwarder
@@ -557,7 +556,7 @@
// cancel after destructing face
auto face2 = make_unique<DummyClientFace>(m_io, m_keyChain);
hdl = face2->registerPrefix("/Hello/World/2", nullptr,
- bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
advanceClocks(1_ms);
face2.reset();
advanceClocks(1_ms);
@@ -567,7 +566,7 @@
// unregister after destructing face
auto face3 = make_unique<DummyClientFace>(m_io, m_keyChain);
hdl = face3->registerPrefix("/Hello/World/3", nullptr,
- bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
advanceClocks(1_ms);
face3.reset();
advanceClocks(1_ms);
@@ -583,9 +582,9 @@
size_t nInterests = 0;
size_t nRegs = 0;
auto hdl = face.setInterestFilter("/Hello/World",
- bind([&nInterests] { ++nInterests; }),
- bind([&nRegs] { ++nRegs; }),
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([&nInterests] { ++nInterests; }),
+ std::bind([&nRegs] { ++nRegs; }),
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
advanceClocks(25_ms, 4);
BOOST_CHECK_EQUAL(nRegs, 1);
BOOST_CHECK_EQUAL(nInterests, 0);
@@ -627,8 +626,8 @@
{
size_t nInterests = 0;
auto hdl = face.setInterestFilter("/Hello/World",
- bind([&nInterests] { ++nInterests; }),
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([&nInterests] { ++nInterests; }),
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
advanceClocks(25_ms, 4);
BOOST_CHECK_EQUAL(nInterests, 0);
@@ -658,9 +657,9 @@
// don't enable registration reply
size_t nRegFailed = 0;
face.setInterestFilter("/Hello/World",
- bind([] { BOOST_FAIL("Unexpected Interest"); }),
- bind([] { BOOST_FAIL("Unexpected success of setInterestFilter"); }),
- bind([&nRegFailed] { ++nRegFailed; }));
+ std::bind([] { BOOST_FAIL("Unexpected Interest"); }),
+ std::bind([] { BOOST_FAIL("Unexpected success of setInterestFilter"); }),
+ std::bind([&nRegFailed] { ++nRegFailed; }));
advanceClocks(25_ms, 4);
BOOST_CHECK_EQUAL(nRegFailed, 0);
@@ -674,8 +673,8 @@
// don't enable registration reply
size_t nRegFailed = 0;
face.setInterestFilter("/Hello/World",
- bind([] { BOOST_FAIL("Unexpected Interest"); }),
- bind([&nRegFailed] { ++nRegFailed; }));
+ std::bind([] { BOOST_FAIL("Unexpected Interest"); }),
+ std::bind([&nRegFailed] { ++nRegFailed; }));
advanceClocks(25_ms, 4);
BOOST_CHECK_EQUAL(nRegFailed, 0);
@@ -688,21 +687,21 @@
{
size_t nInInterests1 = 0;
face.setInterestFilter("/Hello/World",
- bind([&nInInterests1] { ++nInInterests1; }),
+ std::bind([&nInInterests1] { ++nInInterests1; }),
nullptr,
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
size_t nInInterests2 = 0;
face.setInterestFilter("/Hello",
- bind([&nInInterests2] { ++nInInterests2; }),
+ std::bind([&nInInterests2] { ++nInInterests2; }),
nullptr,
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
size_t nInInterests3 = 0;
face.setInterestFilter("/Los/Angeles/Lakers",
- bind([&nInInterests3] { ++nInInterests3; }),
+ std::bind([&nInInterests3] { ++nInInterests3; }),
nullptr,
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
advanceClocks(25_ms, 4);
@@ -718,9 +717,9 @@
{
size_t nInInterests = 0;
face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
- bind([&nInInterests] { ++nInInterests; }),
+ std::bind([&nInInterests] { ++nInInterests; }),
nullptr,
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
advanceClocks(25_ms, 4);
@@ -744,7 +743,7 @@
BOOST_FAIL("InterestFilter::Error should have been triggered");
},
nullptr,
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
advanceClocks(25_ms, 4);
@@ -755,12 +754,12 @@
{
size_t nInInterests = 0;
face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
- bind([&nInInterests] { ++nInInterests; }));
+ std::bind([&nInInterests] { ++nInInterests; }));
size_t nRegSuccesses = 0;
face.registerPrefix("/Hello/World",
- bind([&nRegSuccesses] { ++nRegSuccesses; }),
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([&nRegSuccesses] { ++nRegSuccesses; }),
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
advanceClocks(25_ms, 4);
BOOST_CHECK_EQUAL(nRegSuccesses, 1);
@@ -784,7 +783,7 @@
// Regular Face won't accept incoming packets until something is sent.
int hit = 0;
- face.setInterestFilter(Name("/"), bind([&hit] { ++hit; }));
+ face.setInterestFilter(Name("/"), std::bind([&hit] { ++hit; }));
face.processEvents(time::milliseconds(-1));
face.receive(*makeInterest("/A"));
@@ -796,7 +795,7 @@
BOOST_AUTO_TEST_CASE(Handle)
{
int hit = 0;
- InterestFilterHandle hdl = face.setInterestFilter(Name("/"), bind([&hit] { ++hit; }));
+ InterestFilterHandle hdl = face.setInterestFilter(Name("/"), std::bind([&hit] { ++hit; }));
face.processEvents(-1_ms);
face.receive(*makeInterest("/A"));
@@ -828,8 +827,8 @@
size_t nRegSuccesses = 0;
face.registerPrefix("/Hello/World",
- bind([&nRegSuccesses] { ++nRegSuccesses; }),
- bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+ std::bind([&nRegSuccesses] { ++nRegSuccesses; }),
+ std::bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
// io_service::poll() without reset
face.getIoService().poll();
diff --git a/tests/unit/ims/in-memory-storage.t.cpp b/tests/unit/ims/in-memory-storage.t.cpp
index f6c2a40..27caa34 100644
--- a/tests/unit/ims/in-memory-storage.t.cpp
+++ b/tests/unit/ims/in-memory-storage.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -450,7 +450,7 @@
const time::milliseconds& freshWindow = InMemoryStorage::INFINITE_WINDOW)
{
auto data = makeData(name);
- data->setContent(make_span(reinterpret_cast<const uint8_t*>(&id), sizeof(id)));
+ data->setContent({reinterpret_cast<const uint8_t*>(&id), sizeof(id)});
if (modifyData != nullptr) {
modifyData(*data);
diff --git a/tests/unit/interest.t.cpp b/tests/unit/interest.t.cpp
index 684f097..73afe60 100644
--- a/tests/unit/interest.t.cpp
+++ b/tests/unit/interest.t.cpp
@@ -27,6 +27,12 @@
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((WireEncodable<Interest>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Interest>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Interest>));
+static_assert(std::is_convertible_v<Interest::Error*, tlv::Error*>,
+ "Interest::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestInterest)
class DisableAutoCheckParametersDigest
diff --git a/tests/unit/key-locator.t.cpp b/tests/unit/key-locator.t.cpp
index d7dfe9f..7a8b636 100644
--- a/tests/unit/key-locator.t.cpp
+++ b/tests/unit/key-locator.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,11 +23,19 @@
#include "ndn-cxx/encoding/block-helpers.hpp"
#include "tests/boost-test.hpp"
+
#include <boost/lexical_cast.hpp>
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<KeyLocator>));
+BOOST_CONCEPT_ASSERT((WireEncodable<KeyLocator>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<KeyLocator>));
+BOOST_CONCEPT_ASSERT((WireDecodable<KeyLocator>));
+static_assert(std::is_convertible_v<KeyLocator::Error*, tlv::Error*>,
+ "KeyLocator::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestKeyLocator)
BOOST_AUTO_TEST_CASE(TypeNone)
diff --git a/tests/unit/link.t.cpp b/tests/unit/link.t.cpp
index fe4b45c..106541a 100644
--- a/tests/unit/link.t.cpp
+++ b/tests/unit/link.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -26,6 +26,13 @@
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Link>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Link>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Link>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Link>));
+static_assert(std::is_convertible_v<Link::Error*, Data::Error*>,
+ "Link::Error should inherit from Data::Error");
+
BOOST_AUTO_TEST_SUITE(TestLink)
const uint8_t GOOD_LINK[] = {
diff --git a/tests/unit/lp/fields.t.cpp b/tests/unit/lp/fields.t.cpp
new file mode 100644
index 0000000..e828051
--- /dev/null
+++ b/tests/unit/lp/fields.t.cpp
@@ -0,0 +1,45 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-2023 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "ndn-cxx/lp/fields.hpp"
+
+namespace ndn {
+namespace lp {
+namespace tests {
+
+BOOST_CONCEPT_ASSERT((Field<FragmentField>));
+BOOST_CONCEPT_ASSERT((Field<SequenceField>));
+BOOST_CONCEPT_ASSERT((Field<FragIndexField>));
+BOOST_CONCEPT_ASSERT((Field<FragCountField>));
+BOOST_CONCEPT_ASSERT((Field<PitTokenField>));
+BOOST_CONCEPT_ASSERT((Field<NackField>));
+BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>));
+BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>));
+BOOST_CONCEPT_ASSERT((Field<CachePolicyField>));
+BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>));
+BOOST_CONCEPT_ASSERT((Field<AckField>));
+BOOST_CONCEPT_ASSERT((Field<TxSequenceField>));
+BOOST_CONCEPT_ASSERT((Field<NonDiscoveryField>));
+BOOST_CONCEPT_ASSERT((Field<PrefixAnnouncementField>));
+
+} // namespace tests
+} // namespace lp
+} // namespace ndn
diff --git a/tests/unit/lp/pit-token.t.cpp b/tests/unit/lp/pit-token.t.cpp
index 48ef8d6..49d77c1 100644
--- a/tests/unit/lp/pit-token.t.cpp
+++ b/tests/unit/lp/pit-token.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,6 +23,7 @@
#include "ndn-cxx/lp/packet.hpp"
#include "tests/boost-test.hpp"
+
#include <boost/lexical_cast.hpp>
namespace ndn {
diff --git a/tests/unit/meta-info.t.cpp b/tests/unit/meta-info.t.cpp
index 19fa2d3..f909565 100644
--- a/tests/unit/meta-info.t.cpp
+++ b/tests/unit/meta-info.t.cpp
@@ -26,6 +26,12 @@
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((WireEncodable<MetaInfo>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<MetaInfo>));
+BOOST_CONCEPT_ASSERT((WireDecodable<MetaInfo>));
+static_assert(std::is_convertible_v<MetaInfo::Error*, tlv::Error*>,
+ "MetaInfo::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestMetaInfo)
BOOST_AUTO_TEST_CASE(EncodeDecode)
diff --git a/tests/unit/mgmt/control-response.t.cpp b/tests/unit/mgmt/control-response.t.cpp
index c23f7f0..1dd69b1 100644
--- a/tests/unit/mgmt/control-response.t.cpp
+++ b/tests/unit/mgmt/control-response.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/control-response.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -27,6 +28,11 @@
namespace mgmt {
namespace tests {
+BOOST_CONCEPT_ASSERT((WireEncodable<ControlResponse>));
+BOOST_CONCEPT_ASSERT((WireDecodable<ControlResponse>));
+static_assert(std::is_convertible_v<ControlResponse::Error*, tlv::Error*>,
+ "ControlResponse::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(TestControlResponse)
diff --git a/tests/unit/mgmt/dispatcher.t.cpp b/tests/unit/mgmt/dispatcher.t.cpp
index a4897a9..9b01628 100644
--- a/tests/unit/mgmt/dispatcher.t.cpp
+++ b/tests/unit/mgmt/dispatcher.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -31,7 +31,6 @@
namespace tests {
using namespace ndn::tests;
-using std::bind;
class DispatcherFixture : public IoKeyChainFixture
{
@@ -98,25 +97,25 @@
{
BOOST_CHECK_NO_THROW(dispatcher
.addControlCommand<VoidParameters>("test/1", makeAcceptAllAuthorization(),
- bind([] { return true; }),
- bind([]{})));
+ std::bind([] { return true; }),
+ std::bind([]{})));
BOOST_CHECK_NO_THROW(dispatcher
.addControlCommand<VoidParameters>("test/2", makeAcceptAllAuthorization(),
- bind([] { return true; }),
- bind([]{})));
+ std::bind([] { return true; }),
+ std::bind([]{})));
BOOST_CHECK_THROW(dispatcher
.addControlCommand<VoidParameters>("test", makeAcceptAllAuthorization(),
- bind([] { return true; }),
- bind([]{})),
+ std::bind([] { return true; }),
+ std::bind([]{})),
std::out_of_range);
BOOST_CHECK_NO_THROW(dispatcher.addStatusDataset("status/1",
- makeAcceptAllAuthorization(), bind([]{})));
+ makeAcceptAllAuthorization(), std::bind([]{})));
BOOST_CHECK_NO_THROW(dispatcher.addStatusDataset("status/2",
- makeAcceptAllAuthorization(), bind([]{})));
+ makeAcceptAllAuthorization(), std::bind([]{})));
BOOST_CHECK_THROW(dispatcher.addStatusDataset("status",
- makeAcceptAllAuthorization(), bind([]{})),
+ makeAcceptAllAuthorization(), std::bind([]{})),
std::out_of_range);
BOOST_CHECK_NO_THROW(dispatcher.addNotificationStream("stream/1"));
@@ -130,12 +129,12 @@
BOOST_CHECK_THROW(dispatcher
.addControlCommand<VoidParameters>("test/3", makeAcceptAllAuthorization(),
- bind([] { return true; }),
- bind([]{})),
+ std::bind([] { return true; }),
+ std::bind([]{})),
std::domain_error);
BOOST_CHECK_THROW(dispatcher.addStatusDataset("status/3",
- makeAcceptAllAuthorization(), bind([]{})),
+ makeAcceptAllAuthorization(), std::bind([]{})),
std::domain_error);
BOOST_CHECK_THROW(dispatcher.addNotificationStream("stream/3"), std::domain_error);
@@ -146,13 +145,13 @@
std::map<std::string, size_t> nCallbackCalled;
dispatcher
.addControlCommand<VoidParameters>("test/1", makeAcceptAllAuthorization(),
- bind([] { return true; }),
- bind([&nCallbackCalled] { ++nCallbackCalled["test/1"]; }));
+ std::bind([] { return true; }),
+ std::bind([&nCallbackCalled] { ++nCallbackCalled["test/1"]; }));
dispatcher
.addControlCommand<VoidParameters>("test/2", makeAcceptAllAuthorization(),
- bind([] { return true; }),
- bind([&nCallbackCalled] { ++nCallbackCalled["test/2"]; }));
+ std::bind([] { return true; }),
+ std::bind([&nCallbackCalled] { ++nCallbackCalled["test/2"]; }));
face.receive(*makeInterest("/root/1/test/1/%80%00"));
advanceClocks(1_ms);
@@ -207,8 +206,8 @@
dispatcher
.addControlCommand<VoidParameters>("test",
makeTestAuthorization(),
- bind([] { return true; }),
- bind([&nCallbackCalled] { ++nCallbackCalled; }));
+ std::bind([] { return true; }),
+ std::bind([&nCallbackCalled] { ++nCallbackCalled; }));
dispatcher.addTopPrefix("/root");
advanceClocks(1_ms);
@@ -281,7 +280,7 @@
size_t nCallbackCalled = 0;
dispatcher.addControlCommand<StatefulParameters>("test", authorization, validateParameters,
- bind([&nCallbackCalled] { ++nCallbackCalled; }));
+ std::bind([&nCallbackCalled] { ++nCallbackCalled; }));
dispatcher.addTopPrefix("/root");
advanceClocks(1_ms);
diff --git a/tests/unit/mgmt/nfd/channel-status.t.cpp b/tests/unit/mgmt/nfd/channel-status.t.cpp
index dc29def..8036d0d 100644
--- a/tests/unit/mgmt/nfd/channel-status.t.cpp
+++ b/tests/unit/mgmt/nfd/channel-status.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/channel-status.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -29,6 +30,8 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<ChannelStatus>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestChannelStatus)
diff --git a/tests/unit/mgmt/nfd/control-parameters.t.cpp b/tests/unit/mgmt/nfd/control-parameters.t.cpp
index b098529..4866620 100644
--- a/tests/unit/mgmt/nfd/control-parameters.t.cpp
+++ b/tests/unit/mgmt/nfd/control-parameters.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/control-parameters.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -27,6 +28,11 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((WireEncodable<ControlParameters>));
+BOOST_CONCEPT_ASSERT((WireDecodable<ControlParameters>));
+static_assert(std::is_convertible_v<ControlParameters::Error*, tlv::Error*>,
+ "ControlParameters::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestControlParameters)
diff --git a/tests/unit/mgmt/nfd/cs-info.t.cpp b/tests/unit/mgmt/nfd/cs-info.t.cpp
index 3bc5f7b..70d8a20 100644
--- a/tests/unit/mgmt/nfd/cs-info.t.cpp
+++ b/tests/unit/mgmt/nfd/cs-info.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,14 +20,18 @@
*/
#include "ndn-cxx/mgmt/nfd/cs-info.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
+
#include <boost/lexical_cast.hpp>
namespace ndn {
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<CsInfo>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestCsInfo)
diff --git a/tests/unit/mgmt/nfd/face-event-notification.t.cpp b/tests/unit/mgmt/nfd/face-event-notification.t.cpp
index f1dfc38..97b3000 100644
--- a/tests/unit/mgmt/nfd/face-event-notification.t.cpp
+++ b/tests/unit/mgmt/nfd/face-event-notification.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/face-event-notification.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -29,6 +30,8 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((NotificationStreamItem<FaceEventNotification>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestFaceEventNotification)
diff --git a/tests/unit/mgmt/nfd/face-query-filter.t.cpp b/tests/unit/mgmt/nfd/face-query-filter.t.cpp
index e46d6c1..1f83f82 100644
--- a/tests/unit/mgmt/nfd/face-query-filter.t.cpp
+++ b/tests/unit/mgmt/nfd/face-query-filter.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/face-query-filter.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -29,6 +30,12 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<FaceQueryFilter>));
+BOOST_CONCEPT_ASSERT((WireEncodable<FaceQueryFilter>));
+BOOST_CONCEPT_ASSERT((WireDecodable<FaceQueryFilter>));
+static_assert(std::is_convertible_v<FaceQueryFilter::Error*, tlv::Error*>,
+ "FaceQueryFilter::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestFaceQueryFilter)
diff --git a/tests/unit/mgmt/nfd/face-status.t.cpp b/tests/unit/mgmt/nfd/face-status.t.cpp
index 405bf2c..275acf2 100644
--- a/tests/unit/mgmt/nfd/face-status.t.cpp
+++ b/tests/unit/mgmt/nfd/face-status.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/face-status.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -29,6 +30,8 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<FaceStatus>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestFaceStatus)
diff --git a/tests/unit/mgmt/nfd/fib-entry.t.cpp b/tests/unit/mgmt/nfd/fib-entry.t.cpp
index ff5d21b..81f94e5 100644
--- a/tests/unit/mgmt/nfd/fib-entry.t.cpp
+++ b/tests/unit/mgmt/nfd/fib-entry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,14 +20,19 @@
*/
#include "ndn-cxx/mgmt/nfd/fib-entry.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
+
#include <boost/lexical_cast.hpp>
namespace ndn {
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<NextHopRecord>));
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<FibEntry>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestFibEntry)
diff --git a/tests/unit/mgmt/nfd/forwarder-status.t.cpp b/tests/unit/mgmt/nfd/forwarder-status.t.cpp
index b4eb339..6492e55 100644
--- a/tests/unit/mgmt/nfd/forwarder-status.t.cpp
+++ b/tests/unit/mgmt/nfd/forwarder-status.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/forwarder-status.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -29,6 +30,8 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<ForwarderStatus>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestForwarderStatus)
diff --git a/tests/unit/mgmt/nfd/rib-entry.t.cpp b/tests/unit/mgmt/nfd/rib-entry.t.cpp
index 950a196..3479c01 100644
--- a/tests/unit/mgmt/nfd/rib-entry.t.cpp
+++ b/tests/unit/mgmt/nfd/rib-entry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,14 +20,19 @@
*/
#include "ndn-cxx/mgmt/nfd/rib-entry.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
+
#include <boost/lexical_cast.hpp>
namespace ndn {
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<Route>));
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<RibEntry>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestRibEntry)
diff --git a/tests/unit/mgmt/nfd/strategy-choice.t.cpp b/tests/unit/mgmt/nfd/strategy-choice.t.cpp
index 94c30e8..92f271c 100644
--- a/tests/unit/mgmt/nfd/strategy-choice.t.cpp
+++ b/tests/unit/mgmt/nfd/strategy-choice.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/mgmt/nfd/strategy-choice.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -29,6 +30,8 @@
namespace nfd {
namespace tests {
+BOOST_CONCEPT_ASSERT((StatusDatasetItem<StrategyChoice>));
+
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(Nfd)
BOOST_AUTO_TEST_SUITE(TestStrategyChoice)
diff --git a/tests/unit/name-component.t.cpp b/tests/unit/name-component.t.cpp
index bd0a553..a35f980 100644
--- a/tests/unit/name-component.t.cpp
+++ b/tests/unit/name-component.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -34,6 +34,13 @@
namespace name {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Component>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Component>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Component>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Component>));
+static_assert(std::is_convertible_v<Component::Error*, tlv::Error*>,
+ "name::Component::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestNameComponent)
BOOST_AUTO_TEST_SUITE(Decode)
diff --git a/tests/unit/name.t.cpp b/tests/unit/name.t.cpp
index cfe13e0..2e107f5 100644
--- a/tests/unit/name.t.cpp
+++ b/tests/unit/name.t.cpp
@@ -24,6 +24,7 @@
#include "tests/boost-test.hpp"
#include <unordered_map>
+#include <boost/range/concepts.hpp>
namespace ndn {
namespace tests {
@@ -31,6 +32,18 @@
using Component = name::Component;
using UriFormat = name::UriFormat;
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Name>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Name>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Name>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Name>));
+BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::iterator>));
+BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::const_iterator>));
+BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::reverse_iterator>));
+BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<Name::const_reverse_iterator>));
+BOOST_CONCEPT_ASSERT((boost::RandomAccessRangeConcept<Name>));
+static_assert(std::is_convertible_v<Name::Error*, tlv::Error*>,
+ "Name::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestName)
// ---- encoding, decoding, and URI ----
diff --git a/tests/unit/net/face-uri.t.cpp b/tests/unit/net/face-uri.t.cpp
index 19cf24c..d21d70f 100644
--- a/tests/unit/net/face-uri.t.cpp
+++ b/tests/unit/net/face-uri.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California,
+ * Copyright (c) 2013-2023 Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,9 +32,13 @@
#include "tests/boost-test.hpp"
#include "tests/unit/net/network-configuration-detector.hpp"
+#include <boost/concept_check.hpp>
+
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<FaceUri>));
+
BOOST_AUTO_TEST_SUITE(Net)
BOOST_AUTO_TEST_SUITE(TestFaceUri)
diff --git a/tests/unit/security/additional-description.t.cpp b/tests/unit/security/additional-description.t.cpp
index 2779816..82dd606 100644
--- a/tests/unit/security/additional-description.t.cpp
+++ b/tests/unit/security/additional-description.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/security/additional-description.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
@@ -27,6 +28,13 @@
namespace security {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<AdditionalDescription>));
+BOOST_CONCEPT_ASSERT((WireEncodable<AdditionalDescription>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<AdditionalDescription>));
+BOOST_CONCEPT_ASSERT((WireDecodable<AdditionalDescription>));
+static_assert(std::is_convertible_v<AdditionalDescription::Error*, tlv::Error*>,
+ "AdditionalDescription::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(TestAdditionalDescription)
diff --git a/tests/unit/security/certificate.t.cpp b/tests/unit/security/certificate.t.cpp
index 37243d6..44ae731 100644
--- a/tests/unit/security/certificate.t.cpp
+++ b/tests/unit/security/certificate.t.cpp
@@ -37,6 +37,11 @@
using namespace ndn::tests;
+BOOST_CONCEPT_ASSERT((WireEncodable<Certificate>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Certificate>));
+static_assert(std::is_convertible_v<Certificate::Error*, Data::Error*>,
+ "Certificate::Error must inherit from Data::Error");
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestCertificate, ClockFixture)
diff --git a/tests/unit/security/pib/certificate-container.t.cpp b/tests/unit/security/pib/certificate-container.t.cpp
index 55b013e..b1d4343 100644
--- a/tests/unit/security/pib/certificate-container.t.cpp
+++ b/tests/unit/security/pib/certificate-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -21,6 +21,7 @@
#include "ndn-cxx/security/pib/certificate-container.hpp"
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
@@ -30,6 +31,8 @@
namespace pib {
namespace tests {
+NDN_CXX_ASSERT_FORWARD_ITERATOR(CertificateContainer::const_iterator);
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(Pib)
BOOST_FIXTURE_TEST_SUITE(TestCertificateContainer, PibDataFixture)
diff --git a/tests/unit/security/pib/identity-container.t.cpp b/tests/unit/security/pib/identity-container.t.cpp
index 79daace..ea97da0 100644
--- a/tests/unit/security/pib/identity-container.t.cpp
+++ b/tests/unit/security/pib/identity-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -21,6 +21,7 @@
#include "ndn-cxx/security/pib/identity-container.hpp"
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
@@ -30,6 +31,8 @@
namespace pib {
namespace tests {
+NDN_CXX_ASSERT_FORWARD_ITERATOR(IdentityContainer::const_iterator);
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(Pib)
BOOST_FIXTURE_TEST_SUITE(TestIdentityContainer, PibDataFixture)
diff --git a/tests/unit/security/pib/key-container.t.cpp b/tests/unit/security/pib/key-container.t.cpp
index a7d29ef..b126bc2 100644
--- a/tests/unit/security/pib/key-container.t.cpp
+++ b/tests/unit/security/pib/key-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -21,6 +21,7 @@
#include "ndn-cxx/security/pib/key-container.hpp"
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
@@ -30,6 +31,8 @@
namespace pib {
namespace tests {
+NDN_CXX_ASSERT_FORWARD_ITERATOR(KeyContainer::const_iterator);
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(Pib)
BOOST_FIXTURE_TEST_SUITE(TestKeyContainer, PibDataFixture)
diff --git a/tests/unit/security/safe-bag.t.cpp b/tests/unit/security/safe-bag.t.cpp
index 5d24112..ade7f69 100644
--- a/tests/unit/security/safe-bag.t.cpp
+++ b/tests/unit/security/safe-bag.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -29,6 +29,9 @@
namespace security {
namespace tests {
+BOOST_CONCEPT_ASSERT((WireEncodable<SafeBag>));
+BOOST_CONCEPT_ASSERT((WireDecodable<SafeBag>));
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(TestSafeBag)
diff --git a/tests/unit/security/validator-null.t.cpp b/tests/unit/security/validator-null.t.cpp
index 8fc5a5e..5ad9be5 100644
--- a/tests/unit/security/validator-null.t.cpp
+++ b/tests/unit/security/validator-null.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -28,8 +28,6 @@
namespace security {
namespace tests {
-using std::bind;
-
BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestValidatorNull, ndn::tests::KeyChainFixture)
@@ -41,8 +39,8 @@
ValidatorNull validator;
validator.validate(data,
- bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
- bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+ std::bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
+ std::bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
}
BOOST_AUTO_TEST_CASE(ValidateInterest)
@@ -53,8 +51,8 @@
ValidatorNull validator;
validator.validate(interest,
- bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
- bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+ std::bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
+ std::bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
}
BOOST_AUTO_TEST_SUITE_END() // TestValidatorNull
diff --git a/tests/unit/security/validity-period.t.cpp b/tests/unit/security/validity-period.t.cpp
index ff0089f..dbcd47f 100644
--- a/tests/unit/security/validity-period.t.cpp
+++ b/tests/unit/security/validity-period.t.cpp
@@ -20,6 +20,7 @@
*/
#include "ndn-cxx/security/validity-period.hpp"
+#include "ndn-cxx/util/concepts.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/clock-fixture.hpp"
@@ -32,6 +33,13 @@
using namespace ndn::tests;
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<ValidityPeriod>));
+BOOST_CONCEPT_ASSERT((WireEncodable<ValidityPeriod>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<ValidityPeriod>));
+BOOST_CONCEPT_ASSERT((WireDecodable<ValidityPeriod>));
+static_assert(std::is_convertible_v<ValidityPeriod::Error*, tlv::Error*>,
+ "ValidityPeriod::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_AUTO_TEST_SUITE(TestValidityPeriod)
diff --git a/tests/unit/signature-info.t.cpp b/tests/unit/signature-info.t.cpp
index 6924a07..d538217 100644
--- a/tests/unit/signature-info.t.cpp
+++ b/tests/unit/signature-info.t.cpp
@@ -28,6 +28,13 @@
namespace ndn {
namespace tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<SignatureInfo>));
+BOOST_CONCEPT_ASSERT((WireEncodable<SignatureInfo>));
+BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<SignatureInfo>));
+BOOST_CONCEPT_ASSERT((WireDecodable<SignatureInfo>));
+static_assert(std::is_convertible_v<SignatureInfo::Error*, tlv::Error*>,
+ "SignatureInfo::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestSignatureInfo)
BOOST_AUTO_TEST_CASE(Constructor)
diff --git a/tests/unit/util/segment-fetcher.t.cpp b/tests/unit/util/segment-fetcher.t.cpp
index cd74372..4abe243 100644
--- a/tests/unit/util/segment-fetcher.t.cpp
+++ b/tests/unit/util/segment-fetcher.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -36,7 +36,6 @@
namespace tests {
using namespace ndn::tests;
-using std::bind;
class SegmentFetcherFixture : public IoKeyChainFixture
{
@@ -93,10 +92,10 @@
void
connectSignals(const shared_ptr<SegmentFetcher>& fetcher)
{
- fetcher->onInOrderData.connect(bind(&SegmentFetcherFixture::onInOrderData, this, _1));
- fetcher->onInOrderComplete.connect(bind(&SegmentFetcherFixture::onInOrderComplete, this));
- fetcher->onComplete.connect(bind(&SegmentFetcherFixture::onComplete, this, _1));
- fetcher->onError.connect(bind(&SegmentFetcherFixture::onError, this, _1));
+ fetcher->onInOrderData.connect(std::bind(&SegmentFetcherFixture::onInOrderData, this, _1));
+ fetcher->onInOrderComplete.connect(std::bind(&SegmentFetcherFixture::onInOrderComplete, this));
+ fetcher->onComplete.connect(std::bind(&SegmentFetcherFixture::onComplete, this, _1));
+ fetcher->onError.connect(std::bind(&SegmentFetcherFixture::onError, this, _1));
fetcher->afterSegmentReceived.connect([this] (const auto&) { ++this->nAfterSegmentReceived; });
fetcher->afterSegmentValidated.connect([this] (const auto &) { ++this->nAfterSegmentValidated; });
@@ -190,7 +189,7 @@
shared_ptr<SegmentFetcher> fetcher = SegmentFetcher::start(face, Interest("/hello/world"),
acceptValidator, options);
connectSignals(fetcher);
- fetcher->afterSegmentTimedOut.connect(bind([&nAfterSegmentTimedOut] { ++nAfterSegmentTimedOut; }));
+ fetcher->afterSegmentTimedOut.connect([&nAfterSegmentTimedOut] { ++nAfterSegmentTimedOut; });
advanceClocks(1_ms);
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -310,7 +309,7 @@
shared_ptr<SegmentFetcher> fetcher = SegmentFetcher::start(face, Interest("/hello/world"),
acceptValidator);
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
connectSignals(fetcher);
face.processEvents(1_s);
@@ -333,7 +332,7 @@
sendNackInsteadOfDropping = false;
auto fetcher = SegmentFetcher::start(face, Interest("/hello/world"), acceptValidator, options);
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
connectSignals(fetcher);
face.processEvents(1_s);
@@ -358,7 +357,7 @@
shared_ptr<SegmentFetcher> fetcher = SegmentFetcher::start(face, Interest("/hello/world"),
acceptValidator);
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
connectSignals(fetcher);
face.processEvents(1_s);
@@ -382,7 +381,7 @@
defaultSegmentToSend = 47;
auto fetcher = SegmentFetcher::start(face, Interest("/hello/world"), acceptValidator, options);
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
connectSignals(fetcher);
face.processEvents(1_s);
@@ -627,7 +626,7 @@
shared_ptr<SegmentFetcher> fetcher = SegmentFetcher::start(face, Interest("/hello/world"),
acceptValidator);
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
connectSignals(fetcher);
face.processEvents(1_s);
@@ -652,7 +651,7 @@
shared_ptr<SegmentFetcher> fetcher = SegmentFetcher::start(face, Interest("/hello/world"),
acceptValidator);
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
connectSignals(fetcher);
face.processEvents(1_s);
@@ -672,7 +671,7 @@
segmentsToDropOrNack.push(0);
sendNackInsteadOfDropping = true;
nackReason = lp::NackReason::NO_ROUTE;
- face.onSendInterest.connect(bind(&SegmentFetcherFixture::onInterest, this, _1));
+ face.onSendInterest.connect(std::bind(&SegmentFetcherFixture::onInterest, this, _1));
shared_ptr<SegmentFetcher> fetcher = SegmentFetcher::start(face, Interest("/hello/world"),
acceptValidator);
diff --git a/tests/unit/util/signal.t.cpp b/tests/unit/util/signal.t.cpp
index 2c53336..b3640f9 100644
--- a/tests/unit/util/signal.t.cpp
+++ b/tests/unit/util/signal.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,6 +23,8 @@
#include "tests/boost-test.hpp"
+#include <boost/concept_check.hpp>
+
namespace ndn {
namespace util {
namespace signal {
@@ -117,19 +119,16 @@
class RefObject
{
public:
- RefObject()
- {
- }
+ RefObject() = default;
- RefObject(const RefObject& other)
+ RefObject(const RefObject&)
{
++s_copyCount;
}
public:
- static int s_copyCount;
+ static inline int s_copyCount = 0;
};
-int RefObject::s_copyCount = 0;
// Signal passes arguments by reference,
// but it also allows a handler that accept arguments by value
@@ -446,6 +445,8 @@
BOOST_AUTO_TEST_CASE(ConnectionEquality)
{
+ BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Connection>));
+
SignalOwner0 so;
Connection conn1, conn2;