Differences From Artifact [c4340e1e26]:
- File
tests/OFUDPSocketTests.m
— part of check-in
[5025cba435]
at
2014-01-27 22:01:46
on branch trunk
— Add OFUDPSocket
Async operations will follow later. (user: js, size: 2197) [annotate] [blame] [check-ins using]
To Artifact [d252ab9bf0]:
- File
tests/OFUDPSocketTests.m
— part of check-in
[fb590316ba]
at
2014-01-30 12:26:12
on branch trunk
— Rename +[UDPSocket hostForAddress:port:]
It is now called +[getHost:andPort:forAddress:]. This makes it much
clearer from the selector alone what it actually does. (user: js, size: 2247) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - (void)UDPSocketTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFUDPSocket *sock; uint16_t port1, port2; of_udp_socket_address_t addr1, addr2, addr3; char buf[6]; TEST(@"+[socket]", (sock = [OFUDPSocket socket])) TEST(@"-[bindToHost:port:]", (port1 = [sock bindToHost: @"127.0.0.1" port: 0])) | > | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - (void)UDPSocketTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFUDPSocket *sock; uint16_t port1, port2; of_udp_socket_address_t addr1, addr2, addr3; char buf[6]; OFString *host; TEST(@"+[socket]", (sock = [OFUDPSocket socket])) TEST(@"-[bindToHost:port:]", (port1 = [sock bindToHost: @"127.0.0.1" port: 0])) |
︙ | ︙ | |||
53 54 55 56 57 58 59 | TEST(@"-[receiveIntoBuffer:length:sender:]", [sock receiveIntoBuffer: buf length: 6 sender: &addr2] == 6 && !memcmp(buf, "Hello", 6)) | | | | > | | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | TEST(@"-[receiveIntoBuffer:length:sender:]", [sock receiveIntoBuffer: buf length: 6 sender: &addr2] == 6 && !memcmp(buf, "Hello", 6)) TEST(@"+[getHost:andPort:forAddress:]", R([OFUDPSocket getHost: &host andPort: &port2 forAddress: &addr2]) && [host isEqual: @"127.0.0.1"] && port2 == port1) [OFUDPSocket resolveAddressForHost: @"127.0.0.1" port: port1 + 1 address: &addr3]; TEST(@"of_udp_socket_address_equal()", of_udp_socket_address_equal(&addr1, &addr2) && |
︙ | ︙ |