Commit 29883e2d authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

ws2_32/tests: Continue sending remaining data on short write in test_write_events.

Today, we assert that a short write clears the FD_WRITE event bit; however, short writes can never happen on Windows in the first place. We're testing for a property of a socket behaviour that does not exist on Windows, but currently happens to be exhibited by Wine. Ignore short writes, and continue sending until it fails with EWOULDBLOCK. This way, the test won't care whether or not a short write clears FD_WRITE. This allows us some flexibility in implementation of send(). Signed-off-by: 's avatarJinoh Kang <jinoh.kang.kr@gmail.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d162a3e2
...@@ -5666,14 +5666,11 @@ static void test_write_events(struct event_test_ctx *ctx) ...@@ -5666,14 +5666,11 @@ static void test_write_events(struct event_test_ctx *ctx)
if (!broken(1)) if (!broken(1))
{ {
while ((ret = send(server, buffer, buffer_size, 0)) == buffer_size);
/* Windows will never send less than buffer_size bytes here, but Linux /* Windows will never send less than buffer_size bytes here, but Linux
* may do a short write. */ * may do a short write. */
todo_wine_if (ret > 0) while ((ret = send(server, buffer, buffer_size, 0)) > 0);
{ ok(ret == -1, "got %d\n", ret);
ok(ret == -1, "got %d\n", ret); ok(WSAGetLastError() == WSAEWOULDBLOCK, "got error %u\n", WSAGetLastError());
ok(WSAGetLastError() == WSAEWOULDBLOCK, "got error %u\n", WSAGetLastError());
}
while (recv(client, buffer, buffer_size, 0) > 0); while (recv(client, buffer, buffer_size, 0) > 0);
ok(WSAGetLastError() == WSAEWOULDBLOCK, "got error %u\n", WSAGetLastError()); ok(WSAGetLastError() == WSAEWOULDBLOCK, "got error %u\n", WSAGetLastError());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment