Commit 9273dca3 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[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.
parent bc9c1208
......@@ -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 ******************************/
......
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment