name-component: rename fromEscapedString() to fromUri()
Consistent with toUri()
Change-Id: Ia8ca75be9068b06840e2847f0128ffc7a4cd57af
diff --git a/tests/unit/interest.t.cpp b/tests/unit/interest.t.cpp
index c67bd0e..4c540b7 100644
--- a/tests/unit/interest.t.cpp
+++ b/tests/unit/interest.t.cpp
@@ -679,9 +679,8 @@
interest = makeInterest(data->getFullName());
BOOST_CHECK_EQUAL(interest->matchesData(*data), true);
- setNameComponent(*interest, -1,
- name::Component::fromEscapedString("sha256digest=00000000000000000000000000"
- "00000000000000000000000000000000000000"));
+ setNameComponent(*interest, -1, name::Component::fromUri("sha256digest=00000000000000000000000000"
+ "00000000000000000000000000000000000000"));
BOOST_CHECK_EQUAL(interest->matchesData(*data), false); // violates implicit digest
}
diff --git a/tests/unit/meta-info.t.cpp b/tests/unit/meta-info.t.cpp
index bd5aee4..f375607 100644
--- a/tests/unit/meta-info.t.cpp
+++ b/tests/unit/meta-info.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -69,7 +69,7 @@
BOOST_CHECK_EQUAL(a.getType(), tlv::ContentType_Blob);
BOOST_CHECK_EQUAL(a.getFreshnessPeriod(), 0_ms);
BOOST_REQUIRE(a.getFinalBlock().has_value());
- BOOST_CHECK_EQUAL(*a.getFinalBlock(), name::Component::fromEscapedString("221=A"));
+ BOOST_CHECK_EQUAL(*a.getFinalBlock(), name::Component::fromUri("221=A"));
BOOST_CHECK_NE(a.wireEncode(), b.wireEncode());
b.setType(a.getType());
diff --git a/tests/unit/name-component.t.cpp b/tests/unit/name-component.t.cpp
index 840bccd..cc38cf2 100644
--- a/tests/unit/name-component.t.cpp
+++ b/tests/unit/name-component.t.cpp
@@ -63,45 +63,46 @@
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), "8=ndn-cxx");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_ALTERNATE), "ndn-cxx");
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(comp), "ndn-cxx");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("ndn-cxx"), comp);
- BOOST_CHECK_EQUAL(Component::fromEscapedString("8=ndn-cxx"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("ndn-cxx"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("8=ndn-cxx"sv), comp);
comp.wireDecode("0800"_block);
BOOST_CHECK_EQUAL(comp.toUri(), "...");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("..."), comp);
- BOOST_CHECK_EQUAL(Component::fromEscapedString("8=..."), comp);
- BOOST_CHECK_EQUAL(Component::fromEscapedString(".%2E."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("..."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("8=..."sv), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri(".%2E."sv), comp);
comp.wireDecode("0801 2E"_block);
BOOST_CHECK_EQUAL(comp.toUri(), "....");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("...."), comp);
- BOOST_CHECK_EQUAL(Component::fromEscapedString("%2E..%2E"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("...."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("%2E..%2E"sv), comp);
comp.wireDecode("0803 2E412E"_block);
BOOST_CHECK_EQUAL(comp.toUri(), ".A.");
- BOOST_CHECK_EQUAL(Component::fromEscapedString(".A."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri(".A."sv), comp);
comp.wireDecode("0807 666F6F25626172"_block);
BOOST_CHECK_EQUAL(comp.toUri(), "foo%25bar");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("foo%25bar"), comp);
- BOOST_CHECK_EQUAL(Component::fromEscapedString("8=foo%25bar"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("foo%25bar"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("8=foo%25bar"sv), comp);
comp.wireDecode("0804 2D2E5F7E"_block);
BOOST_CHECK_EQUAL(comp.toUri(), "-._~");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("-._~"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("-._~"sv), comp);
comp.wireDecode("0803 393D41"_block);
BOOST_CHECK_EQUAL(comp.toUri(), "9%3DA");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("9%3DA"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("9%3DA"sv), comp);
comp = Component(":/?#[]@");
BOOST_CHECK_EQUAL(comp.toUri(), "%3A%2F%3F%23%5B%5D%40");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("%3A%2F%3F%23%5B%5D%40"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("%3A%2F%3F%23%5B%5D%40"sv), comp);
- BOOST_CHECK_THROW(Component::fromEscapedString(""), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("."), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString(".."), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("8="), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri(""), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri(""sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("."sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri(".."sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("8="sv), Component::Error);
}
static void
@@ -119,21 +120,21 @@
BOOST_CHECK_EQUAL(comp.type(), type);
BOOST_CHECK_EQUAL(comp.toUri(), uriPrefix + hexLower);
- BOOST_CHECK_EQUAL(comp.toUri(UriFormat::CANONICAL), to_string(type) + "=" + hexPctCanonical);
+ BOOST_CHECK_EQUAL(comp.toUri(UriFormat::CANONICAL), std::to_string(type) + "=" + hexPctCanonical);
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ALTERNATE), uriPrefix + hexLower);
- BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), to_string(type) + "=" + hexPctCanonical);
+ BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), std::to_string(type) + "=" + hexPctCanonical);
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_ALTERNATE), uriPrefix + hexLower);
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(comp), uriPrefix + hexLower);
- BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(uriPrefix + hexLower));
- BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(uriPrefix + hexUpper));
- BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(to_string(type) + "=" + hexPct));
- BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(to_string(type) + "=" + hexPctCanonical));
+ BOOST_CHECK_EQUAL(comp, Component::fromUri(uriPrefix + hexLower));
+ BOOST_CHECK_EQUAL(comp, Component::fromUri(uriPrefix + hexUpper));
+ BOOST_CHECK_EQUAL(comp, Component::fromUri(std::to_string(type) + "=" + hexPct));
+ BOOST_CHECK_EQUAL(comp, Component::fromUri(std::to_string(type) + "=" + hexPctCanonical));
CHECK_COMP_ERR(comp.wireDecode(Block(type, fromHex("A791806951F25C4D"))), "TLV-LENGTH must be 32");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix), "TLV-LENGTH must be 32");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "a791806951f25c4d"), "TLV-LENGTH must be 32");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "foo"), "invalid hex encoding");
- CHECK_COMP_ERR(Component::fromEscapedString(boost::to_upper_copy(uriPrefix) + hexLower), "Unknown TLV-TYPE");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix), "TLV-LENGTH must be 32");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "a791806951f25c4d"), "TLV-LENGTH must be 32");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "foo"), "invalid hex encoding");
+ CHECK_COMP_ERR(Component::fromUri(boost::to_upper_copy(uriPrefix) + hexLower), "Unknown TLV-TYPE");
}
BOOST_AUTO_TEST_CASE(ImplicitDigest)
@@ -154,32 +155,32 @@
BOOST_CHECK_EQUAL(comp.isNumber(), true);
const auto compUri = uriPrefix + "42";
BOOST_CHECK_EQUAL(comp.toUri(), compUri);
- BOOST_CHECK_EQUAL(comp.toUri(UriFormat::CANONICAL), to_string(type) + "=%2A");
+ BOOST_CHECK_EQUAL(comp.toUri(UriFormat::CANONICAL), std::to_string(type) + "=%2A");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ALTERNATE), compUri);
- BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), to_string(type) + "=%2A");
+ BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), std::to_string(type) + "=%2A");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_ALTERNATE), compUri);
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(comp), compUri);
- BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(compUri));
- BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(to_string(type) + "=%2A"));
+ BOOST_CHECK_EQUAL(comp, Component::fromUri(compUri));
+ BOOST_CHECK_EQUAL(comp, Component::fromUri(std::to_string(type) + "=%2A"));
BOOST_CHECK_EQUAL(comp, Component::fromNumber(42, type));
const Component comp2(type, fromHex("010203")); // TLV-VALUE is *not* a NonNegativeInteger
BOOST_CHECK_EQUAL(comp2.type(), type);
BOOST_CHECK_EQUAL(comp2.isNumber(), false);
- const auto comp2Uri = to_string(type) + "=%01%02%03";
+ const auto comp2Uri = std::to_string(type) + "=%01%02%03";
BOOST_CHECK_EQUAL(comp2.toUri(), comp2Uri);
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(comp2), comp2Uri);
- BOOST_CHECK_EQUAL(comp2, Component::fromEscapedString(comp2Uri));
+ BOOST_CHECK_EQUAL(comp2, Component::fromUri(comp2Uri));
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "foo"), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "00"), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "-1"), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "9.3"), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + " 84"), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "0xAF"), "invalid format");
- CHECK_COMP_ERR(Component::fromEscapedString(uriPrefix + "18446744073709551616"), "out of range");
- CHECK_COMP_ERR(Component::fromEscapedString(boost::to_upper_copy(uriPrefix) + "42"), "Unknown TLV-TYPE");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "foo"), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "00"), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "-1"), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "9.3"), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + " 84"), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "0xAF"), "invalid format");
+ CHECK_COMP_ERR(Component::fromUri(uriPrefix + "18446744073709551616"), "out of range");
+ CHECK_COMP_ERR(Component::fromUri(boost::to_upper_copy(uriPrefix) + "42"), "Unknown TLV-TYPE");
}
BOOST_AUTO_TEST_CASE(Segment)
@@ -217,17 +218,17 @@
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ALTERNATE), "32=ndn-cxx");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), "32=ndn-cxx");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_ALTERNATE), "32=ndn-cxx");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("32=ndn-cxx"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("32=ndn-cxx"sv), comp);
comp.wireDecode("2000"_block);
BOOST_CHECK_EQUAL(comp.type(), tlv::KeywordNameComponent);
BOOST_CHECK_EQUAL(comp.isKeyword(), true);
BOOST_CHECK_EQUAL(comp.toUri(), "32=...");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("32=..."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("32=..."sv), comp);
- BOOST_CHECK_THROW(Component::fromEscapedString("32="), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("32=."), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("32=.."), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("32="sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("32=."sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("32=.."sv), Component::Error);
}
BOOST_AUTO_TEST_CASE(OtherType)
@@ -239,21 +240,21 @@
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ALTERNATE), "9=ndn-cxx");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_CANONICAL), "9=ndn-cxx");
BOOST_CHECK_EQUAL(comp.toUri(UriFormat::ENV_OR_ALTERNATE), "9=ndn-cxx");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("9=ndn-cxx"), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("9=ndn-cxx"sv), comp);
comp.wireDecode("FDFFFF00"_block);
BOOST_CHECK_EQUAL(comp.type(), 0xFFFF);
BOOST_CHECK_EQUAL(comp.toUri(), "65535=...");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("65535=..."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("65535=..."sv), comp);
comp.wireDecode("FD576501 2E"_block);
BOOST_CHECK_EQUAL(comp.type(), 0x5765);
BOOST_CHECK_EQUAL(comp.toUri(), "22373=....");
- BOOST_CHECK_EQUAL(Component::fromEscapedString("22373=...."), comp);
+ BOOST_CHECK_EQUAL(Component::fromUri("22373=...."sv), comp);
- BOOST_CHECK_THROW(Component::fromEscapedString("3="), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("3=."), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("3=.."), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("3="sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("3=."sv), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("3=.."sv), Component::Error);
}
BOOST_AUTO_TEST_CASE(InvalidType)
@@ -262,21 +263,21 @@
BOOST_CHECK_THROW(comp.wireDecode(Block{}), Component::Error);
BOOST_CHECK_THROW(comp.wireDecode("FE0001000001 80"_block), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("0=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("65536=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("4294967296=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("-1=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("+=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("0x1=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("Z=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("09=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("0x3=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("+9=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString(" 9=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("9 =A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("9.0=A"), Component::Error);
- BOOST_CHECK_THROW(Component::fromEscapedString("9E0=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("0=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("65536=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("4294967296=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("-1=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("+=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("0x1=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("Z=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("09=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("0x3=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("+9=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri(" 9=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("9 =A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("9.0=A"), Component::Error);
+ BOOST_CHECK_THROW(Component::fromUri("9E0=A"), Component::Error);
}
BOOST_AUTO_TEST_SUITE_END() // Decode
diff --git a/tests/unit/name.t.cpp b/tests/unit/name.t.cpp
index a7fdf7a..f19a2f0 100644
--- a/tests/unit/name.t.cpp
+++ b/tests/unit/name.t.cpp
@@ -369,10 +369,10 @@
BOOST_TEST(number == 11676);
name.appendKeyword({0xab, 0xcd, 0xef});
- BOOST_TEST(name.at(-1) == Component::fromEscapedString("32=%AB%CD%EF"sv));
+ BOOST_TEST(name.at(-1) == Component::fromUri("32=%AB%CD%EF"sv));
name.appendKeyword("test-keyword");
- BOOST_TEST(name.at(-1) == Component::fromEscapedString("32=test-keyword"sv));
+ BOOST_TEST(name.at(-1) == Component::fromUri("32=test-keyword"sv));
}
BOOST_AUTO_TEST_CASE(EraseComponent)
diff --git a/tests/unit/prefix-announcement.t.cpp b/tests/unit/prefix-announcement.t.cpp
index a36f084..18cf581 100644
--- a/tests/unit/prefix-announcement.t.cpp
+++ b/tests/unit/prefix-announcement.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -100,7 +100,7 @@
// Name has no "32=PA" keyword
Data data1 = makePrefixAnnData();
- setNameComponent(data1, -3, name::Component::fromEscapedString("32=not-PA"));
+ setNameComponent(data1, -3, name::Component::fromUri("32=not-PA"));
BOOST_CHECK_EXCEPTION(PrefixAnnouncement{data1}, tlv::Error, [] (const auto& e) {
return e.what() == "Data is not a prefix announcement: wrong name structure"s;
});
diff --git a/tests/unit/security/key-chain.t.cpp b/tests/unit/security/key-chain.t.cpp
index 4fd91b4..69748b5 100644
--- a/tests/unit/security/key-chain.t.cpp
+++ b/tests/unit/security/key-chain.t.cpp
@@ -647,7 +647,7 @@
BOOST_AUTO_TEST_CASE(Options)
{
MakeCertificateOptions opts;
- opts.issuerId = name::Component::fromEscapedString("ISSUER");
+ opts.issuerId = name::Component::fromUri("ISSUER");
opts.version = 41218268;
opts.freshnessPeriod = 321_s;
opts.validity.emplace(time::fromIsoString("20060702T150405"),
diff --git a/tests/unit/security/pib/impl/key-impl.t.cpp b/tests/unit/security/pib/impl/key-impl.t.cpp
index 940974b..311cfe0 100644
--- a/tests/unit/security/pib/impl/key-impl.t.cpp
+++ b/tests/unit/security/pib/impl/key-impl.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -144,7 +144,7 @@
BOOST_AUTO_TEST_CASE(UnknownKeyType)
{
- Name keyName = security::constructKeyName(id1, name::Component::fromEscapedString("foo"));
+ Name keyName = security::constructKeyName(id1, name::Component::fromUri("foo"));
Buffer invalidKey{0x01, 0x02, 0x03, 0x04};
pibImpl->addKey(id1, keyName, invalidKey);
diff --git a/tests/unit/security/trust-anchor-container.t.cpp b/tests/unit/security/trust-anchor-container.t.cpp
index 879ef40..246ef1c 100644
--- a/tests/unit/security/trust-anchor-container.t.cpp
+++ b/tests/unit/security/trust-anchor-container.t.cpp
@@ -172,7 +172,7 @@
auto makeIdentity1Cert = [=] (const std::string& issuerId) {
auto key = identity1.getDefaultKey();
MakeCertificateOptions opts;
- opts.issuerId = name::Component::fromEscapedString(issuerId);
+ opts.issuerId = name::Component::fromUri(issuerId);
return m_keyChain.makeCertificate(key, signingByKey(key), opts);
};