Commit 23f9a44a authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

added a test for multi questions


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1344 e5f2f494-b856-4b98-b285-d166d9295462
parent 5a47f687
......@@ -36,7 +36,7 @@ class AuthSrvTest : public ::testing::Test {
protected:
AuthSrvTest() : request_message(Message::RENDER),
parse_message(Message::PARSE), default_qid(0x1035),
qname("www.example.com"),
opcode(Opcode(Opcode::QUERY())), qname("www.example.com"),
qclass(RRClass::IN()), qtype(RRType::A()),
request_obuffer(0), request_renderer(request_obuffer),
response_obuffer(0), response_renderer(response_obuffer)
......@@ -45,6 +45,7 @@ protected:
Message request_message;
Message parse_message;
qid_t default_qid;
Opcode opcode;
Name qname;
RRClass qclass;
RRType qtype;
......@@ -112,4 +113,16 @@ TEST_F(AuthSrvTest, unsupportedRequest) {
0, 0, 0, 0);
}
}
// Multiple questions. Should result in FORMERR.
TEST_F(AuthSrvTest, multiQuestion) {
createDataFromFile("testdata/multiquestion_fromWire", data);
InputBuffer buffer(&data[0], data.size());
EXPECT_EQ(0, server.processMessage(buffer, parse_message,
response_renderer, true, false));
headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
QR_FLAG, 0, 0, 0, 0);
}
}
###
### This data file was auto-generated from multiquestion_fromWire.spec
###
# Header Section
# ID=4149 QR=Query Opcode=QUERY(0) Rcode=NOERROR(0)
1035 0000
# QDCNT=2, ANCNT=0, NSCNT=0, ARCNT=0
0002 0000 0000 0000
# Question Section
# QNAME=example.com. QTYPE=A(1) QCLASS=IN(1)
076578616d706c6503636f6d00 0001 0001
# Question Section
# QNAME=q2.example.com QTYPE=A(1) QCLASS=IN(1)
027132076578616d706c6503636f6d00 0001 0001
#
# A QUERY message with multiple questions.
#
[custom]
sections: header:question/0:question/1
[header]
qdcount: 2
[question/0]
# use default
[question/1]
name: q2.example.com
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