util: specialize std::hash<> for ethernet::Address
Change-Id: Id1263b8716d242f36e563b9aebbd2bb695fd4e5b
diff --git a/tests/unit-tests/util/ethernet.cpp b/tests/unit-tests/util/ethernet.cpp
index 2077f5a..35c0dee 100644
--- a/tests/unit-tests/util/ethernet.cpp
+++ b/tests/unit-tests/util/ethernet.cpp
@@ -102,6 +102,13 @@
ethernet::Address());
}
+BOOST_AUTO_TEST_CASE(StdHash)
+{
+ // make sure we can use ethernet::Address as key type in std::unordered_map
+ std::hash<ethernet::Address> h;
+ BOOST_CHECK_NO_THROW(h(ethernet::getDefaultMulticastAddress()));
+}
+
BOOST_AUTO_TEST_SUITE_END()
} // namespace util