fd/ops: Support our sock class natively
Change-Id: Ib79331dc34a480594e44731457c69b2f6a73f96a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/fd/ops.cpp b/test/fd/ops.cpp
index 0a7638f..dde1788 100644
--- a/test/fd/ops.cpp
+++ b/test/fd/ops.cpp
@@ -22,6 +22,19 @@
EXPECT_EQ(0, static_cast<int>(f));
}
+TEST(Connect, Success)
+{
+ testing::StrictMock<FdMock> fd;
+ SockAddrBuf buf;
+ EXPECT_CALL(fd, connect(_)).WillOnce([&](std::span<const std::byte> addr) {
+ std::copy(addr.begin(), addr.end(), reinterpret_cast<std::byte*>(&buf));
+ buf.len = addr.size();
+ });
+ Sock6Addr addr(In6Addr{0xff}, 365, 0);
+ connect(fd, addr);
+ EXPECT_EQ(Sock6Addr::fromBuf(buf), addr);
+}
+
TEST(ReadExact, Success)
{
testing::StrictMock<FdMock> fd;