From: bert hubert Date: Fri, 26 Aug 2016 15:04:53 +0000 (+0200) Subject: add a test that verifies (again) that SOA records get good compression of names withi... X-Git-Tag: dnsdist-1.1.0-beta2~166^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32e5beb785ae3bd8de2faf4ec4859b45770d72c6;p=thirdparty%2Fpdns.git add a test that verifies (again) that SOA records get good compression of names within themselves. Output easier to interpret than that from test-dnsrecords. --- diff --git a/pdns/test-dnsname_cc.cc b/pdns/test-dnsname_cc.cc index dd7388cc66..412b0211aa 100644 --- a/pdns/test-dnsname_cc.cc +++ b/pdns/test-dnsname_cc.cc @@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE(test_packetCompress) { vector packet; DNSPacketWriter dpw(packet, DNSName("www.ds9a.nl."), QType::AAAA); dpw.startRecord(DNSName("ds9a.nl"), QType::SOA); - SOARecordContent src("ns1.ds9a.nl admin.ds9a.nl 1 2 3 4 5"); + SOARecordContent src("ns1.powerdns.nl admin.powerdns.nl 1 2 3 4 5"); src.toPacket(dpw); AAAARecordContent aaaa("::1"); dpw.startRecord(DNSName("www.dS9A.nl"), QType::AAAA); @@ -269,7 +269,6 @@ BOOST_AUTO_TEST_CASE(test_packetCompress) { aaaa.toPacket(dpw); dpw.commit(); string str((const char*)&packet[0], (const char*)&packet[0] + packet.size()); - size_t pos = 0; int count=0; while((pos = str.find("ds9a", pos)) != string::npos) { @@ -277,6 +276,14 @@ BOOST_AUTO_TEST_CASE(test_packetCompress) { ++count; } BOOST_CHECK_EQUAL(count, 1); + pos = 0; + count=0; + while((pos = str.find("powerdns", pos)) != string::npos) { + ++pos; + ++count; + } + BOOST_CHECK_EQUAL(count, 1); + }