Commit 9e8b5ec4 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac813] anoter Message::toText() test: testing a message with EDNS

(not related to TSIG)
parent cca71e70
......@@ -681,10 +681,22 @@ TEST_F(MessageTest, toWireWithoutRcode) {
}
TEST_F(MessageTest, toText) {
// Check toText() output for a typical DNS response with records in
// all sections
ifstream ifs;
unittests::openTestData("message_toText1.txt", ifs);
factoryFromFile(message_parse, "message_toText1.wire");
unittests::matchTextData(ifs, message_parse.toText());
// Another example with EDNS. The expected data was slightly modified
// from the dig output (other than replacing tabs with a space): adding
// a newline after the "OPT PSEUDOSECTION". This is an intentional change
// in our version for better readability.
ifs.close();
message_parse.clear(Message::PARSE);
unittests::openTestData("message_toText2.txt", ifs);
factoryFromFile(message_parse, "message_toText2.wire");
unittests::matchTextData(ifs, message_parse.toText());
}
TEST_F(MessageTest, toTextWithoutOpcode) {
......
......@@ -7,7 +7,7 @@ BUILT_SOURCES += message_fromWire12.wire message_fromWire13.wire
BUILT_SOURCES += message_fromWire14.wire message_fromWire15.wire
BUILT_SOURCES += message_fromWire16.wire
BUILT_SOURCES += message_toWire2.wire message_toWire3.wire
BUILT_SOURCES += message_toText1.wire
BUILT_SOURCES += message_toText1.wire message_toText2.wire
BUILT_SOURCES += name_toWire5.wire name_toWire6.wire
BUILT_SOURCES += rdatafields1.wire rdatafields2.wire rdatafields3.wire
BUILT_SOURCES += rdatafields4.wire rdatafields5.wire rdatafields6.wire
......@@ -56,6 +56,7 @@ EXTRA_DIST += message_fromWire13.spec message_fromWire14.spec
EXTRA_DIST += message_fromWire15.spec message_fromWire16.spec
EXTRA_DIST += message_toWire1 message_toWire2.spec message_toWire3.spec
EXTRA_DIST += message_toText1.txt message_toText1.spec
EXTRA_DIST += message_toText2.txt message_toText2.spec
EXTRA_DIST += name_fromWire1 name_fromWire2 name_fromWire3_1 name_fromWire3_2
EXTRA_DIST += name_fromWire4 name_fromWire6 name_fromWire7 name_fromWire8
EXTRA_DIST += name_fromWire9 name_fromWire10 name_fromWire11 name_fromWire12
......
#
# A standard DNS message with EDNS (taken from an invokation of dig)
#
[custom]
sections: header:question:edns
[header]
id: 45981
qr: 1
rcode: refused
arcount: 1
[question]
[edns]
do: 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment