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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=034365e0e665689c2338add223365344c329e3d4;p=pdns 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 42c84018f..ad4b6155b 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");