Detlef Riekenberg : ws2_32/tests: Add tests for setsockopt with invalid levels.
Alexandre Julliard
julliard at winehq.org
Tue Aug 25 08:45:19 CDT 2009
Module: wine
Branch: master
Commit: 2b345484bc12835b943055acd008f9d49b7f1e3c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b345484bc12835b943055acd008f9d49b7f1e3c
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Tue Aug 25 00:04:39 2009 +0200
ws2_32/tests: Add tests for setsockopt with invalid levels.
---
dlls/ws2_32/tests/sock.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index a83694f..b927868 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1018,6 +1018,23 @@ static void test_set_getsockopt(void)
ok(lasterr == WSAEFAULT, "setsockopt with optval being a value "
"returned 0x%08x, not WSAEFAULT(0x%08x)\n",
lasterr, WSAEFAULT);
+
+ /* SO_RCVTIMEO with invalid values for level */
+ size = sizeof(timeout);
+ timeout = SOCKTIMEOUT1;
+ SetLastError(0xdeadbeef);
+ err = setsockopt(s, 0xffffffff, SO_RCVTIMEO, (char *) &timeout, size);
+ ok( (err == SOCKET_ERROR) && (WSAGetLastError() == WSAEINVAL),
+ "got %d with %d (expected SOCKET_ERROR with WSAEINVAL\n",
+ err, WSAGetLastError());
+
+ timeout = SOCKTIMEOUT1;
+ SetLastError(0xdeadbeef);
+ err = setsockopt(s, 0x00008000, SO_RCVTIMEO, (char *) &timeout, size);
+ ok( (err == SOCKET_ERROR) && (WSAGetLastError() == WSAEINVAL),
+ "got %d with %d (expected SOCKET_ERROR with WSAEINVAL\n",
+ err, WSAGetLastError());
+
closesocket(s);
}
More information about the wine-cvs
mailing list