Provisional IPv6 support added.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33933 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-10-03 16:03:19 +00:00
parent bc796f4304
commit 6b8dc7ef6c
11 changed files with 369 additions and 361 deletions

View file

@ -11,25 +11,28 @@ int main()
NSHost *tmp;
current = [NSHost currentHost];
PASS(current != nil && [current isKindOfClass:[NSHost class]],
PASS(current != nil && [current isKindOfClass: [NSHost class]],
"NSHost understands +currentHost");
#if defined(GNUSTEP_BASE_LIBRARY)
localh = [NSHost localHost];
PASS(localh != nil && [localh isKindOfClass:[NSHost class]],
PASS(localh != nil && [localh isKindOfClass: [NSHost class]],
"NSHost understands +localHost");
#else
localh = current;
#endif
tmp = [NSHost hostWithName:[current name]];
PASS([tmp isEqualToHost:current], "NSHost understands +hostWithName:");
tmp = [NSHost hostWithName: @"::1"];
PASS([[tmp address] isEqual: @"::1"], "+hostWithName: works for IPV6 addr");
tmp = [NSHost hostWithName: [current name]];
PASS([tmp isEqualToHost: current], "NSHost understands +hostWithName:");
tmp = [NSHost hostWithAddress:[current address]];
PASS([tmp isEqualToHost:current], "NSHost understands +hostWithAddress:");
tmp = [NSHost hostWithAddress: [current address]];
PASS([tmp isEqualToHost: current], "NSHost understands +hostWithAddress:");
tmp = [NSHost hostWithName:@"127.0.0.1"];
PASS(tmp != nil && [tmp isEqualToHost:localh],
tmp = [NSHost hostWithName: @"127.0.0.1"];
PASS(tmp != nil && [tmp isEqualToHost: localh],
"NSHost understands [+hostWithName: 127.0.0.1]");
[arp release]; arp = nil;