lp: delete deprecated LocalControlHeader
refs #3755
Change-Id: I98d8767fdaac058894371ddc52f5583b018691c6
diff --git a/tests/unit-tests/face.t.cpp b/tests/unit-tests/face.t.cpp
index 6e81644..dfaefd5 100644
--- a/tests/unit-tests/face.t.cpp
+++ b/tests/unit-tests/face.t.cpp
@@ -20,11 +20,12 @@
*/
#include "face.hpp"
-#include "util/scheduler.hpp"
+#include "lp/tags.hpp"
#include "security/key-chain.hpp"
-#include "util/dummy-client-face.hpp"
#include "transport/tcp-transport.hpp"
#include "transport/unix-transport.hpp"
+#include "util/dummy-client-face.hpp"
+#include "util/scheduler.hpp"
#include "boost-test.hpp"
#include "identity-management-time-fixture.hpp"
diff --git a/tests/unit-tests/lp/tags.t.cpp b/tests/unit-tests/lp/tags.t.cpp
deleted file mode 100644
index 139c7f7..0000000
--- a/tests/unit-tests/lp/tags.t.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "lp/tags.hpp"
-#include "encoding/nfd-constants.hpp"
-#include "interest.hpp"
-#include "data.hpp"
-#include "lp/nack.hpp"
-
-#include <boost/mpl/vector.hpp>
-#include "boost-test.hpp"
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-#include "management/nfd-local-control-header.hpp"
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-namespace ndn {
-namespace lp {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Lp)
-BOOST_AUTO_TEST_SUITE(TestTags)
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-BOOST_AUTO_TEST_SUITE(Facade)
-
-typedef boost::mpl::vector<Interest, Data, Nack> TagHostTypes;
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(IncomingFaceId, T, TagHostTypes)
-{
- T pkt;
- LocalControlHeaderFacade lch(pkt);
-
- BOOST_CHECK_EQUAL(lch.hasIncomingFaceId(), false);
-
- lch.setIncomingFaceId(303);
- shared_ptr<IncomingFaceIdTag> tag = static_cast<TagHost&>(pkt).getTag<IncomingFaceIdTag>();
- BOOST_REQUIRE(tag != nullptr);
- BOOST_CHECK_EQUAL(*tag, 303);
-
- lch.setIncomingFaceId(ndn::nfd::INVALID_FACE_ID);
- BOOST_CHECK(static_cast<TagHost&>(pkt).getTag<IncomingFaceIdTag>() == nullptr);
-
- static_cast<TagHost&>(pkt).setTag(make_shared<IncomingFaceIdTag>(104));
- BOOST_CHECK_EQUAL(lch.getIncomingFaceId(), 104);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(NextHopFaceId, T, TagHostTypes)
-{
- T pkt;
- LocalControlHeaderFacade lch(pkt);
-
- BOOST_CHECK_EQUAL(lch.hasNextHopFaceId(), false);
-
- lch.setNextHopFaceId(303);
- shared_ptr<NextHopFaceIdTag> tag = static_cast<TagHost&>(pkt).getTag<NextHopFaceIdTag>();
- BOOST_REQUIRE(tag != nullptr);
- BOOST_CHECK_EQUAL(*tag, 303);
-
- lch.setNextHopFaceId(ndn::nfd::INVALID_FACE_ID);
- BOOST_CHECK(static_cast<TagHost&>(pkt).getTag<NextHopFaceIdTag>() == nullptr);
-
- static_cast<TagHost&>(pkt).setTag(make_shared<NextHopFaceIdTag>(104));
- BOOST_CHECK_EQUAL(lch.getNextHopFaceId(), 104);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(CachePolicy, T, TagHostTypes)
-{
- using lp::CachePolicy;
-
- T pkt;
- LocalControlHeaderFacade lch(pkt);
-
- BOOST_CHECK_EQUAL(lch.hasCachingPolicy(), false);
-
- lch.setCachingPolicy(LocalControlHeaderFacade::NO_CACHE);
- shared_ptr<CachePolicyTag> tag = static_cast<TagHost&>(pkt).getTag<CachePolicyTag>();
- BOOST_REQUIRE(tag != nullptr);
- BOOST_CHECK_EQUAL(tag->get().getPolicy(), CachePolicyType::NO_CACHE);
-
- lch.setCachingPolicy(LocalControlHeaderFacade::INVALID_POLICY);
- BOOST_CHECK(static_cast<TagHost&>(pkt).getTag<CachePolicyTag>() == nullptr);
-
- auto tag2 = make_shared<CachePolicyTag>(CachePolicy().setPolicy(CachePolicyType::NO_CACHE));
- static_cast<TagHost&>(pkt).setTag(tag2);
- BOOST_CHECK_EQUAL(lch.getCachingPolicy(), LocalControlHeaderFacade::NO_CACHE);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Facade
-
-BOOST_AUTO_TEST_CASE(InterestGetters)
-{
- Interest interest;
-
- interest.setTag(make_shared<IncomingFaceIdTag>(319));
- BOOST_CHECK_EQUAL(interest.getLocalControlHeader().getIncomingFaceId(), 319);
- BOOST_CHECK_EQUAL(interest.getIncomingFaceId(), 319);
-
- interest.setTag(make_shared<NextHopFaceIdTag>(213));
- BOOST_CHECK_EQUAL(interest.getLocalControlHeader().getNextHopFaceId(), 213);
- BOOST_CHECK_EQUAL(interest.getNextHopFaceId(), 213);
-}
-
-BOOST_AUTO_TEST_CASE(InterestSetters)
-{
- Interest interest;
-
- interest.getLocalControlHeader().setIncomingFaceId(268);
- shared_ptr<IncomingFaceIdTag> incomingFaceIdTag = interest.getTag<IncomingFaceIdTag>();
- BOOST_REQUIRE(incomingFaceIdTag != nullptr);
- BOOST_CHECK_EQUAL(*incomingFaceIdTag, 268);
-
- interest.setIncomingFaceId(153);
- incomingFaceIdTag = interest.getTag<IncomingFaceIdTag>();
- BOOST_REQUIRE(incomingFaceIdTag != nullptr);
- BOOST_CHECK_EQUAL(*incomingFaceIdTag, 153);
-
- interest.getLocalControlHeader().setNextHopFaceId(307);
- shared_ptr<NextHopFaceIdTag> nextHopFaceIdTag = interest.getTag<NextHopFaceIdTag>();
- BOOST_REQUIRE(nextHopFaceIdTag != nullptr);
- BOOST_CHECK_EQUAL(*nextHopFaceIdTag, 307);
-
- interest.setNextHopFaceId(260);
- nextHopFaceIdTag = interest.getTag<NextHopFaceIdTag>();
- BOOST_REQUIRE(nextHopFaceIdTag != nullptr);
- BOOST_CHECK_EQUAL(*nextHopFaceIdTag, 260);
-}
-
-BOOST_AUTO_TEST_CASE(DataGetters)
-{
- Data data;
-
- data.setTag(make_shared<IncomingFaceIdTag>(16));
- BOOST_CHECK_EQUAL(data.getLocalControlHeader().getIncomingFaceId(), 16);
- BOOST_CHECK_EQUAL(data.getIncomingFaceId(), 16);
-
- data.setTag(make_shared<CachePolicyTag>(CachePolicy().setPolicy(CachePolicyType::NO_CACHE)));
- BOOST_CHECK_EQUAL(data.getLocalControlHeader().getCachingPolicy(), nfd::LocalControlHeader::NO_CACHE);
- BOOST_CHECK_EQUAL(data.getCachingPolicy(), nfd::LocalControlHeader::NO_CACHE);
-}
-
-BOOST_AUTO_TEST_CASE(DataSetters)
-{
- Data data;
-
- data.getLocalControlHeader().setIncomingFaceId(297);
- shared_ptr<IncomingFaceIdTag> incomingFaceIdTag = data.getTag<IncomingFaceIdTag>();
- BOOST_REQUIRE(incomingFaceIdTag != nullptr);
- BOOST_CHECK_EQUAL(*incomingFaceIdTag, 297);
-
- data.setIncomingFaceId(233);
- incomingFaceIdTag = data.getTag<IncomingFaceIdTag>();
- BOOST_REQUIRE(incomingFaceIdTag != nullptr);
- BOOST_CHECK_EQUAL(*incomingFaceIdTag, 233);
-
- data.getLocalControlHeader().setCachingPolicy(nfd::LocalControlHeader::NO_CACHE);
- shared_ptr<CachePolicyTag> cachePolicyTag = data.getTag<CachePolicyTag>();
- BOOST_REQUIRE(cachePolicyTag != nullptr);
- BOOST_CHECK_EQUAL(cachePolicyTag->get().getPolicy(), CachePolicyType::NO_CACHE);
-
- data.setCachingPolicy(nfd::LocalControlHeader::INVALID_POLICY);
- cachePolicyTag = data.getTag<CachePolicyTag>();
- BOOST_CHECK(cachePolicyTag == nullptr);
-}
-
-#pragma GCC diagnostic pop
-
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-BOOST_AUTO_TEST_SUITE_END() // TestTags
-BOOST_AUTO_TEST_SUITE_END() // Lp
-
-} // namespace tests
-} // namespace lp
-} // namespace ndn