From 105ff68a6afe0eeeba05bcad48f045bac8cbc4dc Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 12 Sep 2022 13:01:33 -0600 Subject: [PATCH] Time out test for public IP address On poor network connections, the call to getPublicAddress may hang indefinitely. If it is to succeed, let's require that it succeed within a reasonable time frame to put an upper limit on how long this test takes to run. --- test/Network/IpAddress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Network/IpAddress.cpp b/test/Network/IpAddress.cpp index 92760b53..07b3d097 100644 --- a/test/Network/IpAddress.cpp +++ b/test/Network/IpAddress.cpp @@ -71,7 +71,7 @@ TEST_CASE("sf::IpAddress class - [network]") SUBCASE("getPublicAddress") { - const std::optional ipAddress = sf::IpAddress::getPublicAddress(); + const std::optional ipAddress = sf::IpAddress::getPublicAddress(sf::seconds(1)); REQUIRE(ipAddress.has_value()); CHECK(ipAddress->toString() != "0.0.0.0"); CHECK(ipAddress->toInteger() != 0);