Remove ServerSettings

This commit is contained in:
2025-04-19 14:11:50 +02:00
parent 47a2135093
commit 9582dbdc88
4 changed files with 28 additions and 32 deletions

View File

@@ -8,10 +8,10 @@
TEST(TcpServer, Accept) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
EXPECT_FALSE(server.next_client_available());
@@ -25,12 +25,12 @@ TEST(TcpServer, Accept) {
}
TEST(TcpServer, DataAvailable) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
EXPECT_FALSE(server.data_available());
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
auto conRes = client.connect({"localhost"}, 1234);
auto accRes = server.accept_next_client();
@@ -48,10 +48,10 @@ TEST(TcpServer, DataAvailable) {
}
TEST(TcpServer, GetClientIPAsString) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
auto conRes = client.connect({"localhost"}, 1234);
auto accRes = server.accept_next_client();
auto ipRes = server.get_client_ip_as_string();
@@ -61,7 +61,7 @@ TEST(TcpServer, GetClientIPAsString) {
}
TEST(TcpClient, Connect) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
/// Default connection status, i.e., before attempting connection
@@ -80,7 +80,7 @@ TEST(TcpClient, Connect) {
/// Connection status when connection is acknowledged
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
auto conRes2 = client.connect({"localhost"}, 1234);
@@ -98,12 +98,12 @@ TEST(TcpClient, Connect) {
}
TEST(TcpClient, Reconnect) {
tcp::NonBlockingServer server1{{.port = 1234}};
tcp::NonBlockingServer server2{{.port = 2345}};
tcp::NonBlockingServer server1;
tcp::NonBlockingServer server2;
tcp::NonBlockingClient client;
auto lisRes1 = server1.start_listening();
auto lisRes2 = server2.start_listening();
auto lisRes1 = server1.start_listening(1234);
auto lisRes2 = server2.start_listening(2345);
auto conRes1 = client.connect({"localhost"}, 1234);
@@ -119,12 +119,12 @@ TEST(TcpClient, Reconnect) {
}
TEST(TcpClient, DataAvailable) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
EXPECT_FALSE(client.data_available());
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
auto conRes = client.connect({"localhost"}, 1234);
auto accRes = server.accept_next_client();
@@ -145,10 +145,10 @@ TEST(TcpClient, DataAvailable) {
}
TEST(TcpClientServer, ClientSendServerReceive) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
auto conRes = client.connect({"localhost"}, 1234);
auto accRes = server.accept_next_client();
@@ -165,10 +165,10 @@ TEST(TcpClientServer, ClientSendServerReceive) {
}
TEST(TcpClientServer, ClientReceiveServerSend) {
tcp::NonBlockingServer server{{.port = 1234}};
tcp::NonBlockingServer server;
tcp::NonBlockingClient client;
auto lisRes = server.start_listening();
auto lisRes = server.start_listening(1234);
auto conRes = client.connect({"localhost"}, 1234);
auto accRes = server.accept_next_client();