ws2_32/tests: Add tests for setsockopt with invalid levels.
This commit is contained in:
parent
a563d670a0
commit
2b345484bc
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue