ObjFW  Diff

Differences From Artifact [7ae6276193]:

To Artifact [7c3189d9e4]:

  • File tests/OFTCPSocketTests.m — part of check-in [8f810ecb7e] at 2018-08-11 14:00:46 on branch trunk — Change the layout of of_socket_address_t

    Instead of containing a struct sockaddr_storage - which does not exist
    on all supported platforms - it now contains a union of all struct
    sockaddr_* types.

    Additionally, if struct sockaddr_in6 does not exist, it is defined so
    that an IPv6 can be stored even if the system does not support IPv6. (user: js, size: 1723) [annotate] [blame] [check-ins using]


47
48
49
50
51
52
53

54
55
56
57
58
59
60
61
62
63
64
	TEST(@"-[connectToHost:port:]",
	    R([client connectToHost: @"127.0.0.1"
			       port: port]))

	TEST(@"-[accept]", (accepted = [server accept]))

	TEST(@"-[remoteAddress]",

	    [[accepted remoteAddress] isEqual: @"127.0.0.1"])

	TEST(@"-[writeString:]", [client writeString: @"Hello!"])

	TEST(@"-[readIntoBuffer:length:]", [accepted readIntoBuffer: buf
							     length: 6] &&
	    !memcmp(buf, "Hello!", 6))

	[pool drain];
}
@end







>
|










47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
	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))

	[pool drain];
}
@end