Avoid deprecated Boost.Asio interfaces
Change-Id: I00d285893ff61619f49dff8a8a55d0d0e2c309a7
diff --git a/tests/unit/security/validator-fixture.cpp b/tests/unit/security/validator-fixture.cpp
index 41497bf..ff198a3 100644
--- a/tests/unit/security/validator-fixture.cpp
+++ b/tests/unit/security/validator-fixture.cpp
@@ -24,6 +24,8 @@
#include "ndn-cxx/security/additional-description.hpp"
#include "ndn-cxx/util/signal/scoped-connection.hpp"
+#include <boost/asio/post.hpp>
+
namespace ndn::tests {
using namespace ndn::security;
@@ -47,7 +49,7 @@
{
signal::ScopedConnection conn = face.onSendInterest.connect([this] (const Interest& interest) {
if (processInterest) {
- m_io.post([=] { processInterest(interest); });
+ boost::asio::post(m_io, [=] { processInterest(interest); });
}
});
advanceClocks(s_mockPeriod, s_mockTimes);
@@ -69,8 +71,7 @@
.appendVersion());
SignatureInfo info;
- auto now = time::system_clock::now();
- info.setValidityPeriod(ValidityPeriod(now, now + 90_days));
+ info.setValidityPeriod(ValidityPeriod::makeRelative(0_s, 90_days));
AdditionalDescription description;
description.set("type", "sub-certificate");
diff --git a/tests/unit/security/validator-null.t.cpp b/tests/unit/security/validator-null.t.cpp
index ebae900..05dd270 100644
--- a/tests/unit/security/validator-null.t.cpp
+++ b/tests/unit/security/validator-null.t.cpp
@@ -39,8 +39,8 @@
ValidatorNull validator;
validator.validate(data,
- std::bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
- std::bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+ [] (auto&&...) { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); },
+ [] (auto&&...) { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); });
}
BOOST_AUTO_TEST_CASE(ValidateInterest)
@@ -51,8 +51,8 @@
ValidatorNull validator;
validator.validate(interest,
- std::bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
- std::bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+ [] (auto&&...) { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); },
+ [] (auto&&...) { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); });
}
BOOST_AUTO_TEST_SUITE_END() // TestValidatorNull