Commit a1d177c6 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

ws2_32/tests: Add MSG_PEEK tests on recv().

parent 8032d3ea
......@@ -2324,6 +2324,7 @@ static void test_select(void)
fd_set readfds, writefds, exceptfds;
unsigned int maxfd;
int ret;
char buffer;
struct timeval select_timeout;
select_thread_params thread_params;
HANDLE thread_handle;
......@@ -2379,6 +2380,8 @@ static void test_select(void)
ok ( (thread_params.ReadKilled) ||
broken(thread_params.ReadKilled == 0), /*Win98*/
"closesocket did not wakeup select\n");
ret = recv(fdRead, &buffer, 1, MSG_PEEK);
ok( (ret == -1), "peek at closed socket expected -1 got %d\n", ret);
/* Test selecting invalid handles */
FD_ZERO(&readfds);
......@@ -3627,6 +3630,10 @@ static void test_events(int useMessages)
ok(ret == 100, "Failed to send buffer %d err %d\n", ret, GetLastError());
ok_event_seq(src, hEvent, read_seq, NULL, 0);
ret = recv(src, buffer, 1, MSG_PEEK);
ok(ret == 1, "Failed to peek at recv buffer %d err %d\n", ret, GetLastError());
ok_event_seq(src, hEvent, read_seq, NULL, 0);
ret = recv(src, buffer, 50, 0);
ok(ret == 50, "Failed to recv buffer %d err %d\n", ret, GetLastError());
ok_event_seq(src, hEvent, read_seq, NULL, 0);
......
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