throw std::range_error("Found an invalid label length in qname");
pos+=labellen;
}
+ if(d_storage.empty())
+ d_storage.append(1, (char)0); // we just parsed the root
if(consumed)
*consumed = pos - opos - offset;
if(qtype && pos + labellen + 2 <= end)
BOOST_CHECK(dn == DNSName("www.powerdns.com."));
}
+BOOST_AUTO_TEST_CASE(test_PacketParse) {
+ vector<unsigned char> packet;
+ reportBasicTypes();
+ DNSName root(".");
+ DNSPacketWriter dpw1(packet, DNSName("."), QType::AAAA);
+ DNSName p((char*)&packet[0], packet.size(), 12, false);
+ BOOST_CHECK_EQUAL(p, root);
+}
+
+
BOOST_AUTO_TEST_CASE(test_QuestionHash) {
vector<unsigned char> packet;
reportBasicTypes();