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.
This commit is contained in:
parent
e294090c8e
commit
105ff68a6a
@ -71,7 +71,7 @@ TEST_CASE("sf::IpAddress class - [network]")
|
||||
|
||||
SUBCASE("getPublicAddress")
|
||||
{
|
||||
const std::optional<sf::IpAddress> ipAddress = sf::IpAddress::getPublicAddress();
|
||||
const std::optional<sf::IpAddress> ipAddress = sf::IpAddress::getPublicAddress(sf::seconds(1));
|
||||
REQUIRE(ipAddress.has_value());
|
||||
CHECK(ipAddress->toString() != "0.0.0.0");
|
||||
CHECK(ipAddress->toInteger() != 0);
|
||||
|
Loading…
Reference in New Issue
Block a user