diff --git a/tests/Engine/Network/IpAddress.cpp b/tests/Engine/Network/IpAddress.cpp index 8bb3e7d16..c87880d7b 100644 --- a/tests/Engine/Network/IpAddress.cpp +++ b/tests/Engine/Network/IpAddress.cpp @@ -40,7 +40,7 @@ SCENARIO("IpAddress", "[NETWORK][IPADDRESS]") Nz::IpAddress google(8, 8, 8, 8); THEN("Google (DNS) is 8.8.8.8") { - REQUIRE(Nz::IpAddress::ResolveAddress(google) == "google-public-dns-a.google.com"); + REQUIRE(Nz::IpAddress::ResolveAddress(google) == "google-public-dns-a.google.com"); } } } diff --git a/tests/Engine/Network/SocketPoller.cpp b/tests/Engine/Network/SocketPoller.cpp index 93012d3de..d44c5f65d 100644 --- a/tests/Engine/Network/SocketPoller.cpp +++ b/tests/Engine/Network/SocketPoller.cpp @@ -1,16 +1,19 @@ +#include +#include #include #include #include #include - -#include -#include +#include SCENARIO("SocketPoller", "[NETWORK][SOCKETPOLLER]") { GIVEN("A TcpServer and a TcpClient in a selector") { - Nz::UInt16 port = 25664; + std::random_device rd; + std::uniform_int_distribution dis(1025, 65535); + + Nz::UInt16 port = dis(rd); Nz::TcpServer server; server.EnableBlocking(false); diff --git a/tests/Engine/Network/TCP.cpp b/tests/Engine/Network/TCP.cpp index 549742fd7..4a61e0197 100644 --- a/tests/Engine/Network/TCP.cpp +++ b/tests/Engine/Network/TCP.cpp @@ -11,7 +11,10 @@ SCENARIO("TCP", "[NETWORK][TCP]") { GIVEN("Two TCP, one client, one server") { - Nz::UInt16 port = 26456; + std::random_device rd; + std::uniform_int_distribution dis(1025, 65535); + + Nz::UInt16 port = dis(rd); Nz::TcpServer server; server.EnableBlocking(false); diff --git a/tests/Engine/Network/UdpSocket.cpp b/tests/Engine/Network/UdpSocket.cpp index 34ce5a19e..00d793e7a 100644 --- a/tests/Engine/Network/UdpSocket.cpp +++ b/tests/Engine/Network/UdpSocket.cpp @@ -1,14 +1,17 @@ -#include -#include - #include +#include #include +#include +#include SCENARIO("UdpSocket", "[NETWORK][UDPSOCKET]") { GIVEN("Two UdpSocket, one client, one server") { - Nz::UInt16 port = 64256; + std::random_device rd; + std::uniform_int_distribution dis(1025, 65535); + + Nz::UInt16 port = dis(rd); Nz::UdpSocket server(Nz::NetProtocol_IPv4); REQUIRE(server.Bind(port) == Nz::SocketState_Bound); @@ -33,6 +36,7 @@ SCENARIO("UdpSocket", "[NETWORK][UDPSOCKET]") Nz::NetPacket resultPacket; Nz::IpAddress fromIp; REQUIRE(server.ReceivePacket(&resultPacket, &fromIp)); + Nz::Vector3f result; resultPacket >> result; REQUIRE(result == vector123);