update ForwardingHint format
refs #5187
Change-Id: Ib42cfca32933b63da2683d129293f92186bbb637
diff --git a/tests/unit/clients/iterative-query-controller.t.cpp b/tests/unit/clients/iterative-query-controller.t.cpp
index 6478156..f8bb7db 100644
--- a/tests/unit/clients/iterative-query-controller.t.cpp
+++ b/tests/unit/clients/iterative-query-controller.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -126,7 +126,9 @@
if (i > 0) {
BOOST_CHECK_EQUAL(!interestRx[i].getForwardingHint().empty(), true);
if (!interestRx[i].getForwardingHint().empty()) {
- BOOST_CHECK_EQUAL(interestRx[i].getForwardingHint(), m_links[i - 1].getDelegationList());
+ BOOST_CHECK_EQUAL_COLLECTIONS(
+ interestRx[i].getForwardingHint().begin(), interestRx[i].getForwardingHint().end(),
+ m_links[i - 1].getDelegationList().begin(), m_links[i - 1].getDelegationList().end());
}
}
}
diff --git a/tests/unit/clients/query.t.cpp b/tests/unit/clients/query.t.cpp
index e4da482..944bcb0 100644
--- a/tests/unit/clients/query.t.cpp
+++ b/tests/unit/clients/query.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -48,16 +48,20 @@
auto link = make_shared<Link>("/ndn/link/NDNS/test/NS");
for (int i = 1; i <= 5; i++) {
- link->addDelegation(i, std::string("/link/") + to_string(i));
+ link->addDelegation(std::string("/link/") + to_string(i));
}
// link has to be signed first, then wireDecode
m_keyChain.sign(*link, security::signingByIdentity(certIdentity));
- q.setDelegationListFromLink(*link);
- BOOST_CHECK_EQUAL(q.getDelegationList(), link->getDelegationList());
+ q.setForwardingHintFromLink(*link);
+ BOOST_CHECK_EQUAL_COLLECTIONS(
+ q.getForwardingHint().begin(), q.getForwardingHint().end(),
+ link->getDelegationList().begin(), link->getDelegationList().end());
Interest interest = q.toInterest();
- BOOST_CHECK_EQUAL(interest.getForwardingHint(), link->getDelegationList());
+ BOOST_CHECK_EQUAL_COLLECTIONS(
+ interest.getForwardingHint().begin(), interest.getForwardingHint().end(),
+ link->getDelegationList().begin(), link->getDelegationList().end());
ndns::Query q2(zone, qType);
BOOST_CHECK_EQUAL(q2.fromInterest(zone, interest), true);
diff --git a/tests/unit/daemon/rrset-factory.t.cpp b/tests/unit/daemon/rrset-factory.t.cpp
index f97f433..5314dad 100644
--- a/tests/unit/daemon/rrset-factory.t.cpp
+++ b/tests/unit/daemon/rrset-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -106,14 +106,13 @@
RrsetFactory rf(TEST_DATABASE2, m_zoneName, m_keyChain, m_certName);
// rf without checkZoneKey: throw.
- ndn::DelegationList delegations;
+ std::vector<Name> delegations;
BOOST_CHECK_THROW(rf.generateNsRrset(label, version, ttl, delegations),
ndns::RrsetFactory::Error);
rf.checkZoneKey();
for (int i = 1; i <= 4; i++) {
- Name name("/delegation/" + std::to_string(i));
- delegations.insert(i, name);
+ delegations.emplace_back("/delegation/" + std::to_string(i));
}
Rrset rrset = rf.generateNsRrset(label, version, ttl, delegations);
@@ -132,7 +131,9 @@
BOOST_CHECK_EQUAL(link.getName(), linkName);
BOOST_CHECK_EQUAL(link.getContentType(), NDNS_LINK);
- BOOST_CHECK(link.getDelegationList() == delegations);
+ BOOST_CHECK_EQUAL_COLLECTIONS(
+ link.getDelegationList().begin(), link.getDelegationList().end(),
+ delegations.begin(), delegations.end());
BOOST_CHECK(security::verifySignature(link, m_cert));
}
diff --git a/tests/unit/database-test-data.cpp b/tests/unit/database-test-data.cpp
index d4808d6..3ec18ae 100644
--- a/tests/unit/database-test-data.cpp
+++ b/tests/unit/database-test-data.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -136,9 +136,7 @@
m_keyChain, m_certName);
rf.onlyCheckZone();
if (type == label::NS_RR_TYPE) {
- DelegationList ds;
- ds.insert(1, "xx");
- rrset = rf.generateNsRrset(label, version.toVersion(), ttl, ds);
+ rrset = rf.generateNsRrset(label, version.toVersion(), ttl, {"/xx"});
if (contentType != NDNS_AUTH) {
// do not add AUTH packet to link
m_links.push_back(Link(rrset.getData()));
diff --git a/tests/unit/mgmt/management-tool.t.cpp b/tests/unit/mgmt/management-tool.t.cpp
index 054a8cf..6a3d535 100644
--- a/tests/unit/mgmt/management-tool.t.cpp
+++ b/tests/unit/mgmt/management-tool.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -631,7 +631,7 @@
RrsetFactory rf(TEST_DATABASE, zoneName, m_keyChain, DEFAULT_CERT);
rf.checkZoneKey();
- Rrset rrset1 = rf.generateNsRrset("/l1", 7654, ttl2, DelegationList());
+ Rrset rrset1 = rf.generateNsRrset("/l1", 7654, ttl2, {});
BOOST_CHECK_NO_THROW(m_tool.addRrset(rrset1));
Rrset rrset2 = findRrSet(zone, "/l1", label::NS_RR_TYPE);
@@ -661,7 +661,7 @@
Name labelName("/l1/l2/l3");
- Rrset rrset1 = rf.generateNsRrset(labelName, 7654, ttl, DelegationList());
+ Rrset rrset1 = rf.generateNsRrset(labelName, 7654, ttl, {});
//add NS NDNS_AUTH and check user-defined ttl
BOOST_CHECK_NO_THROW(m_tool.addMultiLevelLabelRrset(rrset1, rf, ttl));
@@ -682,12 +682,12 @@
checkRrset("/l1/l2/l3", label::NS_RR_TYPE, ndns::NDNS_LINK);
// insert a shorter NS, when there are longer NS or TXT
- Rrset shorterNs = rf.generateNsRrset("/l1/l2", 7654, ttl, DelegationList());
+ Rrset shorterNs = rf.generateNsRrset("/l1/l2", 7654, ttl, {});
BOOST_CHECK_THROW(m_tool.addMultiLevelLabelRrset(shorterNs, rf, ttl),
ndns::ManagementTool::Error);
// insert a longer NS, when there is already a shorter NS
- Rrset longerNs = rf.generateNsRrset("/l1/l2/l3/l4", 7654, ttl, DelegationList());
+ Rrset longerNs = rf.generateNsRrset("/l1/l2/l3/l4", 7654, ttl, {});
BOOST_CHECK_THROW(m_tool.addMultiLevelLabelRrset(longerNs, rf, ttl),
ndns::ManagementTool::Error);
@@ -697,7 +697,7 @@
// insert a smaller NS, when there is long TXT
Rrset longTxt = rf.generateTxtRrset("/k1/k2/k3", 7654, ttl, std::vector<std::string>());
- Rrset smallerNs = rf.generateNsRrset("/k1/k2", 7654, ttl, DelegationList());
+ Rrset smallerNs = rf.generateNsRrset("/k1/k2", 7654, ttl, {});
BOOST_CHECK_NO_THROW(m_tool.addMultiLevelLabelRrset(longTxt, rf, ttl));
BOOST_CHECK_THROW(m_tool.addMultiLevelLabelRrset(smallerNs, rf, ttl),
ndns::ManagementTool::Error);