BIND 10 trac2187, updated. dfc79b64ed8fdf77c46ebea1e025e229b7497a60 [2187] Changes suggested in code review.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 26 14:48:54 UTC 2012
The branch, trac2187 has been updated
via dfc79b64ed8fdf77c46ebea1e025e229b7497a60 (commit)
from 64e40094a730e99da4b24bbe97cb346af7b8fbcd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dfc79b64ed8fdf77c46ebea1e025e229b7497a60
Author: Marcin Siodelski <marcin at isc.org>
Date: Wed Sep 26 16:45:19 2012 +0200
[2187] Changes suggested in code review.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/tests/iface_mgr_unittest.cc | 20 ++++++++++++++++++++
tests/tools/perfdhcp/test_control.cc | 4 ++--
2 files changed, 22 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc
index 9ca7899..2c7b86b 100644
--- a/src/lib/dhcp/tests/iface_mgr_unittest.cc
+++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc
@@ -439,6 +439,8 @@ TEST_F(IfaceMgrTest, sockets6) {
// removed code for binding socket twice to the same address/port
// as it caused problems on some platforms (e.g. Mac OS X)
+ // Close sockets here because the following tests will want to
+ // open sockets on the same ports.
ifacemgr->closeSockets();
// Use address that is not assigned to LOOPBACK iface.
@@ -453,6 +455,9 @@ TEST_F(IfaceMgrTest, sockets6) {
ifacemgr->openSocket("non_existing_interface", loAddr, 10548),
BadValue
);
+
+ // Do not call closeSockets() because it is called by IfaceMgr's
+ // virtual destructor.
}
TEST_F(IfaceMgrTest, socketsFromIface) {
@@ -476,6 +481,8 @@ TEST_F(IfaceMgrTest, socketsFromIface) {
EXPECT_GT(socket2, 0);
close(socket2);
+ // Close sockets here because the following tests will want to
+ // open sockets on the same ports.
ifacemgr->closeSockets();
// Use invalid interface name.
@@ -483,6 +490,9 @@ TEST_F(IfaceMgrTest, socketsFromIface) {
ifacemgr->openSocketFromIface("non_existing_interface", PORT1, AF_INET),
BadValue
);
+
+ // Do not call closeSockets() because it is called by IfaceMgr's
+ // virtual destructor.
}
@@ -507,6 +517,8 @@ TEST_F(IfaceMgrTest, socketsFromAddress) {
// socket descriptor must be positive integer
EXPECT_GT(socket2, 0);
+ // Close sockets here because the following tests will want to
+ // open sockets on the same ports.
ifacemgr->closeSockets();
// Use non-existing address.
@@ -514,6 +526,9 @@ TEST_F(IfaceMgrTest, socketsFromAddress) {
EXPECT_THROW(
ifacemgr->openSocketFromAddress(invalidAddr, PORT1), BadValue
);
+
+ // Do not call closeSockets() because it is called by IfaceMgr's
+ // virtual destructor.
}
TEST_F(IfaceMgrTest, socketsFromRemoteAddress) {
@@ -537,6 +552,8 @@ TEST_F(IfaceMgrTest, socketsFromRemoteAddress) {
);
EXPECT_GT(socket2, 0);
+ // Close sockets here because the following tests will want to
+ // open sockets on the same ports.
ifacemgr->closeSockets();
// The following test is currently disabled for OSes other than
@@ -552,6 +569,9 @@ TEST_F(IfaceMgrTest, socketsFromRemoteAddress) {
);
EXPECT_GT(socket3, 0);
#endif
+
+ // Do not call closeSockets() because it is called by IfaceMgr's
+ // virtual destructor.
}
// TODO: disabled due to other naming on various systems
diff --git a/tests/tools/perfdhcp/test_control.cc b/tests/tools/perfdhcp/test_control.cc
index 55a3c3c..7ab4f01 100644
--- a/tests/tools/perfdhcp/test_control.cc
+++ b/tests/tools/perfdhcp/test_control.cc
@@ -788,7 +788,7 @@ TestControl::receivePackets(const TestControlSocket& socket) {
try {
pkt4 = IfaceMgr::instance().receive4(timeout);
} catch (const Exception& e) {
- std::cout << "Failed to receive DHCPv4 packet: "
+ std::cerr << "Failed to receive DHCPv4 packet: "
<< e.what() << std::endl;
}
if (!pkt4) {
@@ -806,7 +806,7 @@ TestControl::receivePackets(const TestControlSocket& socket) {
try {
pkt6 = IfaceMgr::instance().receive6(timeout);
} catch (const Exception& e) {
- std::cout << "Failed to receive DHCPv6 packet: "
+ std::cerr << "Failed to receive DHCPv6 packet: "
<< e.what() << std::endl;
}
if (!pkt6) {
More information about the bind10-changes
mailing list