Bruno Jesus : ws2_32/tests: Add MSG_PEEK tests on recv().
Alexandre Julliard
julliard at winehq.org
Mon Aug 22 13:29:05 CDT 2011
Module: wine
Branch: master
Commit: a1d177c6b61fe7fc846ad890b83cec5fad7b7142
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a1d177c6b61fe7fc846ad890b83cec5fad7b7142
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Sun Aug 7 21:33:09 2011 -0300
ws2_32/tests: Add MSG_PEEK tests on recv().
---
dlls/ws2_32/tests/sock.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 24799cf..a171c85 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -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);
More information about the wine-cvs
mailing list