Use Boost.Operators in more places
Change-Id: I7024c3e7d4c30c99ec7a895d484f227cb60fb356
diff --git a/tests/benchmarks/encoding-bench.cpp b/tests/benchmarks/encoding-bench.cpp
index a3e0b5e..7694d89 100644
--- a/tests/benchmarks/encoding-bench.cpp
+++ b/tests/benchmarks/encoding-bench.cpp
@@ -68,7 +68,7 @@
{
using AlignmentOffset = std::integral_constant<size_t, ALIGNMENT_OFFSET>;
- static_assert(sizeof(ReadVarNumberTest<WIRE_SIZE>::WIRE) == WIRE_SIZE, "");
+ static_assert(sizeof(ReadVarNumberTest<WIRE_SIZE>::WIRE) == WIRE_SIZE);
};
using ReadVarNumberTests = boost::mpl::vector<
@@ -97,7 +97,7 @@
constexpr int N_ITERATIONS = 100000000;
alignas(8) uint8_t buffer[16];
- static_assert(Test::AlignmentOffset::value + sizeof(Test::WIRE) <= sizeof(buffer), "");
+ static_assert(Test::AlignmentOffset::value + sizeof(Test::WIRE) <= sizeof(buffer));
uint8_t* const begin = buffer + Test::AlignmentOffset::value;
std::memcpy(begin, Test::WIRE, sizeof(Test::WIRE));
const uint8_t* const end = begin + sizeof(Test::WIRE);
diff --git a/tests/unit/face.t.cpp b/tests/unit/face.t.cpp
index c4ae026..f369d6f 100644
--- a/tests/unit/face.t.cpp
+++ b/tests/unit/face.t.cpp
@@ -44,7 +44,7 @@
: face(m_io, m_keyChain, {true, !std::is_same_v<PrefixRegReply, NoPrefixRegReply>})
{
static_assert(std::is_same_v<PrefixRegReply, WantPrefixRegReply> ||
- std::is_same_v<PrefixRegReply, NoPrefixRegReply>, "");
+ std::is_same_v<PrefixRegReply, NoPrefixRegReply>);
}
/** \brief Execute a prefix registration, and optionally check the name in callback.
diff --git a/tests/unit/interest.t.cpp b/tests/unit/interest.t.cpp
index bd6e302..73b7bef 100644
--- a/tests/unit/interest.t.cpp
+++ b/tests/unit/interest.t.cpp
@@ -31,6 +31,7 @@
BOOST_CONCEPT_ASSERT((WireDecodable<Interest>));
static_assert(std::is_convertible_v<Interest::Error*, tlv::Error*>,
"Interest::Error must inherit from tlv::Error");
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Interest::Nonce>));
BOOST_AUTO_TEST_SUITE(TestInterest)
diff --git a/tests/unit/metadata-object.t.cpp b/tests/unit/metadata-object.t.cpp
index 480f7d4..0cbe737 100644
--- a/tests/unit/metadata-object.t.cpp
+++ b/tests/unit/metadata-object.t.cpp
@@ -26,6 +26,9 @@
namespace ndn::tests {
+static_assert(std::is_convertible_v<MetadataObject::Error*, tlv::Error*>,
+ "MetadataObject::Error must inherit from tlv::Error");
+
class MetadataObjectFixture : public KeyChainFixture
{
public:
diff --git a/tests/unit/name-component.t.cpp b/tests/unit/name-component.t.cpp
index d72de0f..d4b674d 100644
--- a/tests/unit/name-component.t.cpp
+++ b/tests/unit/name-component.t.cpp
@@ -35,7 +35,9 @@
using ndn::name::Component;
using ndn::name::UriFormat;
+static_assert(sizeof(Component) == sizeof(Block));
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Component>));
+BOOST_CONCEPT_ASSERT((boost::Comparable<Component>));
BOOST_CONCEPT_ASSERT((WireEncodable<Component>));
BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Component>));
BOOST_CONCEPT_ASSERT((WireDecodable<Component>));
diff --git a/tests/unit/name.t.cpp b/tests/unit/name.t.cpp
index da95aed..734edb7 100644
--- a/tests/unit/name.t.cpp
+++ b/tests/unit/name.t.cpp
@@ -31,6 +31,7 @@
using ndn::name::Component;
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Name>));
+BOOST_CONCEPT_ASSERT((boost::Comparable<Name>));
BOOST_CONCEPT_ASSERT((WireEncodable<Name>));
BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Name>));
BOOST_CONCEPT_ASSERT((WireDecodable<Name>));
diff --git a/tests/unit/prefix-announcement.t.cpp b/tests/unit/prefix-announcement.t.cpp
index a13e9f5..a36f084 100644
--- a/tests/unit/prefix-announcement.t.cpp
+++ b/tests/unit/prefix-announcement.t.cpp
@@ -27,6 +27,10 @@
namespace ndn::tests {
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<PrefixAnnouncement>));
+static_assert(std::is_convertible_v<PrefixAnnouncement::Error*, tlv::Error*>,
+ "PrefixAnnouncement::Error must inherit from tlv::Error");
+
BOOST_AUTO_TEST_SUITE(TestPrefixAnnouncement)
static Data
diff --git a/tests/unit/security/pib/identity.t.cpp b/tests/unit/security/pib/identity.t.cpp
index 70252d9..42a9916 100644
--- a/tests/unit/security/pib/identity.t.cpp
+++ b/tests/unit/security/pib/identity.t.cpp
@@ -29,6 +29,8 @@
using namespace ndn::security::pib;
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Identity>));
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestIdentity, PibDataFixture)
diff --git a/tests/unit/security/pib/key.t.cpp b/tests/unit/security/pib/key.t.cpp
index 5273436..a3c1806 100644
--- a/tests/unit/security/pib/key.t.cpp
+++ b/tests/unit/security/pib/key.t.cpp
@@ -29,6 +29,8 @@
using namespace ndn::security::pib;
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Key>));
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestKey, PibDataFixture)
diff --git a/tests/unit/util/ostream-joiner.t.cpp b/tests/unit/util/ostream-joiner.t.cpp
index 2e7ac8f..4ac3381 100644
--- a/tests/unit/util/ostream-joiner.t.cpp
+++ b/tests/unit/util/ostream-joiner.t.cpp
@@ -37,7 +37,7 @@
auto joiner1 = ostream_joiner<char>(os, ' ');
auto joiner2 = make_ostream_joiner(os, ' ');
- static_assert(std::is_same_v<decltype(joiner1), decltype(joiner2)>, "");
+ static_assert(std::is_same_v<decltype(joiner1), decltype(joiner2)>);
std::vector<int> v(5);
std::iota(v.begin(), v.end(), 1);
diff --git a/tests/unit/version.t.cpp b/tests/unit/version.t.cpp
index 527bc95..4b551a9 100644
--- a/tests/unit/version.t.cpp
+++ b/tests/unit/version.t.cpp
@@ -37,9 +37,9 @@
NDN_CXX_VERSION_MINOR * 1000 +
NDN_CXX_VERSION_PATCH);
- static_assert(NDN_CXX_VERSION_MAJOR < 1000, "");
- static_assert(NDN_CXX_VERSION_MINOR < 1000, "");
- static_assert(NDN_CXX_VERSION_PATCH < 1000, "");
+ static_assert(NDN_CXX_VERSION_MAJOR < 1000);
+ static_assert(NDN_CXX_VERSION_MINOR < 1000);
+ static_assert(NDN_CXX_VERSION_PATCH < 1000);
}
BOOST_AUTO_TEST_CASE(VersionString)