BIND 10 master, updated. 4d4f66ce2ce4d26cf7f926ae689b058290cd1865 [master] Fixed libdhcpsrv unit tests that failed to compile under GTEST 1.5
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Apr 4 19:12:22 UTC 2014
The branch, master has been updated
via 4d4f66ce2ce4d26cf7f926ae689b058290cd1865 (commit)
from b3f795e7faf5cde5c864db15ed4ed79faea85b6a (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 4d4f66ce2ce4d26cf7f926ae689b058290cd1865
Author: Thomas Markwalder <tmark at isc.org>
Date: Fri Apr 4 15:09:37 2014 -0400
[master] Fixed libdhcpsrv unit tests that failed to compile under GTEST 1.5
Added output redirect operator "<<" to Lease class so new unit tests in
libdhcpsrv will compile under gtest 1.5.
Also fixed incorrect index into lease collection for same tests.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcpsrv/lease.cc | 6 ++++++
src/lib/dhcpsrv/lease.h | 9 +++++++++
.../dhcpsrv/tests/generic_lease_mgr_unittest.cc | 4 ++--
3 files changed, 17 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/lease.cc b/src/lib/dhcpsrv/lease.cc
index 159cda5..7553ab4 100644
--- a/src/lib/dhcpsrv/lease.cc
+++ b/src/lib/dhcpsrv/lease.cc
@@ -266,5 +266,11 @@ Lease6::operator==(const Lease6& other) const {
comments_ == other.comments_);
}
+std::ostream&
+operator<<(std::ostream& os, const Lease& lease) {
+ os << lease.toText();
+ return (os);
+}
+
} // namespace isc::dhcp
} // namespace isc
diff --git a/src/lib/dhcpsrv/lease.h b/src/lib/dhcpsrv/lease.h
index a8f4527..90e73d1 100644
--- a/src/lib/dhcpsrv/lease.h
+++ b/src/lib/dhcpsrv/lease.h
@@ -401,6 +401,15 @@ typedef boost::shared_ptr<const Lease6> ConstLease6Ptr;
/// @brief A collection of IPv6 leases.
typedef std::vector<Lease6Ptr> Lease6Collection;
+/// @brief Stream output operator.
+///
+/// Dumps the output of Lease::toText to the given stream.
+/// @param os output stream to which the output is
+/// @param lease reference to Lease object to dump
+/// @return a reference to the output stream paramater
+std::ostream&
+operator<<(std::ostream& os, const Lease& lease);
+
}; // end of isc::dhcp namespace
}; // end of isc namespace
diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
index 8dc2a78..f9cd3da 100644
--- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
@@ -1452,7 +1452,7 @@ GenericLeaseMgrTest::testRecreateLease4() {
++lease->valid_lft_;
lease->fqdn_fwd_ = !lease->fqdn_fwd_;
// Make sure that the lease has been really modified.
- ASSERT_NE(*lease, *leases[1]);
+ ASSERT_NE(*lease, *leases[0]);
// Add the updated lease.
EXPECT_TRUE(lmptr_->addLease(lease));
lmptr_->commit();
@@ -1492,7 +1492,7 @@ GenericLeaseMgrTest::testRecreateLease6() {
++lease->valid_lft_;
lease->fqdn_fwd_ = !lease->fqdn_fwd_;
// Make sure that the lease has been really modified.
- ASSERT_NE(*lease, *leases[1]);
+ ASSERT_NE(*lease, *leases[0]);
// Add the updated lease.
EXPECT_TRUE(lmptr_->addLease(lease));
lmptr_->commit();
More information about the bind10-changes
mailing list