Module: wine Branch: master Commit: 2b345484bc12835b943055acd008f9d49b7f1e3c URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b345484bc12835b943055acd0...
Author: Detlef Riekenberg wine.dev@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); }