BIND 10 trac1959, updated. ad297b10887895eae9cb6e3c5e00e38f7d1f5fda [1959] A couple of minor changes to cover second part of the review.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Sep 4 09:12:44 UTC 2012
The branch, trac1959 has been updated
via ad297b10887895eae9cb6e3c5e00e38f7d1f5fda (commit)
from 6a3c2c618081b259a7eef9f747b1e6cc8aea4572 (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 ad297b10887895eae9cb6e3c5e00e38f7d1f5fda
Author: Marcin Siodelski <marcin at isc.org>
Date: Tue Sep 4 11:12:14 2012 +0200
[1959] A couple of minor changes to cover second part of the review.
-----------------------------------------------------------------------
Summary of changes:
tests/tools/perfdhcp/stats_mgr.h | 22 +++++++++++++++-----
tests/tools/perfdhcp/test_control.h | 8 +++++--
.../perfdhcp/tests/command_options_unittest.cc | 10 +++++++--
3 files changed, 31 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/stats_mgr.h b/tests/tools/perfdhcp/stats_mgr.h
index aae6934..a8dfa8b 100644
--- a/tests/tools/perfdhcp/stats_mgr.h
+++ b/tests/tools/perfdhcp/stats_mgr.h
@@ -214,15 +214,27 @@ public:
/// }
/// \endcode
typedef boost::multi_index_container<
+ // Container holds shared_ptr<Pkt4> or shared_ptr<Pkt6> objects.
boost::shared_ptr<T>,
+ // List container indexes.
boost::multi_index::indexed_by<
+ // Sequenced index provides the way to use this container
+ // in the same way as std::list.
boost::multi_index::sequenced<>,
+ // The other index keeps products of transaction id.
boost::multi_index::hashed_non_unique<
- boost::multi_index::global_fun<
- const boost::shared_ptr<T>&,
- uint32_t,
- &ExchangeStats::hashTransid
- >
+ // Specify hash function to get the product of
+ // transaction id. This product is obtained by calling
+ // hashTransid() function.
+ boost::multi_index::global_fun<
+ // Hashing function takes shared_ptr<Pkt4> or
+ // shared_ptr<Pkt6> as argument.
+ const boost::shared_ptr<T>&,
+ // ... and returns uint32 value.
+ uint32_t,
+ // ... and here is a reference to it.
+ &ExchangeStats::hashTransid
+ >
>
>
> PktList;
diff --git a/tests/tools/perfdhcp/test_control.h b/tests/tools/perfdhcp/test_control.h
index 36ee55a..5994006 100644
--- a/tests/tools/perfdhcp/test_control.h
+++ b/tests/tools/perfdhcp/test_control.h
@@ -108,7 +108,7 @@ public:
/// \brief Destriuctor of the socket wrapper class.
///
/// Destructor closes all open sockets on all interfaces.
- /// TODO: close only the socket being wrapped by this class.
+ /// \todo close only the socket being wrapped by this class.
~TestControlSocket();
/// \brief Return name of the interface where socket is bound to.
@@ -254,7 +254,9 @@ protected:
/// \brief Factory function to create IA_NA option.
///
/// This factory function creates DHCPv6 IA_NA option instance.
- /// \TODO: add support for IA Address options.
+ ///
+ /// \todo add support for IA Address options.
+ ///
/// \param u universe (V6 or V4).
/// \param type option-type.
/// \param buf option-buffer.
@@ -323,6 +325,8 @@ protected:
/// from the MAC address, this function uses \ref generateMacAddress
/// internally to randomize the DUID.
///
+ /// \todo add support for other types of DUID.
+ ///
/// \param randomized number of bytes randomized.
/// \throw isc::BadValue if \ref generateMacAddress throws.
/// \return vector representing DUID.
diff --git a/tests/tools/perfdhcp/tests/command_options_unittest.cc b/tests/tools/perfdhcp/tests/command_options_unittest.cc
index 01f0357..70cb77d 100644
--- a/tests/tools/perfdhcp/tests/command_options_unittest.cc
+++ b/tests/tools/perfdhcp/tests/command_options_unittest.cc
@@ -86,7 +86,10 @@ protected:
// DUID_LLT value, two octets of hardware type, 4 octets
// of time value and 6 octets of variable link layer (MAC)
// address.
- const int duid_llt_size = 14;
+ const int duid_llt_size = 14;
+ // DUID is not given from the command line but it is supposed
+ // to be initialized by the CommandOptions private method
+ // generateDuidTemplate().
std::vector<uint8_t> v2 = opt.getDuidTemplate();
ASSERT_EQ(duid_llt_size, opt.getDuidTemplate().size());
EXPECT_TRUE(std::equal(v2.begin(), v2.begin() + 4,
@@ -548,6 +551,9 @@ TEST_F(CommandOptionsTest, Interface) {
// In order to make this test portable we need to know
// at least one interface name on OS where test is run.
// Interface Manager has ability to detect interfaces.
+ // Altough we don't call initIsInterface explicitely
+ // here it is called by CommandOptions object interally
+ // so this function is covered by the test.
dhcp::IfaceMgr& iface_mgr = dhcp::IfaceMgr::instance();
const dhcp::IfaceMgr::IfaceCollection& ifaces = iface_mgr.getIfaces();
std::string iface_name;
@@ -568,7 +574,7 @@ TEST_F(CommandOptionsTest, Interface) {
// exception is expected to be thrown.
EXPECT_THROW(process("perfdhcp -4"), isc::InvalidParameter);
}
-}
+}
TEST_F(CommandOptionsTest, Server) {
CommandOptions& opt = CommandOptions::instance();
More information about the bind10-changes
mailing list