Let tests succeed even if nullopt is returned

This is the desire behavior when the network fails so we can't
just fail the test when this happens.
This commit is contained in:
Chris Thrasher 2022-09-12 13:04:57 -06:00 committed by Vittorio Romeo
parent 105ff68a6a
commit b94df9e0d8

View File

@ -72,9 +72,11 @@ TEST_CASE("sf::IpAddress class - [network]")
SUBCASE("getPublicAddress") SUBCASE("getPublicAddress")
{ {
const std::optional<sf::IpAddress> ipAddress = sf::IpAddress::getPublicAddress(sf::seconds(1)); const std::optional<sf::IpAddress> ipAddress = sf::IpAddress::getPublicAddress(sf::seconds(1));
REQUIRE(ipAddress.has_value()); if (ipAddress.has_value())
CHECK(ipAddress->toString() != "0.0.0.0"); {
CHECK(ipAddress->toInteger() != 0); CHECK(ipAddress->toString() != "0.0.0.0");
CHECK(ipAddress->toInteger() != 0);
}
} }
} }