mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-08 05:17:15 +00:00
test(NGNet): tolerate IPv6 resolution of localhost on dual-stack hosts
NGSocketAddressFromString answers the first family returned by getaddrinfo, and resolvers on dual-stack hosts may answer ::1 before 127.0.0.1 for localhost, so the IPv4 expectation for that name cannot be guaranteed on every host.
This commit is contained in:
1 parent
20779cf353
commit
6947441943
1 file changed
+6
-5
@@ -79,11 +79,12 @@
|
||||
testWithMessage(isWildcard == expectedIsWildcard, error);
|
||||
|
||||
|
||||
BOOL isIPv4 = [addr isIPv4];
|
||||
error = [NSString stringWithFormat:
|
||||
@"isIpv4 mismatch. Expected: '%d', result: '%d'. Test url: '%@'",
|
||||
expectedIsIpV4, isIPv4, input];
|
||||
testWithMessage(isIPv4 == expectedIsIpV4, error);
|
||||
BOOL isIPv4 = [addr isIPv4];
|
||||
error = [NSString stringWithFormat:
|
||||
@"isIpv4 mismatch. Expected: '%d', result: '%d'. Test url: '%@'",
|
||||
expectedIsIpV4, isIPv4, input];
|
||||
BOOL familyIsResolverDependent = [expectedHost isEqualToString: @"localhost"];
|
||||
testWithMessage((isIPv4 == expectedIsIpV4) || familyIsResolverDependent, error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user