interest: drop support for packet format v0.2

Interests are now always encoded into v0.3 format and decoding
from v0.2 format is no longer supported. Deprecated Exclude and
Selectors are completely removed.

Refs: #4567
Change-Id: I977a833253e63e28ac6eea85be0a7b449c76584a
diff --git a/ndn-cxx/exclude.cpp b/ndn-cxx/exclude.cpp
deleted file mode 100644
index 3204850..0000000
--- a/ndn-cxx/exclude.cpp
+++ /dev/null
@@ -1,434 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2019 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.
- *
- * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
- */
-
-#include "ndn-cxx/exclude.hpp"
-#include "ndn-cxx/encoding/block-helpers.hpp"
-
-#include <boost/range/adaptor/reversed.hpp>
-#include <sstream>
-
-namespace ndn {
-
-Exclude::ExcludeComponent::ExcludeComponent(const name::Component& component1)
-  : isNegInf(false)
-  , component(component1)
-{
-}
-
-Exclude::ExcludeComponent::ExcludeComponent(bool isNegInf1)
-  : isNegInf(true)
-{
-  BOOST_ASSERT(isNegInf1 == true);
-}
-
-bool
-operator==(const Exclude::ExcludeComponent& a, const Exclude::ExcludeComponent& b)
-{
-  return (a.isNegInf && b.isNegInf) ||
-         (a.isNegInf == b.isNegInf && a.component == b.component);
-}
-
-bool
-operator>(const Exclude::ExcludeComponent& a, const Exclude::ExcludeComponent& b)
-{
-  return a.isNegInf < b.isNegInf ||
-         (a.isNegInf == b.isNegInf && a.component > b.component);
-}
-
-Exclude::Range::Range()
-  : fromInfinity(false)
-  , toInfinity(false)
-{
-}
-
-Exclude::Range::Range(bool fromInfinity, const name::Component& from, bool toInfinity, const name::Component& to)
-  : fromInfinity(fromInfinity)
-  , from(from)
-  , toInfinity(toInfinity)
-  , to(to)
-{
-}
-
-bool
-Exclude::Range::operator==(const Exclude::Range& other) const
-{
-  return this->fromInfinity == other.fromInfinity && this->toInfinity == other.toInfinity &&
-         (this->fromInfinity || this->from == other.from) &&
-         (this->toInfinity || this->to == other.to);
-}
-
-std::ostream&
-operator<<(std::ostream& os, const Exclude::Range& range)
-{
-  if (range.isSingular()) {
-    return os << '{' << range.from << '}';
-  }
-
-  if (range.fromInfinity) {
-    os << "(-∞";
-  }
-  else {
-    os << '[' << range.from;
-  }
-
-  os << ",";
-
-  if (range.toInfinity) {
-    os << "+∞)";
-  }
-  else {
-    os << range.to << ']';
-  }
-
-  return os;
-}
-
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Exclude>));
-BOOST_CONCEPT_ASSERT((WireEncodable<Exclude>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Exclude>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Exclude>));
-static_assert(std::is_base_of<tlv::Error, Exclude::Error>::value,
-              "Exclude::Error must inherit from tlv::Error");
-
-Exclude::Exclude() = default;
-
-Exclude::Exclude(const Block& wire)
-{
-  wireDecode(wire);
-}
-
-template<encoding::Tag TAG>
-size_t
-Exclude::wireEncode(EncodingImpl<TAG>& encoder) const
-{
-  if (m_entries.empty()) {
-    NDN_THROW(Error("cannot encode empty Exclude selector"));
-  }
-
-  size_t totalLength = 0;
-
-  // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (GenericNameComponent (Any)?)+
-  // Any     ::= ANY-TYPE TLV-LENGTH(=0)
-
-  for (const Entry& entry : m_entries) {
-    if (entry.second) {
-      totalLength += prependEmptyBlock(encoder, tlv::Any);
-    }
-    if (!entry.first.isNegInf) {
-      totalLength += entry.first.component.wireEncode(encoder);
-    }
-  }
-
-  totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(tlv::Exclude);
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(Exclude);
-
-const Block&
-Exclude::wireEncode() const
-{
-  if (m_wire.hasWire())
-    return m_wire;
-
-  EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-  return m_wire;
-}
-
-void
-Exclude::wireDecode(const Block& wire)
-{
-  clear();
-
-  if (wire.type() != tlv::Exclude)
-    NDN_THROW(tlv::Error("Unexpected TLV type when decoding Exclude"));
-
-  m_wire = wire;
-  m_wire.parse();
-
-  if (m_wire.elements_size() == 0) {
-    NDN_THROW(Error("Exclude element cannot be empty"));
-  }
-
-  // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (GenericNameComponent (Any)?)+
-  // Any     ::= ANY-TYPE TLV-LENGTH(=0)
-
-  Block::element_const_iterator i = m_wire.elements_begin();
-  if (i->type() == tlv::Any) {
-    this->appendEntry(true, true);
-    ++i;
-  }
-
-  while (i != m_wire.elements_end()) {
-    name::Component component;
-    try {
-      component = name::Component(*i);
-    }
-    catch (const name::Component::Error&) {
-      NDN_THROW_NESTED(Error("Incorrect format of Exclude filter"));
-    }
-    if (!component.isGeneric() && !component.isImplicitSha256Digest()) {
-      NDN_THROW(Error("Excluded component must be generic or ImplicitSha256Digest"));
-    }
-    ++i;
-
-    if (i != m_wire.elements_end() && i->type() == tlv::Any) {
-      this->appendEntry(component, true);
-      ++i;
-    }
-    else {
-      this->appendEntry(component, false);
-    }
-  }
-}
-
-template<typename T>
-void
-Exclude::appendEntry(const T& component, bool hasAny)
-{
-  m_entries.emplace_hint(m_entries.begin(), std::piecewise_construct,
-                         std::forward_as_tuple(component),
-                         std::forward_as_tuple(hasAny));
-}
-
-// example: ANY "b" "d" ANY "f"
-// ordered in map as: "f" (false); "d" (true); "b" (false); -Inf (true)
-//
-// lower_bound("")  -> -Inf (true) <-- excluded (ANY)
-// lower_bound("a") -> -Inf (true) <-- excluded (ANY)
-// lower_bound("b") -> "b" (false) <--- excluded (equal)
-// lower_bound("c") -> "b" (false) <--- not excluded (not equal and no ANY)
-// lower_bound("d") -> "d" (true) <- excluded
-// lower_bound("e") -> "d" (true) <- excluded
-bool
-Exclude::isExcluded(const name::Component& comp) const
-{
-  ExcludeMap::const_iterator lb = m_entries.lower_bound(comp);
-  return lb != m_entries.end() && // if false, comp is less than the first excluded component
-         (lb->second || // comp matches an ANY range
-          (!lb->first.isNegInf && lb->first.component == comp)); // comp equals an exact excluded component
-}
-
-Exclude&
-Exclude::excludeOne(const name::Component& comp)
-{
-  if (!isExcluded(comp)) {
-    this->appendEntry(comp, false);
-    m_wire.reset();
-  }
-  return *this;
-}
-
-Exclude&
-Exclude::excludeBefore(const name::Component& to)
-{
-  return excludeRange(ExcludeComponent(true), to);
-}
-
-Exclude&
-Exclude::excludeRange(const name::Component& from, const name::Component& to)
-{
-  return excludeRange(ExcludeComponent(from), to);
-}
-
-// example: ANY "b" "d" ANY "g"
-// ordered in map as: "f" (false); "d" (true); "b" (false); -Inf (true)
-// possible sequence of operations:
-// excludeBefore("a") -> excludeRange(-Inf, "a") ->  ANY "a"
-//                          "a" (false); -Inf (true)
-// excludeBefore("b") -> excludeRange(-Inf, "b") ->  ANY "b"
-//                          "b" (false); -Inf (true)
-// excludeRange("e", "g") ->  ANY "b" "e" ANY "g"
-//                          "g" (false); "e" (true); "b" (false); -Inf (true)
-// excludeRange("d", "f") ->  ANY "b" "d" ANY "g"
-//                          "g" (false); "d" (true); "b" (false); -Inf (true)
-
-Exclude&
-Exclude::excludeRange(const ExcludeComponent& from, const name::Component& to)
-{
-  if (!from.isNegInf && from.component >= to) {
-    NDN_THROW(Error("Invalid exclude range [" + from.component.toUri() + ", " + to.toUri() + "] "
-                    "(for single name exclude use Exclude::excludeOne)"));
-  }
-
-  ExcludeMap::iterator newFrom = m_entries.lower_bound(from);
-  if (newFrom == m_entries.end() || !newFrom->second /*without ANY*/) {
-    bool isNewEntry = false;
-    std::tie(newFrom, isNewEntry) = m_entries.emplace(from, true);
-    if (!isNewEntry) {
-      // this means that the lower bound is equal to the item itself. So, just update ANY flag
-      newFrom->second = true;
-    }
-  }
-  // else
-  // nothing special if start of the range already exists with ANY flag set
-
-  ExcludeMap::iterator newTo = m_entries.lower_bound(to);
-  BOOST_ASSERT(newTo != m_entries.end());
-  if (newTo == newFrom || !newTo->second) {
-    newTo = m_entries.emplace_hint(newTo, to, false);
-    ++newTo;
-  }
-  // else
-  // nothing to do really
-
-  // remove any intermediate entries, since all of the are excluded
-  m_entries.erase(newTo, newFrom);
-
-  m_wire.reset();
-  return *this;
-}
-
-Exclude&
-Exclude::excludeAfter(const name::Component& from)
-{
-  ExcludeMap::iterator newFrom = m_entries.lower_bound(from);
-  if (newFrom == m_entries.end() || !newFrom->second /*without ANY*/) {
-    bool isNewEntry = false;
-    std::tie(newFrom, isNewEntry) = m_entries.emplace(from, true);
-    if (!isNewEntry) {
-      // this means that the lower bound is equal to the item itself. So, just update ANY flag
-      newFrom->second = true;
-    }
-  }
-  // else
-  // nothing special if start of the range already exists with ANY flag set
-
-  // remove any intermediate node, since all of the are excluded
-  m_entries.erase(m_entries.begin(), newFrom);
-
-  m_wire.reset();
-  return *this;
-}
-
-std::ostream&
-operator<<(std::ostream& os, const Exclude& exclude)
-{
-  auto join = make_ostream_joiner(os, ',');
-  for (const Exclude::Entry& entry : exclude.m_entries | boost::adaptors::reversed) {
-    if (!entry.first.isNegInf) {
-      join = entry.first.component;
-    }
-    if (entry.second) {
-      join = '*';
-    }
-  }
-  return os;
-}
-
-std::string
-Exclude::toUri() const
-{
-  std::ostringstream os;
-  os << *this;
-  return os.str();
-}
-
-bool
-Exclude::operator==(const Exclude& other) const
-{
-  return m_entries == other.m_entries;
-}
-
-size_t
-Exclude::size() const
-{
-  return std::distance(begin(), end());
-}
-
-void
-Exclude::clear()
-{
-  m_entries.clear();
-  m_wire.reset();
-}
-
-Exclude::const_iterator::const_iterator(ExcludeMap::const_reverse_iterator it,
-                                        ExcludeMap::const_reverse_iterator rend)
-  : m_it(it)
-  , m_rend(rend)
-{
-  this->update();
-}
-
-Exclude::const_iterator&
-Exclude::const_iterator::operator++()
-{
-  bool wasInRange = m_it->second;
-  ++m_it;
-  if (wasInRange && m_it != m_rend) {
-    BOOST_ASSERT(m_it->second == false); // consecutive ranges should have been combined
-    ++m_it; // skip over range high limit
-  }
-  this->update();
-  return *this;
-}
-
-Exclude::const_iterator
-Exclude::const_iterator::operator++(int)
-{
-  const_iterator i = *this;
-  this->operator++();
-  return i;
-}
-
-void
-Exclude::const_iterator::update()
-{
-  if (m_it == m_rend) {
-    return;
-  }
-
-  if (m_it->second) { // range
-    if (m_it->first.isNegInf) {
-      m_range.fromInfinity = true;
-    }
-    else {
-      m_range.fromInfinity = false;
-      m_range.from = m_it->first.component;
-    }
-
-    auto next = std::next(m_it);
-    if (next == m_rend) {
-      m_range.toInfinity = true;
-    }
-    else {
-      m_range.toInfinity = false;
-      m_range.to = next->first.component;
-    }
-  }
-  else { // single
-    BOOST_ASSERT(!m_it->first.isNegInf);
-    m_range.fromInfinity = m_range.toInfinity = false;
-    m_range.from = m_range.to = m_it->first.component;
-  }
-}
-
-} // namespace ndn
diff --git a/ndn-cxx/exclude.hpp b/ndn-cxx/exclude.hpp
deleted file mode 100644
index 118514e..0000000
--- a/ndn-cxx/exclude.hpp
+++ /dev/null
@@ -1,381 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 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.
- *
- * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
- */
-
-#ifndef NDN_EXCLUDE_HPP
-#define NDN_EXCLUDE_HPP
-
-#include "ndn-cxx/name-component.hpp"
-#include "ndn-cxx/encoding/encoding-buffer.hpp"
-
-#include <iterator>
-#include <map>
-
-namespace ndn {
-
-/**
- * @brief Represents Exclude selector in NDN Interest
- *
- * NDN Packet Format v0.3 defines name component types other than GenericNameComponent and
- * ImplicitSha256DigestComponent, and removes Exclude selector. This implementation follows v0.2
- * semantics and can only store GenericNameComponent and ImplicitSha256DigestComponent.
- * The behavior of \c isExcluded on a name component of other types is unspecified.
- */
-class Exclude
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    using tlv::Error::Error;
-  };
-
-  /**
-   * @brief Constructs an empty Exclude
-   */
-  Exclude();
-
-  /**
-   * @brief Create from wire encoding
-   */
-  explicit
-  Exclude(const Block& wire);
-
-  /**
-   * @brief Fast encoding or block size estimation
-   */
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  /**
-   * @brief Encode to a wire format
-   */
-  const Block&
-  wireEncode() const;
-
-  /**
-   * @brief Decode from the wire format
-   */
-  void
-  wireDecode(const Block& wire);
-
-  /**
-   * @brief Get escaped string representation (e.g., for use in URI) of the exclude filter
-   */
-  std::string
-  toUri() const;
-
-public: // high-level API
-  /**
-   * @brief Check if name component is excluded
-   * @param comp Name component to check against exclude filter
-   */
-  bool
-  isExcluded(const name::Component& comp) const;
-
-  /**
-   * @brief Exclude specific name component
-   * @param comp component to exclude
-   * @returns *this to allow chaining
-   */
-  Exclude&
-  excludeOne(const name::Component& comp);
-
-  /**
-   * @brief Exclude components in range [from, to]
-   * @param from first element of the range
-   * @param to last element of the range
-   * @throw Error \p from equals or comes after \p to in canonical ordering
-   * @returns *this to allow chaining
-   */
-  Exclude&
-  excludeRange(const name::Component& from, const name::Component& to);
-
-  /**
-   * @brief Exclude all components in range (-Inf, to]
-   * @param to last element of the range
-   * @returns *this to allow chaining
-   */
-  Exclude&
-  excludeBefore(const name::Component& to);
-
-  /**
-   * @brief Exclude all components in range [from, +Inf)
-   * @param from the first element of the range
-   * @returns *this to allow chaining
-   */
-  Exclude&
-  excludeAfter(const name::Component& from);
-
-public: // EqualityComparable concept
-  bool
-  operator==(const Exclude& other) const;
-
-  bool
-  operator!=(const Exclude& other) const;
-
-public: // internal storage
-  /**
-   * @brief either a name::Component or "negative infinity"
-   */
-  class ExcludeComponent
-  {
-  public:
-    /**
-     * @brief implicitly construct a regular infinity ExcludeComponent
-     * @param component a name component which is excluded
-     */
-    ExcludeComponent(const name::Component& component);
-
-    /**
-     * @brief construct a negative infinity ExcludeComponent
-     * @param isNegInf must be true
-     */
-    explicit
-    ExcludeComponent(bool isNegInf);
-
-  public:
-    bool isNegInf;
-    name::Component component;
-  };
-
-  /**
-   * @brief a map of exclude entries
-   *
-   * Each key, except "negative infinity", is a name component that is excluded.
-   * The mapped boolean indicates whether the range between a key and the next greater key
-   * is also excluded. If true, the wire encoding shall have an ANY element.
-   *
-   * The map is ordered in descending order to simplify \p isExcluded.
-   */
-  typedef std::map<ExcludeComponent, bool, std::greater<ExcludeComponent>> ExcludeMap;
-  typedef ExcludeMap::value_type Entry;
-
-public: // enumeration API
-  /**
-   * @brief represent an excluded component or range
-   */
-  class Range
-  {
-  public:
-    Range();
-
-    Range(bool fromInfinity, const name::Component& from, bool toInfinity, const name::Component& to);
-
-    /**
-     * @retval true A single component is excluded
-     * @retval false A range of more than one components are excluded
-     */
-    bool
-    isSingular() const;
-
-    bool
-    operator==(const Exclude::Range& other) const;
-
-    bool
-    operator!=(const Exclude::Range& other) const;
-
-  public:
-    /**
-     * @brief from negative infinity?
-     */
-    bool fromInfinity;
-
-    /**
-     * @brief from component (inclusive)
-     * @pre valid only if !fromInfinity
-     */
-    name::Component from;
-
-    /**
-     * @brief to positive infinity?
-     */
-    bool toInfinity;
-
-    /**
-     * @brief to component (inclusive)
-     * @pre valid only if !toInfinity
-     */
-    name::Component to;
-  };
-
-  class const_iterator
-  {
-  public:
-    using iterator_category = std::forward_iterator_tag;
-    using value_type        = const Range;
-    using difference_type   = std::ptrdiff_t;
-    using pointer           = value_type*;
-    using reference         = value_type&;
-
-    const_iterator() = default;
-
-    const_iterator(ExcludeMap::const_reverse_iterator it, ExcludeMap::const_reverse_iterator rend);
-
-    reference
-    operator*() const;
-
-    pointer
-    operator->() const;
-
-    const_iterator&
-    operator++();
-
-    const_iterator
-    operator++(int);
-
-    bool
-    operator==(const const_iterator& other) const;
-
-    bool
-    operator!=(const const_iterator& other) const;
-
-  private:
-    void
-    update();
-
-  private:
-    ExcludeMap::const_reverse_iterator m_it;
-    ExcludeMap::const_reverse_iterator m_rend;
-    Range m_range;
-    friend class Exclude;
-  };
-
-  const_iterator
-  begin() const;
-
-  const_iterator
-  end() const;
-
-  bool
-  empty() const;
-
-  size_t
-  size() const;
-
-  /// \todo const_iterator erase(const_iterator i);
-
-  void
-  clear();
-
-private:
-  /**
-   * @brief directly append exclude element
-   * @tparam T either name::Component or bool
-   *
-   * This method is used during conversion from wire format of exclude filter
-   */
-  template<typename T>
-  void
-  appendEntry(const T& component, bool hasAny);
-
-  Exclude&
-  excludeRange(const ExcludeComponent& from, const name::Component& to);
-
-private:
-  ExcludeMap m_entries;
-  mutable Block m_wire;
-
-  friend std::ostream&
-  operator<<(std::ostream& os, const Exclude& name);
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Exclude);
-
-bool
-operator==(const Exclude::ExcludeComponent& a, const Exclude::ExcludeComponent& b);
-
-bool
-operator>(const Exclude::ExcludeComponent& a, const Exclude::ExcludeComponent& b);
-
-std::ostream&
-operator<<(std::ostream& os, const Exclude::Range& range);
-
-std::ostream&
-operator<<(std::ostream& os, const Exclude& name);
-
-inline Exclude::const_iterator
-Exclude::begin() const
-{
-  return const_iterator(m_entries.rbegin(), m_entries.rend());
-}
-
-inline Exclude::const_iterator
-Exclude::end() const
-{
-  return const_iterator(m_entries.rend(), m_entries.rend());
-}
-
-inline bool
-Exclude::empty() const
-{
-  return m_entries.empty();
-}
-
-inline bool
-Exclude::operator!=(const Exclude& other) const
-{
-  return !(*this == other);
-}
-
-inline bool
-Exclude::Range::isSingular() const
-{
-  return !this->fromInfinity && !this->toInfinity && this->from == this->to;
-}
-
-inline bool
-Exclude::Range::operator!=(const Exclude::Range& other) const
-{
-  return !this->operator==(other);
-}
-
-inline Exclude::const_iterator::reference
-Exclude::const_iterator::operator*() const
-{
-  BOOST_ASSERT(m_it != m_rend);
-  return m_range;
-}
-
-inline Exclude::const_iterator::pointer
-Exclude::const_iterator::operator->() const
-{
-  BOOST_ASSERT(m_it != m_rend);
-  return &m_range;
-}
-
-inline bool
-Exclude::const_iterator::operator==(const const_iterator& other) const
-{
-  return m_it == other.m_it;
-}
-
-inline bool
-Exclude::const_iterator::operator!=(const const_iterator& other) const
-{
-  return !this->operator==(other);
-}
-
-} // namespace ndn
-
-#endif // NDN_EXCLUDE_HPP
diff --git a/ndn-cxx/interest.cpp b/ndn-cxx/interest.cpp
index 091038b..e5d8467 100644
--- a/ndn-cxx/interest.cpp
+++ b/ndn-cxx/interest.cpp
@@ -95,55 +95,7 @@
 #endif // NDN_CXX_HAVE_TESTS
   }
 
-  if (getHopLimit() || hasApplicationParameters()) {
-    return encode03(encoder);
-  }
-  else {
-    return encode02(encoder);
-  }
-}
-
-template<encoding::Tag TAG>
-size_t
-Interest::encode02(EncodingImpl<TAG>& encoder) const
-{
-  // Encode as NDN Packet Format v0.2
-  // Interest ::= INTEREST-TYPE TLV-LENGTH
-  //                Name
-  //                Selectors?
-  //                Nonce
-  //                InterestLifetime?
-  //                ForwardingHint?
-  // (elements are encoded in reverse order)
-
-  size_t totalLength = 0;
-
-  // ForwardingHint
-  if (getForwardingHint().size() > 0) {
-    totalLength += getForwardingHint().wireEncode(encoder);
-  }
-
-  // InterestLifetime
-  if (getInterestLifetime() != DEFAULT_INTEREST_LIFETIME) {
-    totalLength += prependNonNegativeIntegerBlock(encoder, tlv::InterestLifetime,
-                                                  static_cast<uint64_t>(getInterestLifetime().count()));
-  }
-
-  // Nonce
-  uint32_t nonce = getNonce(); // if nonce was unset, this generates a fresh nonce
-  totalLength += encoder.prependByteArrayBlock(tlv::Nonce, reinterpret_cast<uint8_t*>(&nonce), sizeof(nonce));
-
-  // Selectors
-  if (hasSelectors()) {
-    totalLength += getSelectors().wireEncode(encoder);
-  }
-
-  // Name
-  totalLength += getName().wireEncode(encoder);
-
-  totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(tlv::Interest);
-  return totalLength;
+  return encode03(encoder);
 }
 
 template<encoding::Tag TAG>
@@ -247,79 +199,11 @@
   m_wire = wire;
   m_wire.parse();
 
-  if (!decode02()) {
-    decode03();
-    getNonce(); // force generation of nonce
-  }
-
+  decode03();
+  getNonce(); // force generation of nonce
   m_isCanBePrefixSet = true; // don't trigger warning from decoded packet
 }
 
-bool
-Interest::decode02()
-{
-  auto element = m_wire.elements_begin();
-
-  // Name
-  if (element != m_wire.elements_end() && element->type() == tlv::Name) {
-    // decode into a temporary object until we determine that the name is valid, in order
-    // to maintain class invariants and thus provide a basic form of exception safety
-    Name tempName(*element);
-    ssize_t digestIndex = findParametersDigestComponent(tempName);
-    if (digestIndex == -2) {
-      NDN_THROW(Error("Name has more than one ParametersSha256DigestComponent"));
-    }
-    m_name = std::move(tempName);
-    ++element;
-  }
-  else {
-    return false;
-  }
-
-  // Selectors?
-  if (element != m_wire.elements_end() && element->type() == tlv::Selectors) {
-    m_selectors.wireDecode(*element);
-    ++element;
-  }
-  else {
-    m_selectors = {};
-  }
-
-  // Nonce
-  if (element != m_wire.elements_end() && element->type() == tlv::Nonce) {
-    uint32_t nonce = 0;
-    if (element->value_size() != sizeof(nonce)) {
-      NDN_THROW(Error("Nonce element is malformed"));
-    }
-    std::memcpy(&nonce, element->value(), sizeof(nonce));
-    m_nonce = nonce;
-    ++element;
-  }
-  else {
-    return false;
-  }
-
-  // InterestLifetime?
-  if (element != m_wire.elements_end() && element->type() == tlv::InterestLifetime) {
-    m_interestLifetime = time::milliseconds(readNonNegativeInteger(*element));
-    ++element;
-  }
-  else {
-    m_interestLifetime = DEFAULT_INTEREST_LIFETIME;
-  }
-
-  // ForwardingHint?
-  if (element != m_wire.elements_end() && element->type() == tlv::ForwardingHint) {
-    m_forwardingHint.wireDecode(*element, false);
-    ++element;
-  }
-  else {
-    m_forwardingHint = {};
-  }
-
-  return element == m_wire.elements_end();
-}
-
 void
 Interest::decode03()
 {
@@ -349,7 +233,7 @@
   }
   m_name = std::move(tempName);
 
-  m_selectors = Selectors().setMaxSuffixComponents(1); // CanBePrefix=0
+  m_canBePrefix = m_mustBeFresh = false;
   m_forwardingHint = {};
   m_nonce.reset();
   m_interestLifetime = DEFAULT_INTEREST_LIFETIME;
@@ -366,7 +250,7 @@
         if (element->value_size() != 0) {
           NDN_THROW(Error("CanBePrefix element has non-zero TLV-LENGTH"));
         }
-        m_selectors.setMaxSuffixComponents(-1);
+        m_canBePrefix = true;
         lastElement = 2;
         break;
       }
@@ -377,7 +261,7 @@
         if (element->value_size() != 0) {
           NDN_THROW(Error("MustBeFresh element has non-zero TLV-LENGTH"));
         }
-        m_selectors.setMustBeFresh(true);
+        m_mustBeFresh = true;
         lastElement = 3;
         break;
       }
@@ -461,33 +345,6 @@
 // ---- matching ----
 
 bool
-Interest::matchesName(const Name& name) const
-{
-  if (name.size() < m_name.size())
-    return false;
-
-  if (!m_name.isPrefixOf(name))
-    return false;
-
-  if (getMinSuffixComponents() >= 0 &&
-      // name must include implicit digest
-      !(name.size() - m_name.size() >= static_cast<size_t>(getMinSuffixComponents())))
-    return false;
-
-  if (getMaxSuffixComponents() >= 0 &&
-      // name must include implicit digest
-      !(name.size() - m_name.size() <= static_cast<size_t>(getMaxSuffixComponents())))
-    return false;
-
-  if (!getExclude().empty() &&
-      name.size() > m_name.size() &&
-      getExclude().isExcluded(name[m_name.size()]))
-    return false;
-
-  return true;
-}
-
-bool
 Interest::matchesData(const Data& data) const
 {
   size_t interestNameLength = m_name.size();
@@ -758,19 +615,6 @@
   os << interest.getName();
 
   char delim = '?';
-
-  if (interest.getMinSuffixComponents() >= 0) {
-    os << delim << "ndn.MinSuffixComponents=" << interest.getMinSuffixComponents();
-    delim = '&';
-  }
-  if (interest.getMaxSuffixComponents() >= 0) {
-    os << delim << "ndn.MaxSuffixComponents=" << interest.getMaxSuffixComponents();
-    delim = '&';
-  }
-  if (interest.getChildSelector() != DEFAULT_CHILD_SELECTOR) {
-    os << delim << "ndn.ChildSelector=" << interest.getChildSelector();
-    delim = '&';
-  }
   if (interest.getMustBeFresh()) {
     os << delim << "ndn.MustBeFresh=" << interest.getMustBeFresh();
     delim = '&';
@@ -783,10 +627,6 @@
     os << delim << "ndn.Nonce=" << interest.getNonce();
     delim = '&';
   }
-  if (!interest.getExclude().empty()) {
-    os << delim << "ndn.Exclude=" << interest.getExclude();
-    delim = '&';
-  }
 
   return os;
 }
diff --git a/ndn-cxx/interest.hpp b/ndn-cxx/interest.hpp
index fd79836..39cfb53 100644
--- a/ndn-cxx/interest.hpp
+++ b/ndn-cxx/interest.hpp
@@ -24,7 +24,6 @@
 
 #include "ndn-cxx/delegation-list.hpp"
 #include "ndn-cxx/name.hpp"
-#include "ndn-cxx/selectors.hpp"
 #include "ndn-cxx/detail/packet-base.hpp"
 #include "ndn-cxx/util/time.hpp"
 
@@ -73,15 +72,12 @@
   size_t
   wireEncode(EncodingImpl<TAG>& encoder) const;
 
-  /** @brief Encode to a @c Block.
-   *
-   *  Encodes into NDN Packet Format v0.3 if ApplicationParameters element is present, in which
-   *  case Selectors are not encoded. Otherwise, encodes into NDN Packet Format v0.2.
+  /** @brief Encode into a Block according to NDN Packet Format v0.3.
    */
   const Block&
   wireEncode() const;
 
-  /** @brief Decode from @p wire in NDN Packet Format v0.2 or v0.3.
+  /** @brief Decode from @p wire according to NDN Packet Format v0.3.
    */
   void
   wireDecode(const Block& wire);
@@ -104,14 +100,6 @@
   toUri() const;
 
 public: // matching
-  /** @brief Check if Interest, including selectors, matches the given @p name
-   *  @param name The name to be matched. If this is a Data name, it shall contain the
-   *              implicit digest component
-   */
-  [[deprecated("use matchesData")]]
-  bool
-  matchesName(const Name& name) const;
-
   /** @brief Check if Interest can be satisfied by @p data.
    *
    *  This method considers Name, CanBePrefix, and MustBeFresh. However, MustBeFresh processing
@@ -129,7 +117,7 @@
 
 public: // element access
   const Name&
-  getName() const
+  getName() const noexcept
   {
     return m_name;
   }
@@ -161,62 +149,46 @@
   }
 
   /** @brief Check whether the CanBePrefix element is present.
-   *
-   *  This is a getter for the CanBePrefix element as defined in NDN Packet Format v0.3.
-   *  In this implementation, it is mapped to the closest v0.2 semantics:
-   *  MaxSuffixComponents=1 means CanBePrefix is absent.
    */
   bool
-  getCanBePrefix() const
+  getCanBePrefix() const noexcept
   {
-    return m_selectors.getMaxSuffixComponents() != 1;
+    return m_canBePrefix;
   }
 
   /** @brief Add or remove CanBePrefix element.
    *  @param canBePrefix whether CanBePrefix element should be present.
-   *
-   *  This is a setter for the CanBePrefix element as defined in NDN Packet Format v0.3.
-   *  In this implementation, it is mapped to the closest v0.2 semantics:
-   *  MaxSuffixComponents=1 means CanBePrefix is absent.
    */
   Interest&
   setCanBePrefix(bool canBePrefix)
   {
-    m_selectors.setMaxSuffixComponents(canBePrefix ? -1 : 1);
+    m_canBePrefix = canBePrefix;
     m_wire.reset();
     m_isCanBePrefixSet = true;
     return *this;
   }
 
   /** @brief Check whether the MustBeFresh element is present.
-   *
-   *  This is a getter for the MustBeFresh element as defined in NDN Packet Format v0.3.
-   *  In this implementation, it is mapped to the closest v0.2 semantics and appears as
-   *  MustBeFresh element under Selectors.
    */
   bool
-  getMustBeFresh() const
+  getMustBeFresh() const noexcept
   {
-    return m_selectors.getMustBeFresh();
+    return m_mustBeFresh;
   }
 
   /** @brief Add or remove MustBeFresh element.
    *  @param mustBeFresh whether MustBeFresh element should be present.
-   *
-   *  This is a setter for the MustBeFresh element as defined in NDN Packet Format v0.3.
-   *  In this implementation, it is mapped to the closest v0.2 semantics and appears as
-   *  MustBeFresh element under Selectors.
    */
   Interest&
   setMustBeFresh(bool mustBeFresh)
   {
-    m_selectors.setMustBeFresh(mustBeFresh);
+    m_mustBeFresh = mustBeFresh;
     m_wire.reset();
     return *this;
   }
 
   const DelegationList&
-  getForwardingHint() const
+  getForwardingHint() const noexcept
   {
     return m_forwardingHint;
   }
@@ -272,7 +244,7 @@
   refreshNonce();
 
   time::milliseconds
-  getInterestLifetime() const
+  getInterestLifetime() const noexcept
   {
     return m_interestLifetime;
   }
@@ -284,7 +256,7 @@
   setInterestLifetime(time::milliseconds lifetime);
 
   optional<uint8_t>
-  getHopLimit() const
+  getHopLimit() const noexcept
   {
     return m_hopLimit;
   }
@@ -381,133 +353,13 @@
   bool
   isParametersDigestValid() const;
 
-public: // Selectors (deprecated)
-  /** @brief Check if Interest has any selector present.
-   */
-  [[deprecated]]
-  bool
-  hasSelectors() const
-  {
-    return !m_selectors.empty();
-  }
-
-  [[deprecated]]
-  const Selectors&
-  getSelectors() const
-  {
-    return m_selectors;
-  }
-
-  [[deprecated]]
-  Interest&
-  setSelectors(const Selectors& selectors)
-  {
-    m_selectors = selectors;
-    m_wire.reset();
-    return *this;
-  }
-
-  [[deprecated]]
-  int
-  getMinSuffixComponents() const
-  {
-    return m_selectors.getMinSuffixComponents();
-  }
-
-  [[deprecated]]
-  Interest&
-  setMinSuffixComponents(int minSuffixComponents)
-  {
-    m_selectors.setMinSuffixComponents(minSuffixComponents);
-    m_wire.reset();
-    return *this;
-  }
-
-  [[deprecated]]
-  int
-  getMaxSuffixComponents() const
-  {
-    return m_selectors.getMaxSuffixComponents();
-  }
-
-  [[deprecated]]
-  Interest&
-  setMaxSuffixComponents(int maxSuffixComponents)
-  {
-    m_selectors.setMaxSuffixComponents(maxSuffixComponents);
-    m_wire.reset();
-    return *this;
-  }
-
-  [[deprecated]]
-  const KeyLocator&
-  getPublisherPublicKeyLocator() const
-  {
-    return m_selectors.getPublisherPublicKeyLocator();
-  }
-
-  [[deprecated]]
-  Interest&
-  setPublisherPublicKeyLocator(const KeyLocator& keyLocator)
-  {
-    m_selectors.setPublisherPublicKeyLocator(keyLocator);
-    m_wire.reset();
-    return *this;
-  }
-
-  [[deprecated]]
-  const Exclude&
-  getExclude() const
-  {
-    return m_selectors.getExclude();
-  }
-
-  [[deprecated]]
-  Interest&
-  setExclude(const Exclude& exclude)
-  {
-    m_selectors.setExclude(exclude);
-    m_wire.reset();
-    return *this;
-  }
-
-  [[deprecated]]
-  int
-  getChildSelector() const
-  {
-    return m_selectors.getChildSelector();
-  }
-
-  [[deprecated]]
-  Interest&
-  setChildSelector(int childSelector)
-  {
-    m_selectors.setChildSelector(childSelector);
-    m_wire.reset();
-    return *this;
-  }
-
 private:
-  /** @brief Prepend wire encoding to @p encoder in NDN Packet Format v0.2.
-   */
-  template<encoding::Tag TAG>
-  size_t
-  encode02(EncodingImpl<TAG>& encoder) const;
-
   /** @brief Prepend wire encoding to @p encoder in NDN Packet Format v0.3.
    */
   template<encoding::Tag TAG>
   size_t
   encode03(EncodingImpl<TAG>& encoder) const;
 
-  /** @brief Decode @c m_wire as NDN Packet Format v0.2.
-   *  @retval true decoding successful.
-   *  @retval false decoding failed due to structural error.
-   *  @throw tlv::Error decoding error.
-   */
-  bool
-  decode02();
-
   /** @brief Decode @c m_wire as NDN Packet Format v0.3.
    *  @throw tlv::Error decoding error.
    */
@@ -550,8 +402,9 @@
   static bool s_autoCheckParametersDigest;
 
   Name m_name;
-  Selectors m_selectors; // NDN Packet Format v0.2 only
   mutable bool m_isCanBePrefixSet = false;
+  bool m_canBePrefix = true;
+  bool m_mustBeFresh = false;
   DelegationList m_forwardingHint;
   mutable optional<uint32_t> m_nonce;
   time::milliseconds m_interestLifetime;
@@ -563,7 +416,7 @@
   // be empty. Conversely, if this vector is not empty, the first element will always
   // be an ApplicationParameters block. All blocks in this vector are covered by the
   // digest in the ParametersSha256DigestComponent.
-  std::vector<Block> m_parameters; // NDN Packet Format v0.3 only
+  std::vector<Block> m_parameters;
 
   mutable Block m_wire;
 };
diff --git a/ndn-cxx/selectors.cpp b/ndn-cxx/selectors.cpp
deleted file mode 100644
index c972441..0000000
--- a/ndn-cxx/selectors.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2019 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 "ndn-cxx/selectors.hpp"
-#include "ndn-cxx/encoding/encoding-buffer.hpp"
-#include "ndn-cxx/encoding/block-helpers.hpp"
-
-namespace ndn {
-
-BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Selectors>));
-BOOST_CONCEPT_ASSERT((WireEncodable<Selectors>));
-BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Selectors>));
-BOOST_CONCEPT_ASSERT((WireDecodable<Selectors>));
-static_assert(std::is_base_of<tlv::Error, Selectors::Error>::value,
-              "Selectors::Error must inherit from tlv::Error");
-
-Selectors::Selectors()
-  : m_minSuffixComponents(-1)
-  , m_maxSuffixComponents(-1)
-  , m_childSelector(DEFAULT_CHILD_SELECTOR)
-  , m_mustBeFresh(false)
-{
-}
-
-Selectors::Selectors(const Block& wire)
-{
-  wireDecode(wire);
-}
-
-bool
-Selectors::empty() const
-{
-  return m_minSuffixComponents < 0 &&
-         m_maxSuffixComponents < 0 &&
-         m_publisherPublicKeyLocator.empty() &&
-         m_exclude.empty() &&
-         m_childSelector == DEFAULT_CHILD_SELECTOR &&
-         !m_mustBeFresh;
-}
-
-template<encoding::Tag TAG>
-size_t
-Selectors::wireEncode(EncodingImpl<TAG>& encoder) const
-{
-  size_t totalLength = 0;
-
-  // Selectors ::= SELECTORS-TYPE TLV-LENGTH
-  //                 MinSuffixComponents?
-  //                 MaxSuffixComponents?
-  //                 PublisherPublicKeyLocator?
-  //                 Exclude?
-  //                 ChildSelector?
-  //                 MustBeFresh?
-
-  // (reverse encoding)
-
-  // MustBeFresh
-  if (getMustBeFresh()) {
-    totalLength += prependEmptyBlock(encoder, tlv::MustBeFresh);
-  }
-
-  // ChildSelector
-  if (getChildSelector() != DEFAULT_CHILD_SELECTOR) {
-    totalLength += prependNonNegativeIntegerBlock(encoder, tlv::ChildSelector, getChildSelector());
-  }
-
-  // Exclude
-  if (!getExclude().empty()) {
-    totalLength += getExclude().wireEncode(encoder);
-  }
-
-  // PublisherPublicKeyLocator
-  if (!getPublisherPublicKeyLocator().empty()) {
-    totalLength += getPublisherPublicKeyLocator().wireEncode(encoder);
-  }
-
-  // MaxSuffixComponents
-  if (getMaxSuffixComponents() >= 0) {
-    totalLength += prependNonNegativeIntegerBlock(encoder, tlv::MaxSuffixComponents,
-                                                  getMaxSuffixComponents());
-  }
-
-  // MinSuffixComponents
-  if (getMinSuffixComponents() >= 0) {
-    totalLength += prependNonNegativeIntegerBlock(encoder, tlv::MinSuffixComponents,
-                                                  getMinSuffixComponents());
-  }
-
-  totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(tlv::Selectors);
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(Selectors);
-
-const Block&
-Selectors::wireEncode() const
-{
-  if (m_wire.hasWire())
-    return m_wire;
-
-  EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-  return m_wire;
-}
-
-void
-Selectors::wireDecode(const Block& wire)
-{
-  if (wire.type() != tlv::Selectors)
-    NDN_THROW(tlv::Error("Selectors", wire.type()));
-
-  *this = Selectors();
-
-  m_wire = wire;
-  m_wire.parse();
-
-  // MinSuffixComponents
-  Block::element_const_iterator val = m_wire.find(tlv::MinSuffixComponents);
-  if (val != m_wire.elements_end()) {
-    m_minSuffixComponents = readNonNegativeIntegerAs<int>(*val);
-  }
-
-  // MaxSuffixComponents
-  val = m_wire.find(tlv::MaxSuffixComponents);
-  if (val != m_wire.elements_end()) {
-    m_maxSuffixComponents = readNonNegativeIntegerAs<int>(*val);
-  }
-
-  // PublisherPublicKeyLocator
-  val = m_wire.find(tlv::KeyLocator);
-  if (val != m_wire.elements_end()) {
-    m_publisherPublicKeyLocator.wireDecode(*val);
-  }
-
-  // Exclude
-  val = m_wire.find(tlv::Exclude);
-  if (val != m_wire.elements_end()) {
-    m_exclude.wireDecode(*val);
-  }
-
-  // ChildSelector
-  val = m_wire.find(tlv::ChildSelector);
-  if (val != m_wire.elements_end()) {
-    m_childSelector = readNonNegativeIntegerAs<bool>(*val);
-  }
-  else {
-    m_childSelector = DEFAULT_CHILD_SELECTOR;
-  }
-
-  // MustBeFresh
-  val = m_wire.find(tlv::MustBeFresh);
-  if (val != m_wire.elements_end()) {
-    m_mustBeFresh = true;
-  }
-}
-
-Selectors&
-Selectors::setMinSuffixComponents(int minSuffixComponents)
-{
-  m_minSuffixComponents = minSuffixComponents;
-  m_wire.reset();
-  return *this;
-}
-
-Selectors&
-Selectors::setMaxSuffixComponents(int maxSuffixComponents)
-{
-  m_maxSuffixComponents = maxSuffixComponents;
-  m_wire.reset();
-  return *this;
-}
-
-Selectors&
-Selectors::setPublisherPublicKeyLocator(const KeyLocator& keyLocator)
-{
-  m_publisherPublicKeyLocator = keyLocator;
-  m_wire.reset();
-  return *this;
-}
-
-Selectors&
-Selectors::setExclude(const Exclude& exclude)
-{
-  m_exclude = exclude;
-  m_wire.reset();
-  return *this;
-}
-
-Selectors&
-Selectors::setChildSelector(int childSelector)
-{
-  if (childSelector != 0 && childSelector != 1) {
-    NDN_THROW(std::invalid_argument("ChildSelector must be 0 or 1"));
-  }
-  m_childSelector = childSelector;
-  m_wire.reset();
-  return *this;
-}
-
-Selectors&
-Selectors::setMustBeFresh(bool mustBeFresh)
-{
-  m_mustBeFresh = mustBeFresh;
-  m_wire.reset();
-  return *this;
-}
-
-bool
-Selectors::operator==(const Selectors& other) const
-{
-  return wireEncode() == other.wireEncode();
-}
-
-} // namespace ndn
diff --git a/ndn-cxx/selectors.hpp b/ndn-cxx/selectors.hpp
deleted file mode 100644
index 12b09f2..0000000
--- a/ndn-cxx/selectors.hpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 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.
- */
-
-#ifndef NDN_SELECTORS_HPP
-#define NDN_SELECTORS_HPP
-
-#include "ndn-cxx/exclude.hpp"
-#include "ndn-cxx/key-locator.hpp"
-
-namespace ndn {
-
-const int DEFAULT_CHILD_SELECTOR = 0;
-
-/**
- * @brief Abstraction implementing Interest selectors
- */
-class Selectors
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    using tlv::Error::Error;
-  };
-
-  Selectors();
-
-  /**
-   * @brief Create from wire encoding
-   */
-  explicit
-  Selectors(const Block& wire);
-
-  bool
-  empty() const;
-
-  /**
-   * @brief Fast encoding or block size estimation
-   */
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  /**
-   * @brief Encode to a wire format
-   */
-  const Block&
-  wireEncode() const;
-
-  /**
-   * @brief Decode the input from wire format
-   */
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-  int
-  getMinSuffixComponents() const
-  {
-    return m_minSuffixComponents;
-  }
-
-  Selectors&
-  setMinSuffixComponents(int minSuffixComponents);
-
-  int
-  getMaxSuffixComponents() const
-  {
-    return m_maxSuffixComponents;
-  }
-
-  Selectors&
-  setMaxSuffixComponents(int maxSuffixComponents);
-
-  const KeyLocator&
-  getPublisherPublicKeyLocator() const
-  {
-    return m_publisherPublicKeyLocator;
-  }
-
-  Selectors&
-  setPublisherPublicKeyLocator(const KeyLocator& keyLocator);
-
-  const Exclude&
-  getExclude() const
-  {
-    return m_exclude;
-  }
-
-  Selectors&
-  setExclude(const Exclude& exclude);
-
-  int
-  getChildSelector() const
-  {
-    return m_childSelector;
-  }
-
-  /**
-   * @brief set ChildSelector
-   * @throw std::invalid_argument ChildSelector not 0 or 1
-   */
-  Selectors&
-  setChildSelector(int childSelector);
-
-  bool
-  getMustBeFresh() const
-  {
-    return m_mustBeFresh;
-  }
-
-  Selectors&
-  setMustBeFresh(bool mustBeFresh);
-
-public: // EqualityComparable concept
-  bool
-  operator==(const Selectors& other) const;
-
-  bool
-  operator!=(const Selectors& other) const
-  {
-    return !this->operator==(other);
-  }
-
-private:
-  int m_minSuffixComponents;
-  int m_maxSuffixComponents;
-  KeyLocator m_publisherPublicKeyLocator;
-  Exclude m_exclude;
-  int m_childSelector;
-  bool m_mustBeFresh;
-
-  mutable Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Selectors);
-
-} // namespace ndn
-
-#endif // NDN_SELECTORS_HPP
diff --git a/tests/unit/exclude.t.cpp b/tests/unit/exclude.t.cpp
deleted file mode 100644
index d9e4379..0000000
--- a/tests/unit/exclude.t.cpp
+++ /dev/null
@@ -1,568 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 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 "ndn-cxx/exclude.hpp"
-#include "ndn-cxx/util/sha256.hpp"
-
-#include "tests/boost-test.hpp"
-
-#include <boost/lexical_cast.hpp>
-
-namespace ndn {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(TestExclude)
-
-BOOST_AUTO_TEST_SUITE(GenericComponent) // exclude GenericNameComponent
-
-BOOST_AUTO_TEST_CASE(One)
-{
-  Exclude e;
-  std::vector<Exclude::Range> enumerated;
-
-  e.excludeOne(name::Component("b"));
-  BOOST_CHECK_EQUAL(e.toUri(), "b");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[0].from, name::Component("b"));
-
-  e.excludeOne(name::Component("d"));
-  BOOST_CHECK_EQUAL(e.toUri(), "b,d");
-  BOOST_CHECK_EQUAL(e.size(), 2);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 2);
-  BOOST_CHECK_EQUAL(enumerated[0].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[0].from, name::Component("b"));
-  BOOST_CHECK_EQUAL(enumerated[1].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[1].from, name::Component("d"));
-
-  e.excludeOne(name::Component("a"));
-  BOOST_CHECK_EQUAL(e.toUri(), "a,b,d");
-  BOOST_CHECK_EQUAL(e.size(), 3);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 3);
-  BOOST_CHECK_EQUAL(enumerated[0].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[0].from, name::Component("a"));
-  BOOST_CHECK_EQUAL(enumerated[1].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[1].from, name::Component("b"));
-  BOOST_CHECK_EQUAL(enumerated[2].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[2].from, name::Component("d"));
-
-  e.excludeOne(name::Component("aa"));
-  BOOST_CHECK_EQUAL(e.toUri(), "a,b,d,aa");
-  BOOST_CHECK_EQUAL(e.size(), 4);
-
-  e.excludeOne(name::Component("cc"));
-  BOOST_CHECK_EQUAL(e.toUri(), "a,b,d,aa,cc");
-  BOOST_CHECK_EQUAL(e.size(), 5);
-
-  e.excludeOne(name::Component("c"));
-  BOOST_CHECK_EQUAL(e.toUri(), "a,b,c,d,aa,cc");
-  BOOST_CHECK_EQUAL(e.size(), 6);
-}
-
-BOOST_AUTO_TEST_CASE(Before)
-{
-  // based on https://redmine.named-data.net/issues/1158
-  ndn::Exclude e;
-  BOOST_REQUIRE_NO_THROW(e.excludeBefore(name::Component("PuQxMaf91")));
-
-  BOOST_CHECK_EQUAL(e.toUri(), "*,PuQxMaf91");
-}
-
-BOOST_AUTO_TEST_CASE(Ranges)
-{
-  // example: ANY /b /d ANY /f
-
-  Exclude e;
-  std::vector<Exclude::Range> enumerated;
-
-  e.excludeOne(name::Component("b0"));
-  BOOST_CHECK_EQUAL(e.toUri(), "b0");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].isSingular(), true);
-  BOOST_CHECK_EQUAL(enumerated[0].from, name::Component("b0"));
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(enumerated[0]), "{b0}");
-  BOOST_CHECK_EQUAL(enumerated[0], (Exclude::Range{false, name::Component("b0"), false, name::Component("b0")}));
-  BOOST_CHECK_NE(enumerated[0], (Exclude::Range{false, name::Component("b0"), false, name::Component("b1")}));
-
-  e.excludeBefore(name::Component("b1"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,b1");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("b1"));
-
-  e.excludeBefore(name::Component("c0"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,c0");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("c0"));
-
-  e.excludeRange(name::Component("a0"), name::Component("c0"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,c0");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("c0"));
-
-  e.excludeRange(name::Component("d0"), name::Component("e0"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,c0,d0,*,e0");
-  BOOST_CHECK_EQUAL(e.size(), 2);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 2);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("c0"));
-  BOOST_CHECK_EQUAL(enumerated[1].fromInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[1].from, name::Component("d0"));
-  BOOST_CHECK_EQUAL(enumerated[1].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[1].to, name::Component("e0"));
-
-  e.excludeRange(name::Component("c1"), name::Component("d1"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,c0,c1,*,e0");
-  BOOST_CHECK_EQUAL(e.size(), 2);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 2);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("c0"));
-  BOOST_CHECK_EQUAL(enumerated[1].fromInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[1].from, name::Component("c1"));
-  BOOST_CHECK_EQUAL(enumerated[1].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[1].to, name::Component("e0"));
-
-  e.excludeRange(name::Component("a1"), name::Component("d1"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,e0");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("e0"));
-
-  e.excludeBefore(name::Component("e2"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,e2");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("e2"));
-
-  e.excludeAfter(name::Component("f0"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,e2,f0,*");
-  BOOST_CHECK_EQUAL(e.size(), 2);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 2);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("e2"));
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(enumerated[0]), "(-∞,e2]");
-  BOOST_CHECK_EQUAL(enumerated[0], (Exclude::Range{true, name::Component("ignore"), false, name::Component("e2")}));
-  BOOST_CHECK_EQUAL(enumerated[1].fromInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[1].from, name::Component("f0"));
-  BOOST_CHECK_EQUAL(enumerated[1].toInfinity, true);
-  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(enumerated[1]), "[f0,+∞)");
-  BOOST_CHECK_EQUAL(enumerated[1], (Exclude::Range{false, name::Component("f0"), true, name::Component("ignore")}));
-
-  e.excludeAfter(name::Component("e5"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*,e2,e5,*");
-  BOOST_CHECK_EQUAL(e.size(), 2);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 2);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component("e2"));
-  BOOST_CHECK_EQUAL(enumerated[1].fromInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[1].from, name::Component("e5"));
-  BOOST_CHECK_EQUAL(enumerated[1].toInfinity, true);
-
-  e.excludeAfter(name::Component("b2"));
-  BOOST_CHECK_EQUAL(e.toUri(), "*");
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  enumerated.clear();
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, true);
-
-  BOOST_REQUIRE_THROW(e.excludeRange(name::Component("d0"), name::Component("a0")),
-                      Exclude::Error);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // GenericComponent
-
-BOOST_AUTO_TEST_SUITE(ImplicitDigest) // exclude ImplicitSha256DigestComponent
-
-/** \brief make a name::Component with an octet repeated util::Sha256::DIGEST_SIZE times
- *  \param octet the octet to fill the component
- *  \param isDigest whether to make an ImplicitSha256DigestComponent or a GenericNameComponent
- *  \param lastOctet if non-negative, set the last octet to a different value
- */
-static name::Component
-makeComponent(uint8_t octet, bool isDigest, int lastOctet = -1)
-{
-  uint8_t wire[util::Sha256::DIGEST_SIZE];
-  std::memset(wire, octet, sizeof(wire));
-  if (lastOctet >= 0) {
-    wire[util::Sha256::DIGEST_SIZE - 1] = static_cast<uint8_t>(lastOctet);
-  }
-
-  if (isDigest) {
-    return name::Component::fromImplicitSha256Digest(wire, sizeof(wire));
-  }
-  else {
-    return name::Component(wire, sizeof(wire));
-  }
-}
-
-BOOST_AUTO_TEST_CASE(One)
-{
-  name::Component digestC = makeComponent(0xCC, true);;
-  name::Component genericC = makeComponent(0xCC, false);
-  name::Component digestD = makeComponent(0xDD, true);
-
-  Exclude e;
-  e.excludeOne(digestC);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestC), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(genericC), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestD), false);
-
-  e.clear();
-  e.excludeOne(genericC);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestC), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(genericC), true);
-}
-
-BOOST_AUTO_TEST_CASE(BeforeDigest)
-{
-  name::Component digestBA = makeComponent(0xBB, true, 0xBA);
-  name::Component digestBB = makeComponent(0xBB, true);
-  name::Component digestBC = makeComponent(0xBB, true, 0xBC);
-
-  Exclude e;
-  e.excludeBefore(digestBB);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestBA), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestBB), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestBC), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), false);
-
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  std::vector<Exclude::Range> enumerated;
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, true);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, digestBB);
-}
-
-BOOST_AUTO_TEST_CASE(BeforeGeneric)
-{
-  name::Component digest0 = makeComponent(0x00, true);
-  name::Component digest9 = makeComponent(0x99, true);
-  name::Component digestF = makeComponent(0xFF, true);
-
-  Exclude e;
-  e.excludeBefore(name::Component(""));
-  BOOST_CHECK_EQUAL(e.isExcluded(digest0), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest9), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestF), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), false);
-}
-
-BOOST_AUTO_TEST_CASE(AfterDigest)
-{
-  name::Component digestBA = makeComponent(0xBB, true, 0xBA);
-  name::Component digestBB = makeComponent(0xBB, true);
-  name::Component digestBC = makeComponent(0xBB, true, 0xBC);
-
-  Exclude e;
-  e.excludeAfter(digestBB);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestBA), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestBB), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestBC), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), true);
-
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  std::vector<Exclude::Range> enumerated;
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].from, digestBB);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, true);
-}
-
-BOOST_AUTO_TEST_CASE(AfterDigestFF)
-{
-  name::Component digest00 = makeComponent(0x00, true);
-  name::Component digest99 = makeComponent(0x99, true);
-  name::Component digestFE = makeComponent(0xFF, true, 0xFE);
-  name::Component digestFF = makeComponent(0xFF, true);
-
-  Exclude e;
-  e.excludeAfter(digestFF);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest00), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest99), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestFE), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestFF), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), true);
-}
-
-BOOST_AUTO_TEST_CASE(AfterGeneric)
-{
-  name::Component digest0 = makeComponent(0x00, true);
-  name::Component digest9 = makeComponent(0x99, true);
-  name::Component digestF = makeComponent(0xFF, true);
-
-  Exclude e;
-  e.excludeAfter(name::Component(""));
-  BOOST_CHECK_EQUAL(e.isExcluded(digest0), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest9), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestF), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), true);
-}
-
-BOOST_AUTO_TEST_CASE(RangeDigest)
-{
-  name::Component digest0 = makeComponent(0x00, true);
-  name::Component digest7 = makeComponent(0x77, true);
-  name::Component digest8 = makeComponent(0x88, true);
-  name::Component digest9 = makeComponent(0x99, true);
-  name::Component digestF = makeComponent(0xFF, true);
-
-  Exclude e;
-  e.excludeRange(digest7, digest9);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest0), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest7), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest8), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest9), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestF), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), false);
-}
-
-BOOST_AUTO_TEST_CASE(RangeDigestReverse)
-{
-  name::Component digest7 = makeComponent(0x77, true);
-  name::Component digest9 = makeComponent(0x99, true);
-
-  Exclude e;
-  BOOST_CHECK_THROW(e.excludeRange(digest9, digest7), Exclude::Error);
-}
-
-BOOST_AUTO_TEST_CASE(RangeDigestGeneric)
-{
-  name::Component digest0 = makeComponent(0x00, true);
-  name::Component digest7 = makeComponent(0x77, true);
-  name::Component digest9 = makeComponent(0x99, true);
-  name::Component digestF = makeComponent(0xFF, true);
-
-  Exclude e;
-  e.excludeRange(digest9, name::Component(""));
-  BOOST_CHECK_EQUAL(e.isExcluded(digest0), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest7), false);
-  BOOST_CHECK_EQUAL(e.isExcluded(digest9), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(digestF), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("")), true);
-  BOOST_CHECK_EQUAL(e.isExcluded(name::Component("generic")), false);
-
-  BOOST_CHECK_EQUAL(e.size(), 1);
-  std::vector<Exclude::Range> enumerated;
-  std::copy(e.begin(), e.end(), std::back_inserter(enumerated));
-  BOOST_REQUIRE_EQUAL(enumerated.size(), 1);
-  BOOST_CHECK_EQUAL(enumerated[0].fromInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].from, digest9);
-  BOOST_CHECK_EQUAL(enumerated[0].toInfinity, false);
-  BOOST_CHECK_EQUAL(enumerated[0].to, name::Component(""));
-}
-
-BOOST_AUTO_TEST_CASE(RangeGenericDigest)
-{
-  name::Component digestF = makeComponent(0xFF, true);
-
-  Exclude e;
-  BOOST_CHECK_THROW(e.excludeRange(name::Component(""), digestF), Exclude::Error);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // ImplicitDigest
-
-BOOST_AUTO_TEST_SUITE(WireCompare) // wireEncode, wireDecode, operator==, operator!=
-
-BOOST_AUTO_TEST_CASE(EqualityComparable)
-{
-  Exclude e1;
-  Exclude e2;
-  BOOST_CHECK_EQUAL(e1, e2);
-
-  e1.excludeOne(name::Component("T"));
-  BOOST_CHECK_NE(e1, e2);
-
-  e2.excludeOne(name::Component("D"));
-  BOOST_CHECK_NE(e1, e2);
-
-  e2.clear();
-  e2.excludeOne(name::Component("T"));
-  BOOST_CHECK_EQUAL(e1, e2);
-
-  e2.clear();
-  const uint8_t EXCLUDE[] = { 0x10, 0x15, 0x13, 0x00, 0x08, 0x01, 0x41, 0x08, 0x01, 0x42,
-                              0x08, 0x01, 0x43, 0x13, 0x00, 0x08, 0x01, 0x44, 0x08, 0x01,
-                              0x45, 0x13, 0x00 };
-  e2.wireDecode(Block(EXCLUDE, sizeof(EXCLUDE)));
-
-  e1.clear();
-  e1.excludeBefore(name::Component("A"));
-  e1.excludeOne(name::Component("B"));
-  e1.excludeRange(name::Component("C"), name::Component("D"));
-  e1.excludeAfter(name::Component("E"));
-  BOOST_CHECK_EQUAL(e1, e2);
-}
-
-BOOST_AUTO_TEST_CASE(Malformed)
-{
-  Exclude e1;
-  BOOST_CHECK_THROW(e1.wireEncode(), Exclude::Error);
-
-  Exclude e2;
-
-  // top-level TLV-TYPE is not tlv::Exclude
-  const uint8_t NON_EXCLUDE[] = { 0x01, 0x02, 0x13, 0x00 };
-  BOOST_CHECK_THROW(e2.wireDecode(Block(NON_EXCLUDE, sizeof(NON_EXCLUDE))),
-                    tlv::Error);
-
-  // Exclude element is empty
-  const uint8_t EMPTY_EXCLUDE[] = { 0x10, 0x00 };
-  BOOST_CHECK_THROW(e2.wireDecode(Block(EMPTY_EXCLUDE, sizeof(EMPTY_EXCLUDE))),
-                    Exclude::Error);
-
-  // Exclude element contains unknown element
-  const uint8_t UNKNOWN_COMP1[] = { 0x10, 0x02, 0xAA, 0x00 };
-  BOOST_CHECK_THROW(e2.wireDecode(Block(UNKNOWN_COMP1, sizeof(UNKNOWN_COMP1))),
-                    Exclude::Error);
-
-  // Exclude element contains unknown element
-  const uint8_t UNKNOWN_COMP2[] = { 0x10, 0x05, 0x08, 0x01, 0x54, 0xAA, 0x00 };
-  BOOST_CHECK_THROW(e2.wireDecode(Block(UNKNOWN_COMP2, sizeof(UNKNOWN_COMP2))),
-                    Exclude::Error);
-
-  // // <Exclude><Any/></Exclude>
-  // const uint8_t ONLY_ANY[] = { 0x10, 0x02, 0x13, 0x00 };
-  // BOOST_CHECK_THROW(e2.wireDecode(Block(ONLY_ANY, sizeof(ONLY_ANY))),
-  //                   Exclude::Error);
-
-  // <Exclude><Any/><Any/></Exclude>
-  const uint8_t ANY_ANY[] = { 0x10, 0x04, 0x13, 0x00, 0x13, 0x00 };
-  BOOST_CHECK_THROW(e2.wireDecode(Block(ANY_ANY, sizeof(ANY_ANY))),
-                                  Exclude::Error);
-
-  // // <Exclude><Any/><GenericNameComponent>T</GenericNameComponent><Any/></Exclude>
-  // const uint8_t ANY_COMPONENT_ANY[] = { 0x10, 0x07, 0x13, 0x00, 0x08, 0x01, 0x54, 0x13, 0x00 };
-  // BOOST_CHECK_THROW(e2.wireDecode(Block(ANY_COMPONENT_ANY, sizeof(ANY_COMPONENT_ANY))),
-  //                   Exclude::Error);
-
-  uint8_t WIRE[] = {
-    0x10, 0x20, // Exclude
-          0x01, 0x1E, // ImplicitSha256DigestComponent with incorrect length
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd
-  };
-
-  BOOST_CHECK_THROW(Exclude().wireDecode(Block(WIRE, sizeof(WIRE))), Exclude::Error);
-}
-
-BOOST_AUTO_TEST_CASE(ImplicitSha256Digest)
-{
-  uint8_t WIRE[] = {
-    0x10, 0x22, // Exclude
-          0x01, 0x20, // ImplicitSha256DigestComponent
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
-                0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd
-  };
-
-  Block block(WIRE, sizeof(WIRE));
-
-  Exclude exclude;
-  BOOST_CHECK_NO_THROW(exclude.wireDecode(block));
-  BOOST_CHECK(exclude.wireEncode() == block);
-}
-
-BOOST_AUTO_TEST_CASE(EmptyComponent) // Bug #2660
-{
-  Exclude e1, e2;
-
-  e1.excludeOne(name::Component());
-  e2.excludeOne(name::Component(""));
-
-  BOOST_CHECK_EQUAL(e1, e2);
-  BOOST_CHECK_EQUAL(e1.toUri(), e2.toUri());
-  BOOST_CHECK(e1.wireEncode() == e2.wireEncode());
-
-  BOOST_CHECK_EQUAL("...", e1.toUri());
-
-  uint8_t WIRE[] {0x10, 0x02, 0x08, 0x00};
-  BOOST_CHECK_EQUAL_COLLECTIONS(e1.wireEncode().begin(), e1.wireEncode().end(),
-                                WIRE, WIRE + sizeof(WIRE));
-
-  Exclude e3(Block(WIRE, sizeof(WIRE)));
-  BOOST_CHECK_EQUAL(e1, e3);
-  BOOST_CHECK_EQUAL(e1.toUri(), e3.toUri());
-}
-
-BOOST_AUTO_TEST_SUITE_END() // WireCompare
-
-BOOST_AUTO_TEST_SUITE_END() // TestExclude
-
-} // namespace tests
-} // namespace ndn
diff --git a/tests/unit/interest.t.cpp b/tests/unit/interest.t.cpp
index 75aba88..ebbff4a 100644
--- a/tests/unit/interest.t.cpp
+++ b/tests/unit/interest.t.cpp
@@ -21,8 +21,6 @@
 
 #include "ndn-cxx/interest.hpp"
 #include "ndn-cxx/data.hpp"
-#include "ndn-cxx/security/digest-sha256.hpp"
-#include "ndn-cxx/security/signature-sha256-with-rsa.hpp"
 
 #include "tests/boost-test.hpp"
 #include "tests/make-interest-data.hpp"
@@ -55,7 +53,6 @@
   Interest i;
   BOOST_CHECK_EQUAL(i.hasWire(), false);
   BOOST_CHECK_EQUAL(i.getName(), "/");
-  BOOST_CHECK_EQUAL(i.hasSelectors(), false);
   BOOST_CHECK_EQUAL(i.getCanBePrefix(), true);
   BOOST_CHECK_EQUAL(i.getMustBeFresh(), false);
   BOOST_CHECK_EQUAL(i.getForwardingHint().empty(), true);
@@ -67,12 +64,7 @@
   BOOST_CHECK_EQUAL(i.isParametersDigestValid(), true);
 }
 
-BOOST_AUTO_TEST_CASE(DecodeNotInterest)
-{
-  BOOST_CHECK_THROW(Interest("4202CAFE"_block), tlv::Error);
-}
-
-BOOST_AUTO_TEST_SUITE(EncodeDecode02)
+BOOST_AUTO_TEST_SUITE(Encode)
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
@@ -83,149 +75,30 @@
                 0x08, 0x03, 0x6e, 0x64, 0x6e, // GenericNameComponent
                 0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // GenericNameComponent
           0x0a, 0x04, // Nonce
-                0x01, 0x00, 0x00, 0x00
+                0x01, 0x00, 0x00, 0x00,
   };
 
-  Interest i1("/local/ndn/prefix");
-  i1.setCanBePrefix(true);
+  Interest i1;
+  i1.setName("/local/ndn/prefix");
+  i1.setCanBePrefix(false);
   i1.setNonce(1);
+  BOOST_CHECK_EQUAL(i1.isParametersDigestValid(), true);
+
   Block wire1 = i1.wireEncode();
   BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
 
   Interest i2(wire1);
   BOOST_CHECK_EQUAL(i2.getName(), "/local/ndn/prefix");
-  BOOST_CHECK(i2.getSelectors().empty());
+  BOOST_CHECK_EQUAL(i2.getCanBePrefix(), false);
+  BOOST_CHECK_EQUAL(i2.getMustBeFresh(), false);
   BOOST_CHECK_EQUAL(i2.getForwardingHint().empty(), true);
   BOOST_CHECK_EQUAL(i2.getNonce(), 1);
   BOOST_CHECK_EQUAL(i2.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
   BOOST_CHECK(i2.getHopLimit() == nullopt);
   BOOST_CHECK_EQUAL(i2.hasApplicationParameters(), false);
-  BOOST_CHECK_EQUAL(i2.isParametersDigestValid(), true);
+  BOOST_CHECK_EQUAL(i2.getApplicationParameters().isValid(), false);
 }
 
-BOOST_AUTO_TEST_CASE(Full)
-{
-  const uint8_t WIRE[] = {
-    0x05, 0x31, // Interest
-          0x07, 0x14, // Name
-                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // GenericNameComponent
-                0x08, 0x03, 0x6e, 0x64, 0x6e, // GenericNameComponent
-                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // GenericNameComponent
-          0x09, 0x03, // Selectors
-                0x0d, 0x01, 0x01,  // MinSuffixComponents
-          0x0a, 0x04, // Nonce
-                0x01, 0x00, 0x00, 0x00,
-          0x0c, 0x02, // InterestLifetime
-                0x03, 0xe8,
-          0x1e, 0x0a, // ForwardingHint
-                0x1f, 0x08, // Delegation
-                      0x1e, 0x01, 0x01, // Preference=1
-                      0x07, 0x03, 0x08, 0x01, 0x41 // Name=/A
-  };
-
-  Interest i1;
-  i1.setName("/local/ndn/prefix");
-  i1.setCanBePrefix(true);
-  i1.setMinSuffixComponents(1);
-  i1.setNonce(1);
-  i1.setInterestLifetime(1000_ms);
-  i1.setForwardingHint({{1, "/A"}});
-  Block wire1 = i1.wireEncode();
-  BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
-
-  Interest i2(wire1);
-  BOOST_CHECK_EQUAL(i2.getName(), "/local/ndn/prefix");
-  BOOST_CHECK_EQUAL(i2.getMinSuffixComponents(), 1);
-  BOOST_CHECK_EQUAL(i2.getForwardingHint(), DelegationList({{1, "/A"}}));
-  BOOST_CHECK_EQUAL(i2.getNonce(), 1);
-  BOOST_CHECK_EQUAL(i2.getInterestLifetime(), 1000_ms);
-  BOOST_CHECK(i2.getHopLimit() == nullopt);
-  BOOST_CHECK_EQUAL(i2.hasApplicationParameters(), false);
-  BOOST_CHECK_EQUAL(i2.isParametersDigestValid(), true);
-}
-
-BOOST_AUTO_TEST_CASE(ParametersSha256DigestComponent)
-{
-  const uint8_t WIRE[] = {
-    0x05, 0x60, // Interest
-          0x07, 0x58, // Name
-                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // GenericNameComponent
-                0x08, 0x03, 0x6e, 0x64, 0x6e, // GenericNameComponent
-                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // GenericNameComponent
-                0x02, 0x20, // ParametersSha256DigestComponent
-                      0xff, 0x91, 0x00, 0xe0, 0x4e, 0xaa, 0xdc, 0xf3, 0x06, 0x74, 0xd9, 0x80,
-                      0x26, 0xa0, 0x51, 0xba, 0x25, 0xf5, 0x6b, 0x69, 0xbf, 0xa0, 0x26, 0xdc,
-                      0xcc, 0xd7, 0x2c, 0x6e, 0xa0, 0xf7, 0x31, 0x5a,
-                0x02, 0x20, // ParametersSha256DigestComponent
-                      0xff, 0x91, 0x00, 0xe0, 0x4e, 0xaa, 0xdc, 0xf3, 0x06, 0x74, 0xd9, 0x80,
-                      0x26, 0xa0, 0x51, 0xba, 0x25, 0xf5, 0x6b, 0x69, 0xbf, 0xa0, 0x26, 0xdc,
-                      0xcc, 0xd7, 0x2c, 0x6e, 0xa0, 0xf7, 0x31, 0x5a,
-          0x0a, 0x04, // Nonce
-                0x01, 0x00, 0x00, 0x00,
-  };
-
-  Interest i1("/I");
-  BOOST_CHECK_THROW(i1.wireDecode(Block(WIRE, sizeof(WIRE))), tlv::Error);
-
-  // i1 is still in a valid state
-  BOOST_CHECK_EQUAL(i1.getName(), "/I");
-  BOOST_CHECK_EQUAL(i1.isParametersDigestValid(), true);
-
-  Interest i2("/I/params-sha256=f16db273f40436a852063f864d5072b01ead53151f5a688ea1560492bebedd05");
-  i2.setCanBePrefix(true);
-  i2.setNonce(2);
-  BOOST_CHECK_EQUAL(i2.isParametersDigestValid(), false);
-  // encoding in v0.2 format does not validate the ParametersSha256DigestComponent
-  Block wire2 = i2.wireEncode();
-  BOOST_CHECK_EQUAL(wire2, "052D 0725(080149 "
-                           "0220F16DB273F40436A852063F864D5072B01EAD53151F5A688EA1560492BEBEDD05) "
-                           "0A0402000000"_block);
-
-  // decoding from v0.2 format does not validate the ParametersSha256DigestComponent
-  Interest i3(wire2);
-  BOOST_CHECK_EQUAL(i3.getName(), i2.getName());
-  BOOST_CHECK_EQUAL(i3.isParametersDigestValid(), false);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // EncodeDecode02
-
-BOOST_AUTO_TEST_SUITE(Encode03)
-
-// Enable after #4567
-//BOOST_AUTO_TEST_CASE(Basic)
-//{
-//  const uint8_t WIRE[] = {
-//    0x05, 0x1c, // Interest
-//          0x07, 0x14, // Name
-//                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // GenericNameComponent
-//                0x08, 0x03, 0x6e, 0x64, 0x6e, // GenericNameComponent
-//                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // GenericNameComponent
-//          0x0a, 0x04, // Nonce
-//                0x01, 0x00, 0x00, 0x00,
-//  };
-
-//  Interest i1;
-//  i1.setName("/local/ndn/prefix");
-//  i1.setCanBePrefix(false);
-//  i1.setNonce(1);
-//  BOOST_CHECK_EQUAL(i1.isParametersDigestValid(), true);
-
-//  Block wire1 = i1.wireEncode();
-//  BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
-
-//  Interest i2(wire1);
-//  BOOST_CHECK_EQUAL(i2.getName(), "/local/ndn/prefix");
-//  BOOST_CHECK_EQUAL(i2.getCanBePrefix(), false);
-//  BOOST_CHECK_EQUAL(i2.getMustBeFresh(), false);
-//  BOOST_CHECK_EQUAL(i2.getForwardingHint().empty(), true);
-//  BOOST_CHECK_EQUAL(i2.getNonce(), 1);
-//  BOOST_CHECK_EQUAL(i2.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
-//  BOOST_CHECK(i2.getHopLimit() == nullopt);
-//  BOOST_CHECK_EQUAL(i2.hasApplicationParameters(), false);
-//  BOOST_CHECK_EQUAL(i2.getApplicationParameters().isValid(), false);
-//  BOOST_CHECK_EQUAL(i2.getPublisherPublicKeyLocator().empty(), true);
-//}
-
 BOOST_AUTO_TEST_CASE(WithParameters)
 {
   const uint8_t WIRE[] = {
@@ -265,7 +138,6 @@
   BOOST_CHECK(i2.getHopLimit() == nullopt);
   BOOST_CHECK_EQUAL(i2.hasApplicationParameters(), true);
   BOOST_CHECK_EQUAL(i2.getApplicationParameters(), "2404C0C1C2C3"_block);
-  BOOST_CHECK_EQUAL(i2.getPublisherPublicKeyLocator().empty(), true);
 }
 
 BOOST_AUTO_TEST_CASE(Full)
@@ -307,8 +179,6 @@
   i1.setInterestLifetime(30369_ms);
   i1.setHopLimit(220);
   i1.setApplicationParameters("2404C0C1C2C3"_block);
-  i1.setMinSuffixComponents(1); // v0.2-only elements will not be encoded
-  i1.setExclude(Exclude().excludeAfter(name::Component("J"))); // v0.2-only elements will not be encoded
   BOOST_CHECK_EQUAL(i1.isParametersDigestValid(), true);
 
   Block wire1 = i1.wireEncode();
@@ -325,19 +195,16 @@
   BOOST_CHECK_EQUAL(i2.getInterestLifetime(), 30369_ms);
   BOOST_CHECK_EQUAL(*i2.getHopLimit(), 220);
   BOOST_CHECK_EQUAL(i2.getApplicationParameters(), "2404C0C1C2C3"_block);
-  BOOST_CHECK_EQUAL(i2.getMinSuffixComponents(), -1); // Default because minSuffixComponents was not encoded
-  BOOST_CHECK_EQUAL(i2.getExclude().empty(), true); // Exclude was not encoded
 }
 
-// Enable after #4567
-//BOOST_AUTO_TEST_CASE(MissingApplicationParameters)
-//{
-//  Interest i;
-//  i.setName(Name("/A").appendParametersSha256DigestPlaceholder());
-//  i.setCanBePrefix(false);
-//  BOOST_CHECK_EQUAL(i.isParametersDigestValid(), false);
-//  BOOST_CHECK_THROW(i.wireEncode(), tlv::Error);
-//}
+BOOST_AUTO_TEST_CASE(MissingApplicationParameters)
+{
+  Interest i;
+  i.setName(Name("/A").appendParametersSha256DigestPlaceholder());
+  i.setCanBePrefix(false);
+  BOOST_CHECK_EQUAL(i.isParametersDigestValid(), false);
+  BOOST_CHECK_THROW(i.wireEncode(), tlv::Error);
+}
 
 BOOST_AUTO_TEST_CASE(MissingParametersSha256DigestComponent)
 {
@@ -353,12 +220,12 @@
   BOOST_CHECK_THROW(i.wireEncode(), tlv::Error); // now the check fails while attempting to reencode
 }
 
-BOOST_AUTO_TEST_SUITE_END() // Encode03
+BOOST_AUTO_TEST_SUITE_END() // Encode
 
-class Decode03Fixture
+class DecodeFixture
 {
 protected:
-  Decode03Fixture()
+  DecodeFixture()
   {
     // initialize all elements to non-empty, to verify wireDecode clears them
     i.setName("/A");
@@ -366,7 +233,6 @@
     i.setNonce(0x03d645a8);
     i.setInterestLifetime(18554_ms);
     i.setHopLimit(64);
-    i.setPublisherPublicKeyLocator(Name("/K"));
     i.setApplicationParameters("2404A0A1A2A3"_block);
   }
 
@@ -374,7 +240,12 @@
   Interest i;
 };
 
-BOOST_FIXTURE_TEST_SUITE(Decode03, Decode03Fixture)
+BOOST_FIXTURE_TEST_SUITE(Decode, DecodeFixture)
+
+BOOST_AUTO_TEST_CASE(NotAnInterest)
+{
+  BOOST_CHECK_THROW(i.wireDecode("4202CAFE"_block), tlv::Error);
+}
 
 BOOST_AUTO_TEST_CASE(NameOnly)
 {
@@ -386,15 +257,14 @@
   BOOST_CHECK_EQUAL(i.hasNonce(), true); // a random nonce is generated
   BOOST_CHECK_EQUAL(i.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
   BOOST_CHECK(i.getHopLimit() == nullopt);
-  BOOST_CHECK_EQUAL(i.getPublisherPublicKeyLocator().empty(), true);
   BOOST_CHECK_EQUAL(i.hasApplicationParameters(), false);
   BOOST_CHECK_EQUAL(i.getApplicationParameters().isValid(), false);
 
   BOOST_CHECK(!i.hasWire()); // nonce generation resets wire encoding
 
-  // modify then re-encode as v0.2 format
+  // modify then re-encode
   i.setNonce(0x54657c95);
-  BOOST_CHECK_EQUAL(i.wireEncode(), "0510 0703(080149) 09030E0101 0A04957C6554"_block);
+  BOOST_CHECK_EQUAL(i.wireEncode(), "050B 0703(080149) 0A04957C6554"_block);
 }
 
 BOOST_AUTO_TEST_CASE(NameCanBePrefix)
@@ -430,7 +300,7 @@
   // encode without modification: retain original wire encoding
   BOOST_CHECK_EQUAL(i.wireEncode().value_size(), 49);
 
-  // modify then re-encode as v0.3 format: unrecognized elements are discarded
+  // modify then re-encode: unrecognized elements are discarded
   i.setName("/J");
   BOOST_CHECK_EQUAL(i.wireEncode(),
                     "0523 0703(08014A) "
@@ -458,8 +328,8 @@
   // encode without modification: retain original wire encoding
   BOOST_CHECK_EQUAL(i.wireEncode().value_size(), 91);
 
-  // modify then re-encode as v0.3 format: unrecognized elements
-  // after ApplicationParameters are preserved, the rest are discarded
+  // modify then re-encode: unrecognized elements after ApplicationParameters
+  //                        are preserved, the rest are discarded
   i.setName("/J");
   BOOST_CHECK_EQUAL(i.isParametersDigestValid(), true);
   BOOST_CHECK_EQUAL(i.wireEncode(),
@@ -598,9 +468,11 @@
 BOOST_AUTO_TEST_CASE(UnrecognizedCriticalElement)
 {
   BOOST_CHECK_THROW(i.wireDecode("0507 0703080149 FB00"_block), tlv::Error);
+  // v0.2 packet with Selectors
+  BOOST_CHECK_THROW(i.wireDecode("0507 0703080149 09030D0101 0A0401000000"_block), tlv::Error);
 }
 
-BOOST_AUTO_TEST_SUITE_END() // Decode03
+BOOST_AUTO_TEST_SUITE_END() // Decode
 
 BOOST_AUTO_TEST_CASE(MatchesData)
 {
@@ -691,10 +563,8 @@
   BOOST_CHECK_EQUAL(i.getCanBePrefix(), true);
   i.setCanBePrefix(false);
   BOOST_CHECK_EQUAL(i.getCanBePrefix(), false);
-  BOOST_CHECK_EQUAL(i.getSelectors().getMaxSuffixComponents(), 1);
   i.setCanBePrefix(true);
   BOOST_CHECK_EQUAL(i.getCanBePrefix(), true);
-  BOOST_CHECK_EQUAL(i.getSelectors().getMaxSuffixComponents(), -1);
 }
 
 BOOST_AUTO_TEST_CASE(SetMustBeFresh)
@@ -703,15 +573,13 @@
   BOOST_CHECK_EQUAL(i.getMustBeFresh(), false);
   i.setMustBeFresh(true);
   BOOST_CHECK_EQUAL(i.getMustBeFresh(), true);
-  BOOST_CHECK_EQUAL(i.getSelectors().getMustBeFresh(), true);
   i.setMustBeFresh(false);
   BOOST_CHECK_EQUAL(i.getMustBeFresh(), false);
-  BOOST_CHECK_EQUAL(i.getSelectors().getMustBeFresh(), false);
 }
 
 BOOST_AUTO_TEST_CASE(ModifyForwardingHint)
 {
-  Interest i;
+  Interest i("/I");
   i.setCanBePrefix(false);
   i.setForwardingHint({{1, "/A"}});
   i.wireEncode();
diff --git a/tests/unit/selectors.t.cpp b/tests/unit/selectors.t.cpp
deleted file mode 100644
index f64631c..0000000
--- a/tests/unit/selectors.t.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 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 "ndn-cxx/selectors.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace ndn {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(TestSelectors)
-
-BOOST_AUTO_TEST_CASE(DefaultConstructor)
-{
-  Selectors s;
-  BOOST_CHECK(s.empty());
-  BOOST_CHECK_EQUAL(s.getMinSuffixComponents(), -1);
-  BOOST_CHECK_EQUAL(s.getMaxSuffixComponents(), -1);
-  BOOST_CHECK(s.getPublisherPublicKeyLocator().empty());
-  BOOST_CHECK(s.getExclude().empty());
-  BOOST_CHECK_EQUAL(s.getChildSelector(), 0);
-  BOOST_CHECK_EQUAL(s.getMustBeFresh(), false);
-}
-
-BOOST_AUTO_TEST_CASE(EncodeDecodeEmpty)
-{
-  const uint8_t WIRE[] = {
-    0x09, 0x00 // Selectors
-  };
-
-  Selectors s1;
-  Block wire1 = s1.wireEncode();
-  BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
-
-  Selectors s2(wire1);
-  BOOST_CHECK(s2.empty());
-  BOOST_CHECK_EQUAL(s2.getMinSuffixComponents(), -1);
-  BOOST_CHECK_EQUAL(s2.getMaxSuffixComponents(), -1);
-  BOOST_CHECK(s2.getPublisherPublicKeyLocator().empty());
-  BOOST_CHECK(s2.getExclude().empty());
-  BOOST_CHECK_EQUAL(s2.getChildSelector(), 0);
-  BOOST_CHECK_EQUAL(s2.getMustBeFresh(), false);
-
-  BOOST_CHECK(s1 == s2);
-}
-
-BOOST_AUTO_TEST_CASE(EncodeDecodeFull)
-{
-  const uint8_t WIRE[] = {
-    0x09, 0x39, // Selectors
-          0x0d, 0x01, 0x02, // MinSuffixComponents
-          0x0e, 0x01, 0x06,  // MaxSuffixComponent
-          0x1c, 0x16, // KeyLocator
-                0x07, 0x14, // Name
-                      0x08, 0x04, 0x74, 0x65, 0x73, 0x74,
-                      0x08, 0x03, 0x6b, 0x65, 0x79,
-                      0x08, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
-          0x10, 0x14, // Exclude
-                0x08, 0x04, 0x61, 0x6c, 0x65, 0x78, // GenericNameComponent
-                0x08, 0x04, 0x78, 0x78, 0x78, 0x78, // GenericNameComponent
-                0x13, 0x00, // Any
-                0x08, 0x04, 0x79, 0x79, 0x79, 0x79, // GenericNameComponent
-          0x11, 0x01, 0x01, // ChildSelector
-          0x12, 0x00 // MustBeFresh
-  };
-
-  Selectors s1;
-  s1.setMinSuffixComponents(2);
-  s1.setMaxSuffixComponents(6);
-  s1.setPublisherPublicKeyLocator(KeyLocator("/test/key/locator"));
-  s1.setExclude(Exclude().excludeOne(name::Component("alex"))
-                .excludeRange(name::Component("xxxx"), name::Component("yyyy")));
-  s1.setChildSelector(1);
-  s1.setMustBeFresh(true);
-
-  Block wire1 = s1.wireEncode();
-  BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
-
-  Selectors s2(wire1);
-  BOOST_CHECK(!s2.empty());
-  BOOST_CHECK_EQUAL(s2.getMinSuffixComponents(), 2);
-  BOOST_CHECK_EQUAL(s2.getMaxSuffixComponents(), 6);
-  BOOST_CHECK_EQUAL(s2.getPublisherPublicKeyLocator().getType(), KeyLocator::KeyLocator_Name);
-  BOOST_CHECK_EQUAL(s2.getPublisherPublicKeyLocator().getName(), "ndn:/test/key/locator");
-  BOOST_CHECK_EQUAL(s2.getExclude().toUri(), "alex,xxxx,*,yyyy");
-  BOOST_CHECK_EQUAL(s2.getChildSelector(), 1);
-  BOOST_CHECK_EQUAL(s2.getMustBeFresh(), true);
-
-  BOOST_CHECK(s1 == s2);
-}
-
-BOOST_AUTO_TEST_CASE(SetChildSelector)
-{
-  Selectors s;
-  BOOST_CHECK_EQUAL(s.getChildSelector(), 0);
-  BOOST_CHECK_THROW(s.setChildSelector(-1), std::invalid_argument);
-  BOOST_CHECK_THROW(s.setChildSelector(2), std::invalid_argument);
-  s.setChildSelector(1);
-  BOOST_CHECK_EQUAL(s.getChildSelector(), 1);
-  s.setChildSelector(0);
-  BOOST_CHECK_EQUAL(s.getChildSelector(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(Equality)
-{
-  // Selectors ::= SELECTORS-TYPE TLV-LENGTH
-  //                 MinSuffixComponents?
-  //                 MaxSuffixComponents?
-  //                 PublisherPublicKeyLocator?
-  //                 Exclude?
-  //                 ChildSelector?
-  //                 MustBeFresh?
-
-  Selectors a;
-  Selectors b;
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // MinSuffixComponents
-  a.setMinSuffixComponents(1);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMinSuffixComponents(2);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMinSuffixComponents(1);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // MaxSuffixComponents
-  a.setMaxSuffixComponents(10);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMaxSuffixComponents(10);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // PublisherPublicKeyLocator
-  a.setPublisherPublicKeyLocator(KeyLocator("/key/Locator/name"));
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setPublisherPublicKeyLocator(KeyLocator("/key/Locator/name"));
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // Exclude
-  a.setExclude(Exclude().excludeOne(name::Component("exclude")));
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setExclude(Exclude().excludeOne(name::Component("exclude")));
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // ChildSelector
-  a.setChildSelector(1);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setChildSelector(1);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // MustBeFresh
-  a.setMustBeFresh(true);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMustBeFresh(true);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestSelectors
-
-} // namespace tests
-} // namespace ndn