tests: minor code cleanups
Change-Id: I9759ba4b7eb467d4d1df4b379efad91bc4f5cc3a
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 9a06393..78589a2 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -135,12 +135,14 @@
ndn::security::MakeCertificateOptions opts;
opts.validity = derivedSelfSigned.getValidityPeriod();
auto derivedCert = m_keyChain.makeCertificate(derivedSelfSigned,
- ndn::security::signingByIdentity(anchorIdentity), opts);
+ ndn::security::signingByIdentity(anchorIdentity),
+ opts);
m_keyChain.setDefaultCertificate(derivedKey, derivedCert);
if (m_status.isLocalhostConfigured) {
m_manager.applyLocalhostConfig(getValidatorConfigSection(), "test");
}
+
if (m_status.isLocalhopConfigured) {
m_manager.enableLocalhop(getLocalhopValidatorConfigSection(), "test");
}
@@ -173,19 +175,20 @@
auto replyFibAddCommand = [this] (const Interest& interest) {
ControlParameters params(interest.getName().get(-5).blockFromValue());
BOOST_CHECK(params.getName() == "/localhost/nfd/rib" || params.getName() == "/localhop/nfd/rib");
- params.setFaceId(1).setCost(0);
+ params.setFaceId(1)
+ .setCost(0);
ControlResponse resp;
+ resp.setCode(200)
+ .setBody(params.wireEncode());
- resp.setCode(200).setBody(params.wireEncode());
- shared_ptr<Data> data = make_shared<Data>(interest.getName());
+ auto data = make_shared<Data>(interest.getName());
data->setContent(resp.wireEncode());
-
m_keyChain.sign(*data, ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_SHA256));
m_face.getIoService().post([this, data] { m_face.receive(*data); });
};
- Name commandPrefix("/localhost/nfd/fib/add-nexthop");
+ const Name commandPrefix("/localhost/nfd/fib/add-nexthop");
for (const auto& command : m_face.sentInterests) {
if (commandPrefix.isPrefixOf(command.getName())) {
replyFibAddCommand(command);