Commit 2b345484 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

ws2_32/tests: Add tests for setsockopt with invalid levels.

parent a563d670
......@@ -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);
}
......
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