Zebediah Figura (@zfigura) commented about dlls/ws2_32/tests/sock.c:
- ok(ret == sizeof(serverMsg),
ret >= 0
? "Incorrect amount of bytes written to Unix socket: %lu\n"
: "Could not send data over Unix socket: %lu\n",
ret >= 0 ? ret : GetLastError());
- ret = recv(client, clientBuf, sizeof(serverMsg), 0);
- ok(ret == sizeof(serverMsg),
ret >= 0
? "Incorrect amount of bytes read from Unix socket: %lu\n"
: "Could not receive data over Unix socket: %lu\n",
ret >= 0 ? ret : GetLastError());
- ok(!memcmp(serverMsg, clientBuf, sizeof(serverMsg)), "Data mismatch over Unix socket\n");
- DeleteFileA("test_afunix.sock");
This isn't very interesting if you don't test the return value.
Judging from patch 4/8, I'm guessing real software does this. "Analogous to unbinding" is an interesting statement, though. Do real world programs expect the socket to be able to be bound to a different address afterwards? We'll need tests for that, and I don't think it's currently possible in Wine.
Note that this can't possibly be a substitute for actually closing the socket handle, which this test should do for all of its sockets regardless.