From bf28cd76ee40c01cb8401e3ef80bf97870bc4b4c Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Sun, 13 Aug 2017 17:22:47 -0400 Subject: [PATCH] tests: remove obsolete makeLink helper function This is a quick fix for a build error caused by the removal of some deprecated functions from ndn-cxx. Change-Id: I4df5bdd426743774b08f5966eed28a27f2af1279 Refs: #4055 --- tests/peek/ndnpeek.t.cpp | 4 ++-- tests/test-common.cpp | 15 ++------------- tests/test-common.hpp | 12 ++---------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/tests/peek/ndnpeek.t.cpp b/tests/peek/ndnpeek.t.cpp index a54426b..b44e7c5 100644 --- a/tests/peek/ndnpeek.t.cpp +++ b/tests/peek/ndnpeek.t.cpp @@ -20,6 +20,7 @@ #include "tools/peek/ndnpeek/ndnpeek.hpp" #include "tests/test-common.hpp" + #include #include @@ -178,7 +179,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Selectors, OutputCheck, OutputChecks) options.minSuffixComponents = 1; options.maxSuffixComponents = 1; options.interestLifetime = time::milliseconds(200); - options.link = makeLink("/net/ndnsim", {{10, "/telia/terabits"}, {20, "/ucla/cs"}}); options.mustBeFresh = true; options.wantRightmostChild = true; initialize(options); @@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Selectors, OutputCheck, OutputChecks) BOOST_CHECK_EQUAL(face.sentInterests.back().getMaxSuffixComponents(), 1); BOOST_CHECK_EQUAL(face.sentInterests.back().getMinSuffixComponents(), 1); BOOST_CHECK_EQUAL(face.sentInterests.back().getInterestLifetime(), time::milliseconds(200)); - BOOST_CHECK_EQUAL(face.sentInterests.back().getForwardingHint(), options.link->getDelegationList()); + BOOST_CHECK_EQUAL(face.sentInterests.back().getForwardingHint().size(), 0); BOOST_CHECK_EQUAL(face.sentInterests.back().getMustBeFresh(), true); BOOST_CHECK_EQUAL(face.sentInterests.back().getChildSelector(), 1); BOOST_CHECK(peek->getResultCode() == ResultCode::DATA); diff --git a/tests/test-common.cpp b/tests/test-common.cpp index 37d9d99..fe45dd9 100644 --- a/tests/test-common.cpp +++ b/tests/test-common.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014-2016, Regents of the University of California, + * Copyright (c) 2014-2017, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & Marie Curie, Sorbonne University, @@ -98,18 +98,9 @@ signData(Data& data) fakeSignature.setValue(ndn::encoding::makeEmptyBlock(tlv::SignatureValue)); data.setSignature(fakeSignature); data.wireEncode(); - return data; } -shared_ptr -makeLink(const Name& name, std::initializer_list> delegations) -{ - auto link = make_shared(name, delegations); - signData(link); - return link; -} - lp::Nack makeNack(const Interest& interest, lp::NackReason reason) { @@ -123,9 +114,7 @@ makeNack(const Name& name, uint32_t nonce, lp::NackReason reason) { Interest interest(name); interest.setNonce(nonce); - lp::Nack nack(std::move(interest)); - nack.setReason(reason); - return nack; + return makeNack(interest, reason); } } // namespace tests diff --git a/tests/test-common.hpp b/tests/test-common.hpp index f4c16f0..be0b63d 100644 --- a/tests/test-common.hpp +++ b/tests/test-common.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014-2016, Regents of the University of California, + * Copyright (c) 2014-2017, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & Marie Curie, Sorbonne University, @@ -28,9 +28,8 @@ #include "boost-test.hpp" -#include #include -#include +#include #include #include @@ -107,13 +106,6 @@ signData(shared_ptr data) return data; } -/** \brief create a Link object with fake signature - * \note Link may be modified afterwards without losing the fake signature. - * If a real signature is desired, sign again with KeyChain. - */ -shared_ptr -makeLink(const Name& name, std::initializer_list> delegations); - /** \brief create a Nack * \param interest Interest * \param reason Nack reason