[svn] commit: r2220 - in /branches/trac221/src/bin/auth: auth_srv.cc tests/auth_srv_unittest.cc tests/testdata/notifyin_fromwire
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jun 22 14:34:07 UTC 2010
Author: hanfeng
Date: Tue Jun 22 14:34:06 2010
New Revision: 2220
Log:
add unitest for notify
Added:
branches/trac221/src/bin/auth/tests/testdata/notifyin_fromwire
Modified:
branches/trac221/src/bin/auth/auth_srv.cc
branches/trac221/src/bin/auth/tests/auth_srv_unittest.cc
Modified: branches/trac221/src/bin/auth/auth_srv.cc
==============================================================================
--- branches/trac221/src/bin/auth/auth_srv.cc (original)
+++ branches/trac221/src/bin/auth/auth_srv.cc Tue Jun 22 14:34:06 2010
@@ -348,7 +348,7 @@
axfr_client_.sendXfroutRequestInfo(io_message.getSocket().getNative(),
io_message.getData(),
io_message.getDataSize());
- } catch (const XfroutError& err) { // XXX: avoid catch-all catch!!
+ } catch (const XfroutError& err) {
if (is_xfrin_connection_established_) {
axfr_client_.disconnect();
is_xfrin_connection_established_ = false;
Modified: branches/trac221/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- branches/trac221/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ branches/trac221/src/bin/auth/tests/auth_srv_unittest.cc Tue Jun 22 14:34:06 2010
@@ -128,7 +128,9 @@
TEST_F(AuthSrvTest, unsupportedRequest) {
for (unsigned int i = 1; i < 16; ++i) {
// set Opcode to 'i', which iterators over all possible codes except
- // the standard query (0)
+ // the standard query (0) and notify(4)
+ if (i == 4)
+ continue;
createDataFromFile("simplequery_fromWire");
data[2] = ((i << 3) & 0xff);
@@ -242,6 +244,17 @@
EXPECT_FALSE(parse_message.isDNSSECSupported());
}
+// notify-in teset.
+TEST_F(AuthSrvTest, notifyInTest) {
+ createDataFromFile("notifyin_fromwire");
+ parse_message.clear(Message::PARSE);
+ EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
+ response_renderer));
+ headerCheck(parse_message, default_qid, Rcode::NOERROR(), Opcode::NOTIFY().getCode(), QR_FLAG,
+ 1, 0, 0, 0);
+}
+
+
void
updateConfig(AuthSrv* server, const char* const dbfile,
const bool expect_success)
More information about the bind10-changes
mailing list