interest: update ForwardingHint format
Recognize and encode ForwardingHint as a sequence of Names.
The previous format with Delegations is still accepted for decoding, but
Preference field is ignored and no sorting is performed.
Delegation and DelegationList classes have been deleted.
refs #5187
Change-Id: I6f6f94020657b65c3fccb501694416dda24b894b
diff --git a/tests/unit/encoding/block-helpers.t.cpp b/tests/unit/encoding/block-helpers.t.cpp
index 4b26109..2ca1e02 100644
--- a/tests/unit/encoding/block-helpers.t.cpp
+++ b/tests/unit/encoding/block-helpers.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -134,6 +134,21 @@
BOOST_CHECK_EQUAL(*b1.elements().begin(), name.wireEncode());
}
+BOOST_AUTO_TEST_CASE(NestedSequence)
+{
+ std::vector<Name> names;
+ names.emplace_back("/A");
+ names.emplace_back("/B");
+ Block b1 = makeNestedBlock(100, names.begin(), names.end());
+
+ BOOST_CHECK_EQUAL(b1.type(), 100);
+ b1.parse();
+ auto elements = b1.elements();
+ BOOST_REQUIRE_EQUAL(elements.size(), 2);
+ BOOST_CHECK_EQUAL(Name(elements[0]), names[0]);
+ BOOST_CHECK_EQUAL(Name(elements[1]), names[1]);
+}
+
BOOST_AUTO_TEST_SUITE_END() // TestBlockHelpers
BOOST_AUTO_TEST_SUITE_END() // Encoding