Overview
| Comment: | OFUNIXDatagramSocketTests: Clean up after test |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | unix-sockets |
| Files: | files | file ages | folders |
| SHA3-256: |
d126e271984430052ae2b185bb69d85a |
| User & Date: | js on 2021-10-24 15:18:54 |
| Other Links: | branch diff | manifest | tags |
Context
|
2021-10-24
| ||
| 15:48 | OFUNIXDatagramSocketTests: Don't require files (check-in: 294557d352 user: js tags: unix-sockets) | |
| 15:18 | OFUNIXDatagramSocketTests: Clean up after test (check-in: d126e27198 user: js tags: unix-sockets) | |
| 15:14 | Add OFUNIXDatagramSocket (check-in: 94110c9553 user: js tags: unix-sockets) | |
Changes
Modified tests/OFUNIXDatagramSocketTests.m from [66faa10762] to [58f17d5fdb].
| ︙ | ︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | OFUNIXDatagramSocket *sock; OFSocketAddress address1, address2; char buffer[5]; path = [[OFSystemInfo temporaryDirectoryPath] stringByAppendingPathComponent: [[OFUUID UUID] UUIDString]]; TEST(@"+[socket]", (sock = [OFUNIXDatagramSocket socket])) TEST(@"-[bindToPath:]", R(address1 = [sock bindToPath: path])) TEST(@"-[sendBuffer:length:receiver:]", R([sock sendBuffer: "Hello" length: 5 receiver: &address1])) TEST(@"-[receiveIntoBuffer:length:sender:]", | > | > > | > > > > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
OFUNIXDatagramSocket *sock;
OFSocketAddress address1, address2;
char buffer[5];
path = [[OFSystemInfo temporaryDirectoryPath]
stringByAppendingPathComponent: [[OFUUID UUID] UUIDString]];
@try {
TEST(@"+[socket]", (sock = [OFUNIXDatagramSocket socket]))
TEST(@"-[bindToPath:]", R(address1 = [sock bindToPath: path]))
TEST(@"-[sendBuffer:length:receiver:]",
R([sock sendBuffer: "Hello" length: 5 receiver: &address1]))
TEST(@"-[receiveIntoBuffer:length:sender:]",
[sock receiveIntoBuffer: buffer
length: 5
sender: &address2] == 5 &&
memcmp(buffer, "Hello", 5) == 0 &&
OFSocketAddressEqual(&address1, &address2) &&
OFSocketAddressHash(&address1) ==
OFSocketAddressHash(&address2))
} @finally {
[[OFFileManager defaultManager] removeItemAtPath: path];
}
objc_autoreleasePoolPop(pool);
}
@end
|