BIND 10 trac3181, updated. b25d9710abc79dd80179ea256793c1ac5556309a [3181] Reset the time stamp of the last sent release.

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Dec 4 18:37:22 UTC 2013


The branch, trac3181 has been updated
       via  b25d9710abc79dd80179ea256793c1ac5556309a (commit)
      from  19a8a4ef198d0b435f8f525cf5eaf215716084ae (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 b25d9710abc79dd80179ea256793c1ac5556309a
Author: Marcin Siodelski <marcin at isc.org>
Date:   Wed Dec 4 19:37:11 2013 +0100

    [3181] Reset the time stamp of the last sent release.

-----------------------------------------------------------------------

Summary of changes:
 tests/tools/perfdhcp/test_control.cc               |    1 +
 tests/tools/perfdhcp/test_control.h                |    2 --
 .../tools/perfdhcp/tests/test_control_unittest.cc  |   25 ++++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/test_control.cc b/tests/tools/perfdhcp/test_control.cc
index 3fc69ff..75adcd5 100644
--- a/tests/tools/perfdhcp/test_control.cc
+++ b/tests/tools/perfdhcp/test_control.cc
@@ -1286,6 +1286,7 @@ TestControl::reset() {
     renew_due_ = send_due_;
     release_due_ = send_due_;
     last_renew_ = send_due_;
+    last_release_ = send_due_;
     transid_gen_.reset();
     // Actual generators will have to be set later on because we need to
     // get command line parameters first.
diff --git a/tests/tools/perfdhcp/test_control.h b/tests/tools/perfdhcp/test_control.h
index 8f5ed94..c949ee7 100644
--- a/tests/tools/perfdhcp/test_control.h
+++ b/tests/tools/perfdhcp/test_control.h
@@ -1087,8 +1087,6 @@ protected:
                                            ///< was attempted.
     boost::posix_time::ptime last_release_;///< Indicates when the last Release
                                            ///< was attempted.
-private:
-
     boost::posix_time::ptime last_report_; ///< Last intermediate report time.
 
     StatsMgr4Ptr stats_mgr4_;  ///< Statistics Manager 4.
diff --git a/tests/tools/perfdhcp/tests/test_control_unittest.cc b/tests/tools/perfdhcp/tests/test_control_unittest.cc
index 0a0b843..384ae4a 100644
--- a/tests/tools/perfdhcp/tests/test_control_unittest.cc
+++ b/tests/tools/perfdhcp/tests/test_control_unittest.cc
@@ -120,6 +120,7 @@ public:
     using TestControl::processReceivedPacket4;
     using TestControl::processReceivedPacket6;
     using TestControl::registerOptionFactories;
+    using TestControl::reset;
     using TestControl::sendDiscover4;
     using TestControl::sendPackets;
     using TestControl::sendMultipleMessages6;
@@ -129,10 +130,15 @@ public:
     using TestControl::setDefaults6;
     using TestControl::send_due_;
     using TestControl::last_sent_;
+    using TestControl::last_report_;
     using TestControl::renew_due_;
     using TestControl::release_due_;
     using TestControl::last_renew_;
     using TestControl::last_release_;
+    using TestControl::transid_gen_;
+    using TestControl::macaddr_gen_;
+    using TestControl::first_packet_serverid_;
+    using TestControl::interrupted_;
 
     NakedTestControl() : TestControl() {
         uint32_t clients_num = CommandOptions::instance().getClientsNum() == 0 ?
@@ -905,6 +911,25 @@ public:
 
 };
 
+// This test verifies that the class members are reset to expected values.
+TEST_F(TestControlTest, reset) {
+    NakedTestControl tc;
+    tc.reset();
+    EXPECT_FALSE(tc.send_due_.is_not_a_date_time());
+    EXPECT_FALSE(tc.last_sent_.is_not_a_date_time());
+    EXPECT_FALSE(tc.last_report_.is_not_a_date_time());
+    EXPECT_FALSE(tc.renew_due_.is_not_a_date_time());
+    EXPECT_FALSE(tc.release_due_.is_not_a_date_time());
+    EXPECT_FALSE(tc.last_renew_.is_not_a_date_time());
+    EXPECT_FALSE(tc.last_release_.is_not_a_date_time());
+    EXPECT_FALSE(tc.send_due_.is_not_a_date_time());
+    EXPECT_FALSE(tc.transid_gen_);
+    EXPECT_FALSE(tc.macaddr_gen_);
+    EXPECT_TRUE(tc.first_packet_serverid_.empty());
+    EXPECT_FALSE(tc.interrupted_);
+
+}
+
 TEST_F(TestControlTest, GenerateDuid) {
     // Simple command line that simulates one client only. Always the
     // same DUID will be generated.



More information about the bind10-changes mailing list