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

oldstable
Detlef Riekenberg 2009-08-25 00:04:39 +02:00 committed by Alexandre Julliard
parent a563d670a0
commit 2b345484bc
1 changed files with 17 additions and 0 deletions

View File

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