From: Marcin Siodelski Date: Wed, 4 Dec 2013 18:37:11 +0000 (+0100) Subject: [3181] Reset the time stamp of the last sent release. X-Git-Tag: bind10-1.2.0beta1-release~178^2~4^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b25d9710abc79dd80179ea256793c1ac5556309a;p=thirdparty%2Fkea.git [3181] Reset the time stamp of the last sent release. --- diff --git a/tests/tools/perfdhcp/test_control.cc b/tests/tools/perfdhcp/test_control.cc index 3fc69ffc24..75adcd5275 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 8f5ed94505..c949ee75a4 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 0a0b843d0c..384ae4a847 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.