Skip to content

Commit f1e6ccc

Browse files
jcowgillChrisThrasher
authored andcommittedFeb 16, 2025··
Avoid doing a real name resolution in sfIpAddress_fromString test
On some PCs, resolving `invalid address` will perform a real name resolution using the network. This is slows down the test and risks the test failing if the resolution succeeds. Use `localhost` instead which shold return a known value, and add an invalid ip address test for good measure.
1 parent 82884b3 commit f1e6ccc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎test/Network/IpAddress.test.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ TEST_CASE("[Network] sfIpAddress")
2222
SECTION("sfIpAddress_fromString")
2323
{
2424
CHECK(sfIpAddress_toInteger(sfIpAddress_fromString("")) == 0);
25-
CHECK(sfIpAddress_toInteger(sfIpAddress_fromString("invalid address")) == 0);
25+
CHECK(sfIpAddress_toInteger(sfIpAddress_fromString("256.256.256.256")) == 0);
26+
CHECK(sfIpAddress_toInteger(sfIpAddress_fromString("localhost")) == 0x7F000001);
2627
CHECK(sfIpAddress_toInteger(sfIpAddress_fromString("192.168.0.1")) == 0xC0A80001);
2728
CHECK(sfIpAddress_toInteger(sfIpAddress_fromString("8.8.8.8")) == 0x08080808);
2829
}

0 commit comments

Comments
 (0)
Please sign in to comment.