types: Remove custom MacAddr type
The standard library has an ether_addr type that does the same job.
Change-Id: I98685b0b60dd07453ae2362adb33e0a7c9c3132c
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/test_neighbor.cpp b/test/test_neighbor.cpp
index a76a7d5..6491b9f 100644
--- a/test/test_neighbor.cpp
+++ b/test/test_neighbor.cpp
@@ -164,7 +164,7 @@
EXPECT_EQ(ifstr, neighbors[0].interface);
EXPECT_FALSE(neighbors[0].permanent);
EXPECT_TRUE(neighbors[0].mac);
- EXPECT_EQ(0, std::memcmp(&mac, neighbors[0].mac->data(), sizeof(mac)));
+ EXPECT_TRUE(equal(mac, *neighbors[0].mac));
EXPECT_TRUE(equal(addr, std::get<in6_addr>(neighbors[0].address)));
}
diff --git a/test/test_util.cpp b/test/test_util.cpp
index 3cf28e3..f49e631 100644
--- a/test/test_util.cpp
+++ b/test/test_util.cpp
@@ -28,40 +28,6 @@
}
};
-TEST_F(TestUtil, ToHex)
-{
- EXPECT_EQ('E', mac_address::internal::toHex(std::byte(0xfe)));
- EXPECT_EQ('A', mac_address::internal::toHex(std::byte(10)));
- EXPECT_EQ('4', mac_address::internal::toHex(std::byte(4)));
-}
-
-TEST_F(TestUtil, MacFromBuf)
-{
- std::string tooSmall(1, 'a');
- std::string tooLarge(24, 'a');
- std::string buf{'\x00', '\xde', '\xad', '\x00', '\xbe', '\xef'};
-
- MacAddr mac = mac_address::fromBuf(buf);
- EXPECT_EQ(0, memcmp(buf.data(), mac.data(), buf.size()));
-
- EXPECT_THROW(mac_address::fromBuf(tooSmall), std::runtime_error);
- EXPECT_THROW(mac_address::fromBuf(tooLarge), std::runtime_error);
-}
-
-TEST_F(TestUtil, MacToString)
-{
- MacAddr mac1{
- std::byte(0x00), std::byte(0xDE), std::byte(0xAD),
- std::byte(0x00), std::byte(0xBE), std::byte(0xEF),
- };
- EXPECT_EQ("00:DE:AD:00:BE:EF", mac_address::toString(mac1));
- MacAddr mac2{
- std::byte(0x70), std::byte(0xFF), std::byte(0x84),
- std::byte(0x09), std::byte(0x35), std::byte(0x09),
- };
- EXPECT_EQ("70:FF:84:09:35:09", mac_address::toString(mac2));
-}
-
TEST_F(TestUtil, AddrFromBuf)
{
std::string tooSmall(1, 'a');