tests: stop using deprecated {get,set}FinalBlockId
Change-Id: Ibe3f7b394487773139ec4e17d2b87ca8cb06504a
diff --git a/tests/manager-common-fixture.cpp b/tests/manager-common-fixture.cpp
index bdda72e..9511951 100644
--- a/tests/manager-common-fixture.cpp
+++ b/tests/manager-common-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -62,15 +62,15 @@
void
ManagerCommonFixture::setTopPrefix(const Name& topPrefix)
{
- m_dispatcher.addTopPrefix(topPrefix); // such that all filters are added
- advanceClocks(time::milliseconds(1));
+ m_dispatcher.addTopPrefix(topPrefix); // so that all filters are added
+ advanceClocks(1_ms);
}
void
ManagerCommonFixture::receiveInterest(const Interest& interest)
{
m_face.receive(interest);
- advanceClocks(time::milliseconds(1));
+ advanceClocks(1_ms);
}
ControlResponse
@@ -142,12 +142,7 @@
Block
ManagerCommonFixture::concatenateResponses(size_t startIndex, size_t nResponses)
{
- auto isFinalSegment = [] (const Data& data) -> bool {
- const name::Component& lastComponent = data.getName().at(-1);
- return !lastComponent.isSegment() || lastComponent == data.getFinalBlockId();
- };
-
- while (!isFinalSegment(m_responses.back())) {
+ while (m_responses.back().getName().at(-1) != m_responses.back().getFinalBlock()) {
const Name& name = m_responses.back().getName();
Name prefix = name.getPrefix(-1);
uint64_t segmentNo = name.at(-1).toSegment() + 1;
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index eb102eb..0a67326 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -29,6 +29,8 @@
#include "tests/test-common.hpp"
#include "tests/identity-management-fixture.hpp"
+#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
+#include <ndn-cxx/mgmt/nfd/control-response.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
namespace nfd {
@@ -148,11 +150,11 @@
virtual void
processEventsOverride(time::milliseconds timeout)
{
- if (timeout <= time::milliseconds::zero()) {
+ if (timeout <= 0_ms) {
// give enough time to finish execution
- timeout = time::seconds(30);
+ timeout = 30_s;
}
- this->advanceClocks(time::milliseconds(100), timeout);
+ this->advanceClocks(100_ms, timeout);
}
void
@@ -167,8 +169,7 @@
sendCommandReply(const Interest& interest, uint32_t code, const std::string& text,
const Block& body)
{
- this->sendCommandReply(interest,
- ndn::nfd::ControlResponse(code, text).setBody(body));
+ this->sendCommandReply(interest, ndn::nfd::ControlResponse(code, text).setBody(body));
}
/** \brief send a payload in reply to StatusDataset request
@@ -193,7 +194,7 @@
}
auto data = make_shared<Data>(name);
- data->setFinalBlockId(name[-1]);
+ data->setFinalBlock(name[-1]);
data->setContent(std::forward<ContentArgs>(contentArgs)...);
this->signDatasetReply(*data);
face.receive(*data);
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index 7a4a216..1b928b0 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -105,7 +105,7 @@
BOOST_CHECK(dataName0.at(-2).isVersion());
BOOST_CHECK(dataName0.at(-1).isSegment());
- while (face.sentData.back().getFinalBlockId() != face.sentData.back().getName().at(-1)) {
+ while (face.sentData.back().getFinalBlock() != face.sentData.back().getName().at(-1)) {
const Name& lastName = face.sentData.back().getName();
Interest interest2(lastName.getPrefix(-1).appendSegment(lastName.at(-1).toSegment() + 1));
face.receive(interest2);