Differences From Artifact [9cfb905769]:
- File tests/OFUNIXDatagramSocketTests.m — part of check-in [294557d352] at 2021-10-24 15:48:05 on branch unix-sockets — OFUNIXDatagramSocketTests: Don't require files (user: js, size: 1919) [annotate] [blame] [check-ins using]
To Artifact [3efedf5cad]:
- File
tests/OFUNIXDatagramSocketTests.m
— part of check-in
[d5373ff70f]
at
2021-10-24 18:11:41
on branch unix-sockets
— Enable UNIX sockets on Windows
Windows 10 supports UNIX sockets since Insider Preview Build 17063, but
only SOCK_STREAM. (user: js, size: 2268) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
38 39 40 41 42 43 44 | * We can have sockets, including UNIX sockets, while file support is * disabled. */ path = [OFString stringWithFormat: @"/tmp/%@", [[OFUUID UUID] UUIDString]]; #endif | < | > > > > > > > > > > > > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
* We can have sockets, including UNIX sockets, while file support is
* disabled.
*/
path = [OFString stringWithFormat: @"/tmp/%@",
[[OFUUID UUID] UUIDString]];
#endif
TEST(@"+[socket]", (sock = [OFUNIXDatagramSocket socket]))
@try {
TEST(@"-[bindToPath:]", R(address1 = [sock bindToPath: path]))
} @catch (OFBindFailedException *e) {
if (e.errNo == EAFNOSUPPORT) {
[OFStdOut setForegroundColor: [OFColor lime]];
[OFStdOut writeLine:
@"\r[OFUNIXDatagramSocket] -[bindToPath:]: "
@"UNIX datagram sockets unsupported, skipping "
@"tests"];
objc_autoreleasePoolPop(pool);
return;
} else
@throw e;
}
@try {
TEST(@"-[sendBuffer:length:receiver:]",
R([sock sendBuffer: "Hello" length: 5 receiver: &address1]))
TEST(@"-[receiveIntoBuffer:length:sender:]",
[sock receiveIntoBuffer: buffer
length: 5
sender: &address2] == 5 &&
|
| ︙ | ︙ |