39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
TEST(@"-[connectToHost:port:]",
R([client connectToHost: @"127.0.0.1" port: port]))
TEST(@"-[accept]", (accepted = [server accept]))
TEST(@"-[remoteAddress]",
[of_socket_address_ip_string(accepted.remoteAddress, NULL)
isEqual: @"127.0.0.1"])
TEST(@"-[writeString:]", [client writeString: @"Hello!"])
TEST(@"-[readIntoBuffer:length:]",
[accepted readIntoBuffer: buf length: 6] &&
!memcmp(buf, "Hello!", 6))
objc_autoreleasePoolPop(pool);
}
@end
|
|
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
TEST(@"-[connectToHost:port:]",
R([client connectToHost: @"127.0.0.1" port: port]))
TEST(@"-[accept]", (accepted = [server accept]))
TEST(@"-[remoteAddress]",
[OFSocketAddressString(accepted.remoteAddress)
isEqual: @"127.0.0.1"])
TEST(@"-[writeString:]", [client writeString: @"Hello!"])
TEST(@"-[readIntoBuffer:length:]",
[accepted readIntoBuffer: buf length: 6] &&
!memcmp(buf, "Hello!", 6))
objc_autoreleasePoolPop(pool);
}
@end
|