cases_t cases = boost::assign::list_of
(CASE_S(QType::A, "127.0.0.1", "\x7F\x00\x00\x01",false))
// local nameserver
- (CASE_L(QType::NS, "ns.rec.test", "ns.rec.test.", "\x02ns\xc0\x11",true))
+ (CASE_L(QType::NS, "ns.rec.test", "ns.rec.test.", "\x02ns\xc0\x11",false))
// non-local nameserver
(CASE_S(QType::NS, "ns.example.com.", "\x02ns\x07""example\x03""com\x00",false))
// local alias
- (CASE_L(QType::CNAME, "name.rec.test", "name.rec.test.", "\x04name\xc0\x11",true))
+ (CASE_L(QType::CNAME, "name.rec.test", "name.rec.test.", "\x04name\xc0\x11",false))
// non-local alias
(CASE_S(QType::CNAME, "name.example.com.", "\x04name\x07""example\x03""com\x00",false))
// local names
(CASE_S(QType::TXT, "\"short text\"", "\x0ashort text",false))
(CASE_S(QType::TXT, "\"long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\" \"2222222222\"", "\xff""long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\x0a""2222222222",false))
- (CASE_L(QType::TXT, "\"long record test 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222\"", "\"long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\" \"2222222222\"", "\xff""long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\x0a""2222222222",true))
+ (CASE_L(QType::TXT, "\"long record test 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222\"", "\"long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\" \"2222222222\"", "\xff""long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\x0a""2222222222",false))
(CASE_L(QType::TXT, "\"\\195\\133LAND ISLANDS\"", "\"\\195\\133LAND ISLANDS\"", "\x0e\xc3\x85LAND ISLANDS", false))
(CASE_L(QType::TXT, "\"\xc3\x85LAND ISLANDS\"", "\"\\195\\133LAND ISLANDS\"", "\x0e\xc3\x85LAND ISLANDS", false))
- (CASE_L(QType::TXT, "nonbreakingtxt", "\"nonbreakingtxt\"", "\x0enonbreakingtxt",false))
+ (CASE_L(QType::TXT, "\"nonbreakingtxt\"", "\"nonbreakingtxt\"", "\x0enonbreakingtxt",false))
// local name
(CASE_S(QType::RP, "admin.rec.test. admin-info.rec.test.", "\x05""admin\x03rec\x04test\x00\x0a""admin-info\x03rec\x04test\x00",false))
// non-local name
rec = DNSRecordContent::mastermake(q.getCode(), 1, val.get<1>());
BOOST_CHECK_MESSAGE(rec != NULL, "mastermake( " << q.getCode() << ", 1, " << val.get<1>() << ") returned NULL");
if (rec == NULL) continue;
- // now verify the record (note that this will be same as *input* value (except for certain QTypes)
- REC_CHECK_EQUAL(rec->getZoneRepresentation(), val.get<2>());
+ // now verify the record (note that this will be same as *zone* value (except for certain QTypes)
+
+ switch(q.getCode()) {
+ case QType::NS:
+ case QType::PTR:
+ case QType::MX:
+ case QType::CNAME:
+ case QType::SOA:
+ case QType::TXT:
+ // check *input* value instead
+ REC_CHECK_EQUAL(rec->getZoneRepresentation(), val.get<1>());
+ break;
+ default:
+ REC_CHECK_EQUAL(rec->getZoneRepresentation(), val.get<2>());
+ }
recData = rec->serialize("rec.test");
} else {
boost::shared_ptr<DNSRecordContent> rec3 = DNSRecordContent::unserialize("rec.test",q.getCode(),(val.get<3>()));