src: Making use of DEPRECATED macro and updating library code not to use deprecated methods
Change-Id: Ibe17977e7fcbb759a26dbe1cfa3d472598e49bcc
diff --git a/tests/test-block.cpp b/tests/test-block.cpp
index a4183f9..49ce204 100644
--- a/tests/test-block.cpp
+++ b/tests/test-block.cpp
@@ -553,22 +553,23 @@
typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
ArrayStream stream(reinterpret_cast<const char*>(TEST_BUFFER), sizeof(TEST_BUFFER));
+
Block testBlock;
- BOOST_REQUIRE_NO_THROW(testBlock = Block(stream));
+ BOOST_REQUIRE_NO_THROW(testBlock = Block::fromStream(stream));
BOOST_CHECK_EQUAL(testBlock.type(), 0);
BOOST_CHECK_EQUAL(testBlock.size(), 3);
BOOST_CHECK_EQUAL(testBlock.value_size(), 1);
BOOST_CHECK_EQUAL(*testBlock.wire(), 0x00);
BOOST_CHECK_EQUAL(*testBlock.value(), 0xfa);
- BOOST_REQUIRE_NO_THROW(testBlock = Block(stream));
+ BOOST_REQUIRE_NO_THROW(testBlock = Block::fromStream(stream));
BOOST_CHECK_EQUAL(testBlock.type(), 1);
BOOST_CHECK_EQUAL(testBlock.size(), 3);
BOOST_CHECK_EQUAL(testBlock.value_size(), 1);
BOOST_CHECK_EQUAL(*testBlock.wire(), 0x01);
BOOST_CHECK_EQUAL(*testBlock.value(), 0xfb);
- BOOST_CHECK_THROW(testBlock = Block(stream), Tlv::Error);
+ BOOST_CHECK_THROW(Block::fromStream(stream), Tlv::Error);
}
BOOST_AUTO_TEST_CASE(Equality)
diff --git a/tests/test-interest.cpp b/tests/test-interest.cpp
index 54efad4..75a4fb7 100644
--- a/tests/test-interest.cpp
+++ b/tests/test-interest.cpp
@@ -245,7 +245,7 @@
boost::iostreams::stream<boost::iostreams::array_source> is(
reinterpret_cast<const char *>(Interest1), sizeof(Interest1));
- Block interestBlock(is);
+ Block interestBlock = Block::fromStream(is);
ndn::Interest i;
BOOST_REQUIRE_NO_THROW(i.wireDecode(interestBlock));
diff --git a/tests/util/test-regex.cpp b/tests/util/test-regex.cpp
index 44279cd..668f5a4 100644
--- a/tests/util/test-regex.cpp
+++ b/tests/util/test-regex.cpp
@@ -36,7 +36,7 @@
bool res = cm->match(Name("/a/b/"), 0, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
backRef = make_shared<RegexBackrefManager>();
cm = make_shared<RegexComponentMatcher>("a", backRef);
@@ -49,9 +49,9 @@
res = cm->match(Name("/ccc.cd/b/"), 0, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("ccc.cd"));
- BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toEscapedString(), string("ccc"));
- BOOST_CHECK_EQUAL(backRef->getBackref(1)->getMatchResult()[0].toEscapedString(), string("cd"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("ccc.cd"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toUri(), string("ccc"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(1)->getMatchResult()[0].toUri(), string("cd"));
}
BOOST_AUTO_TEST_CASE(ComponentSetMatcher)
@@ -62,7 +62,7 @@
bool res = cm->match(Name("/a/b/"), 0, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
res = cm->match(Name("/a/b/"), 1, 1);
BOOST_CHECK_EQUAL(res, false);
@@ -77,7 +77,7 @@
res = cm->match(Name("/a/b/d"), 1, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("b"));
res = cm->match(Name("/a/b/d"), 2, 1);
BOOST_CHECK_EQUAL(res, false);
@@ -88,7 +88,7 @@
res = cm->match(Name("/b/d"), 1, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("d"));
}
@@ -104,8 +104,8 @@
cm->match(Name("/a/b/c"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
@@ -118,8 +118,8 @@
res = cm->match(Name("/a/b/c"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
@@ -128,12 +128,12 @@
res = cm->match(Name("/a/b/c/d/e/f/"), 0, 6);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 6);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[4].toEscapedString(), string("e"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[5].toEscapedString(), string("f"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[4].toUri(), string("e"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[5].toUri(), string("f"));
@@ -142,12 +142,12 @@
res = cm->match(Name("/a/b/c/d/e/f/"), 0, 6);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 6);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[4].toEscapedString(), string("e"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[5].toEscapedString(), string("f"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[4].toUri(), string("e"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[5].toUri(), string("f"));
@@ -161,7 +161,7 @@
res = cm->match(Name("/a/b/c"), 0, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
cm = make_shared<RegexRepeatMatcher>("<a>?", backRef, 3);
res = cm->match(Name("/a/b/c"), 0, 2);
@@ -179,9 +179,9 @@
res = cm->match(Name("/a/b/a/d/"), 0, 3);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 3);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("a"));
res = cm->match(Name("/a/b/a/d/"), 0, 4);
BOOST_CHECK_EQUAL(res, false);
@@ -194,15 +194,15 @@
res = cm->match(Name("/a/b/a/d/e/"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
res = cm->match(Name("/a/b/a/d/e/"), 0, 3);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 3);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("a"));
res = cm->match(Name("/a/b/a/b/e/"), 0, 4);
BOOST_CHECK_EQUAL(res, false);
@@ -218,16 +218,16 @@
res = cm->match(Name("/a/b/a/d/e/"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
res = cm->match(Name("/a/b/a/b/e/"), 0, 4);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 4);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("b"));
res = cm->match(Name("/a/b/a/d/e/"), 0, 1);
BOOST_CHECK_EQUAL(res, false);
@@ -244,13 +244,13 @@
res = cm->match(Name("/a/b/a/b/e/"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
res = cm->match(Name("/a/b/a/d/e/"), 0, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
res = cm->match(Name("/a/b/a/d/e/"), 0, 0);
BOOST_CHECK_EQUAL(res, true);
@@ -267,8 +267,8 @@
bool res = cm->match(Name("/a/b/c"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
BOOST_CHECK_EQUAL(backRef->size(), 1);
backRef = make_shared<RegexBackrefManager>();
@@ -278,12 +278,12 @@
res = cm->match(Name("/a/b/c"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
BOOST_CHECK_EQUAL(backRef->size(), 2);
- BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(backRef->getBackref(1)->getMatchResult()[0].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(1)->getMatchResult()[0].toUri(), string("b"));
}
BOOST_AUTO_TEST_CASE(BackRefMatcherAdvanced)
@@ -294,10 +294,10 @@
bool res = cm->match(Name("/a/b/c"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
BOOST_CHECK_EQUAL(backRef->size(), 1);
- BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toUri(), string("b"));
}
BOOST_AUTO_TEST_CASE(BackRefMatcherAdvanced2)
@@ -308,13 +308,13 @@
bool res = cm->match(Name("/a/b/c"), 0, 3);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 3);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
BOOST_CHECK_EQUAL(backRef->size(), 2);
- BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(backRef->getBackref(1)->getMatchResult()[0].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(0)->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(backRef->getBackref(1)->getMatchResult()[0].toUri(), string("b"));
}
BOOST_AUTO_TEST_CASE(PatternListMatcher)
@@ -325,15 +325,15 @@
bool res = cm->match(Name("/a/b/c"), 0, 2);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 2);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
backRef = make_shared<RegexBackrefManager>();
cm = make_shared<RegexPatternListMatcher>("<>*<a>", backRef);
res = cm->match(Name("/a/b/c"), 0, 1);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 1);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
backRef = make_shared<RegexBackrefManager>();
cm = make_shared<RegexPatternListMatcher>("<>*<a>", backRef);
@@ -346,9 +346,9 @@
res = cm->match(Name("/a/b/c"), 0, 3);
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 3);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
}
@@ -359,28 +359,28 @@
bool res = cm->match(Name("/a/b/c/d"));
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 4);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
cm = make_shared<RegexTopMatcher>("<b><c><d>$");
res = cm->match(Name("/a/b/c/d"));
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 4);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
cm = make_shared<RegexTopMatcher>("^<a><b><c><d>$");
res = cm->match(Name("/a/b/c/d"));
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 4);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
res = cm->match(Name("/a/b/c/d/e"));
BOOST_CHECK_EQUAL(res, false);
@@ -390,20 +390,20 @@
res = cm->match(Name("/a/b/c/d"));
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 4);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
cm = make_shared<RegexTopMatcher>("<b><c>");
res = cm->match(Name("/a/b/c/d"));
BOOST_CHECK_EQUAL(res, true);
BOOST_CHECK_EQUAL(cm->getMatchResult().size(), 4);
- BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toEscapedString(), string("a"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toEscapedString(), string("b"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toEscapedString(), string("c"));
- BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toEscapedString(), string("d"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[0].toUri(), string("a"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[1].toUri(), string("b"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[2].toUri(), string("c"));
+ BOOST_CHECK_EQUAL(cm->getMatchResult()[3].toUri(), string("d"));
}
BOOST_AUTO_TEST_CASE(TopMatcherAdvanced)