Commit 948e0815 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

ws2_32/tests: Skip some raw socket tests when missing elevated privileges.

parent a0559ad5
......@@ -2551,29 +2551,35 @@ static void test_WSASocket(void)
SOCK_RAW, socktype);
closesocket(sock);
todo_wine {
sock = WSASocketA(0, 0, IPPROTO_RAW, NULL, 0, 0);
ok(sock != INVALID_SOCKET, "Failed to create socket: %d\n",
WSAGetLastError());
size = sizeof(socktype);
socktype = 0xdead;
err = getsockopt(sock, SOL_SOCKET, SO_TYPE, (char *) &socktype, &size);
ok(!err, "getsockopt failed with %d\n", WSAGetLastError());
ok(socktype == SOCK_RAW, "Wrong socket type, expected %d received %d\n",
SOCK_RAW, socktype);
closesocket(sock);
if (sock != INVALID_SOCKET)
{
todo_wine {
size = sizeof(socktype);
socktype = 0xdead;
err = getsockopt(sock, SOL_SOCKET, SO_TYPE, (char *) &socktype, &size);
ok(!err, "getsockopt failed with %d\n", WSAGetLastError());
ok(socktype == SOCK_RAW, "Wrong socket type, expected %d received %d\n",
SOCK_RAW, socktype);
closesocket(sock);
}
sock = WSASocketA(AF_INET, SOCK_RAW, IPPROTO_TCP, NULL, 0, 0);
ok(sock != INVALID_SOCKET, "Failed to create socket: %d\n",
WSAGetLastError());
size = sizeof(socktype);
socktype = 0xdead;
err = getsockopt(sock, SOL_SOCKET, SO_TYPE, (char *) &socktype, &size);
ok(!err, "getsockopt failed with %d\n", WSAGetLastError());
ok(socktype == SOCK_RAW, "Wrong socket type, expected %d received %d\n",
SOCK_RAW, socktype);
closesocket(sock);
}
else if (WSAGetLastError() == WSAEACCES)
skip("SOCK_RAW is not available\n");
else
ok(0, "Failed to create socket: %d\n", WSAGetLastError());
sock = WSASocketA(AF_INET, SOCK_RAW, IPPROTO_TCP, NULL, 0, 0);
ok(sock != INVALID_SOCKET, "Failed to create socket: %d\n",
WSAGetLastError());
size = sizeof(socktype);
socktype = 0xdead;
err = getsockopt(sock, SOL_SOCKET, SO_TYPE, (char *) &socktype, &size);
ok(!err, "getsockopt failed with %d\n", WSAGetLastError());
ok(socktype == SOCK_RAW, "Wrong socket type, expected %d received %d\n",
SOCK_RAW, socktype);
closesocket(sock);
}
/* IPX socket tests */
......
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