]> granicus.if.org Git - pdns/commitdiff
add some more unit tests for DNSName
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 30 Oct 2015 19:15:17 +0000 (20:15 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 30 Oct 2015 19:15:17 +0000 (20:15 +0100)
pdns/test-dnsname_cc.cc

index b0a5948ddb9582895b6bea0338cc6937803cdc0b..f0b640da2618845c9669121ee83d6e799aa96daf 100644 (file)
@@ -347,6 +347,11 @@ BOOST_AUTO_TEST_CASE(test_compare_canonical) {
   BOOST_CHECK(DNSName("BeRt.com").canonCompare(DNSName("WWW.berT.com")));
   BOOST_CHECK(!DNSName("www.BeRt.com").canonCompare(DNSName("WWW.berT.com")));
 
+  CanonDNSNameCompare a;
+  BOOST_CHECK(a(DNSName("."), DNSName("www.powerdns.com")));
+  BOOST_CHECK(a(DNSName("."), DNSName("www.powerdns.net")));
+  BOOST_CHECK(!a(DNSName("www.powerdns.net"), DNSName(".")));
+
   vector<DNSName> vec;
   for(const std::string& a : {"bert.com.", "alpha.nl.", "articles.xxx.",
        "Aleph1.powerdns.com.", "ZOMG.powerdns.com.", "aaa.XXX.", "yyy.XXX.",