EXPECT_EQ((URI{"connect", ip, socket->GetRemotePortNumber(), "/"}),
URI::Parse(uri).getValue());
}
-
- void TestConnect(std::string ip, std::string path) {
- std::unique_ptr<TCPSocket> socket_a_up;
- std::unique_ptr<TCPSocket> socket_b_up;
- CreateTCPConnectedSockets(ip, &socket_a_up, &socket_b_up);
- auto *socket = socket_a_up.release();
- ConnectionFileDescriptor connection_file_descriptor(socket);
- connection_file_descriptor.Connect(path, nullptr);
- }
};
TEST_F(ConnectionFileDescriptorTest, TCPGetURIv4) {
return;
TestGetURI("::1");
}
-
-TEST_F(ConnectionFileDescriptorTest, Connectv4) {
- if (!HostSupportsIPv4())
- return;
- TestConnect("127.0.0.1", "accept://127.0.0.1");
-}
-
-TEST_F(ConnectionFileDescriptorTest, Connectv6) {
- if (!HostSupportsIPv6())
- return;
- TestConnect("::1", "accept://::1");
-}