BIND 10 master, updated. 9273dca334ac61f89578b1b318b794325ced97d6 [master] Corrected nc_trans_unittest.cc build failure

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 6 19:47:59 UTC 2013


The branch, master has been updated
       via  9273dca334ac61f89578b1b318b794325ced97d6 (commit)
      from  bc9c1208f3fdb1e0bedb850be56940048cf0b915 (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 9273dca334ac61f89578b1b318b794325ced97d6
Author: Thomas Markwalder <tmark at isc.org>
Date:   Fri Sep 6 15:45:18 2013 -0400

    [master] Corrected nc_trans_unittest.cc build failure
    
    Using EXPECT_EQ on class D2Dhcid failed under gtest 1.5
    due to lack of "<<" operator.  Adding it solves this problem.

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

Summary of changes:
 src/lib/dhcp_ddns/ncr_msg.cc             |    5 +++++
 src/lib/dhcp_ddns/ncr_msg.h              |    3 +++
 src/lib/dhcp_ddns/tests/ncr_unittests.cc |    8 ++++++++
 3 files changed, 16 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp_ddns/ncr_msg.cc b/src/lib/dhcp_ddns/ncr_msg.cc
index 3c7a18e..05cc5d2 100644
--- a/src/lib/dhcp_ddns/ncr_msg.cc
+++ b/src/lib/dhcp_ddns/ncr_msg.cc
@@ -111,6 +111,11 @@ D2Dhcid::fromDUID(const isc::dhcp::DUID& duid,
     bytes_.insert(bytes_.end(), secure.begin(), secure.end());
 }
 
+std::ostream&
+operator<<(std::ostream& os, const D2Dhcid& dhcid) {
+    os << dhcid.toStr();
+    return (os);
+}
 
 /**************************** NameChangeRequest ******************************/
 
diff --git a/src/lib/dhcp_ddns/ncr_msg.h b/src/lib/dhcp_ddns/ncr_msg.h
index 48cd9b1..8f01638 100644
--- a/src/lib/dhcp_ddns/ncr_msg.h
+++ b/src/lib/dhcp_ddns/ncr_msg.h
@@ -139,6 +139,9 @@ private:
     std::vector<uint8_t> bytes_;
 };
 
+std::ostream&
+operator<<(std::ostream& os, const D2Dhcid& dhcid);
+
 class NameChangeRequest;
 /// @brief Defines a pointer to a NameChangeRequest.
 typedef boost::shared_ptr<NameChangeRequest> NameChangeRequestPtr;
diff --git a/src/lib/dhcp_ddns/tests/ncr_unittests.cc b/src/lib/dhcp_ddns/tests/ncr_unittests.cc
index df1a50a..2b09de1 100644
--- a/src/lib/dhcp_ddns/tests/ncr_unittests.cc
+++ b/src/lib/dhcp_ddns/tests/ncr_unittests.cc
@@ -387,6 +387,14 @@ TEST(NameChangeRequestTest, dhcidFromMaxDUID) {
     EXPECT_EQ(dhcid_ref, dhcid.toStr());
 }
 
+// test operator<< on D2Dhcid
+TEST(NameChangeRequestTest, leftShiftOperation) {
+    const D2Dhcid dhcid("010203040A7F8E3D");
+
+    ostringstream oss;
+    oss << dhcid;
+    EXPECT_EQ(dhcid.toStr(), oss.str());
+}
 
 /// @brief Verifies the fundamentals of converting from and to JSON.
 /// It verifies that:



More information about the bind10-changes mailing list