From: Remi Gacogne Date: Wed, 29 Nov 2017 10:44:57 +0000 (+0100) Subject: Add a unit test for the label escape issue fixed in #6018 X-Git-Tag: dnsdist-1.3.0~161^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6018%2Fhead;p=thirdparty%2Fpdns.git Add a unit test for the label escape issue fixed in #6018 --- diff --git a/pdns/test-dnsname_cc.cc b/pdns/test-dnsname_cc.cc index 42c84018fe..ad4b6155b7 100644 --- a/pdns/test-dnsname_cc.cc +++ b/pdns/test-dnsname_cc.cc @@ -128,16 +128,18 @@ BOOST_AUTO_TEST_CASE(test_basic) { BOOST_CHECK_EQUAL(unset.toString(), "www.powerdns\\.com.com."); + DNSName rfc4343_2_1("~!.example."); DNSName rfc4343_2_2(R"(Donald\032E\.\032Eastlake\0323rd.example.)"); DNSName example("example."); + BOOST_CHECK(rfc4343_2_1.isPartOf(example)); BOOST_CHECK(rfc4343_2_2.isPartOf(example)); + BOOST_CHECK_EQUAL(rfc4343_2_1.toString(), "~!.example."); auto labels=rfc4343_2_2.getRawLabels(); BOOST_CHECK_EQUAL(*labels.begin(), "Donald E. Eastlake 3rd"); BOOST_CHECK_EQUAL(*labels.rbegin(), "example"); BOOST_CHECK_EQUAL(labels.size(), 2); - DNSName build; build.appendRawLabel("Donald E. Eastlake 3rd"); build.appendRawLabel("example");