Commit e3453ed8 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

ws2_32/tests: Adjust test results without host IPv6 support.

parent c5a58aed
...@@ -2281,6 +2281,12 @@ static void test_bind(void) ...@@ -2281,6 +2281,12 @@ static void test_bind(void)
todo_wine ok(ret == STATUS_PENDING, "got %#x\n", ret); todo_wine ok(ret == STATUS_PENDING, "got %#x\n", ret);
ret = WaitForSingleObject(event, 0); ret = WaitForSingleObject(event, 0);
ok(!ret, "got %#x\n", ret); ok(!ret, "got %#x\n", ret);
if (io.Status == STATUS_INVALID_ADDRESS_COMPONENT)
{
skip("IPv6 not supported\n");
closesocket(s);
goto cleanup;
}
ok(!io.Status, "got %#lx\n", io.Status); ok(!io.Status, "got %#lx\n", io.Status);
ok(io.Information == sizeof(addr6), "got %#Ix\n", io.Information); ok(io.Information == sizeof(addr6), "got %#Ix\n", io.Information);
ok(addr6.sin6_family == AF_INET6, "got family %u\n", addr6.sin6_family); ok(addr6.sin6_family == AF_INET6, "got family %u\n", addr6.sin6_family);
...@@ -2315,6 +2321,7 @@ static void test_bind(void) ...@@ -2315,6 +2321,7 @@ static void test_bind(void)
closesocket(s2); closesocket(s2);
closesocket(s); closesocket(s);
cleanup:
CloseHandle(event); CloseHandle(event);
free(params); free(params);
} }
......
...@@ -2176,6 +2176,7 @@ static void test_getaddrinfo(void) ...@@ -2176,6 +2176,7 @@ static void test_getaddrinfo(void)
SOCKADDR_IN *sockaddr; SOCKADDR_IN *sockaddr;
CHAR name[256], *ip; CHAR name[256], *ip;
DWORD size = sizeof(name); DWORD size = sizeof(name);
BOOL has_ipv6_getaddrinfo = TRUE;
BOOL has_ipv6_addr; BOOL has_ipv6_addr;
memset(&hint, 0, sizeof(ADDRINFOA)); memset(&hint, 0, sizeof(ADDRINFOA));
...@@ -2376,8 +2377,10 @@ static void test_getaddrinfo(void) ...@@ -2376,8 +2377,10 @@ static void test_getaddrinfo(void)
} }
else else
{ {
todo_wine
ok(ret == WSAHOST_NOT_FOUND, "getaddrinfo failed with %d\n", ret); ok(ret == WSAHOST_NOT_FOUND, "getaddrinfo failed with %d\n", ret);
win_skip("getaddrinfo does not support IPV6\n"); skip("getaddrinfo does not support IPV6\n");
has_ipv6_getaddrinfo = FALSE;
} }
hint.ai_flags = 0; hint.ai_flags = 0;
...@@ -2468,7 +2471,10 @@ static void test_getaddrinfo(void) ...@@ -2468,7 +2471,10 @@ static void test_getaddrinfo(void)
ret = getaddrinfo("www.kernel.org", NULL, NULL, &result); ret = getaddrinfo("www.kernel.org", NULL, NULL, &result);
ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
if (!has_ipv6_addr) if (!has_ipv6_addr)
todo_wine ok(!ipv6_found(result), "IPv6 address is returned.\n"); {
todo_wine_if(has_ipv6_getaddrinfo)
ok(!ipv6_found(result), "IPv6 address is returned.\n");
}
freeaddrinfo(result); freeaddrinfo(result);
for (i = 0; i < ARRAY_SIZE(hinttests); i++) for (i = 0; i < ARRAY_SIZE(hinttests); i++)
......
...@@ -2187,7 +2187,14 @@ static void test_reuseaddr(void) ...@@ -2187,7 +2187,14 @@ static void test_reuseaddr(void)
ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError());
rc = bind(s1, tests[i].addr_loopback, tests[i].addrlen); rc = bind(s1, tests[i].addr_loopback, tests[i].addrlen);
ok(!rc, "got error %d.\n", WSAGetLastError()); ok(!rc || (tests[i].domain == AF_INET6 && WSAGetLastError() == WSAEADDRNOTAVAIL), "got error %d.\n", WSAGetLastError());
if (tests[i].domain == AF_INET6 && WSAGetLastError() == WSAEADDRNOTAVAIL)
{
skip("IPv6 not supported, skipping test\n");
closesocket(s1);
winetest_pop_context();
continue;
}
s2 = socket(tests[i].domain, SOCK_STREAM, 0); s2 = socket(tests[i].domain, SOCK_STREAM, 0);
ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError());
...@@ -2392,7 +2399,7 @@ static void test_reuseaddr(void) ...@@ -2392,7 +2399,7 @@ static void test_reuseaddr(void)
} }
} }
rc = bind(s[0], tests_exclusive[i].s[0].addr, tests_exclusive[i].s[0].addrlen); rc = bind(s[0], tests_exclusive[i].s[0].addr, tests_exclusive[i].s[0].addrlen);
ok(!rc, "got error %d.\n", WSAGetLastError()); ok(!rc || (tests_exclusive[i].s[0].domain == AF_INET6 && WSAGetLastError() == WSAEADDRNOTAVAIL), "got error %d.\n", WSAGetLastError());
rc = bind(s[1], tests_exclusive[i].s[1].addr, tests_exclusive[i].s[1].addrlen); rc = bind(s[1], tests_exclusive[i].s[1].addr, tests_exclusive[i].s[1].addrlen);
...@@ -2746,7 +2753,12 @@ static void test_ipv6_cmsg(void) ...@@ -2746,7 +2753,12 @@ static void test_ipv6_cmsg(void)
ok(server != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError()); ok(server != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError());
rc = bind(server, (SOCKADDR *)&localhost, sizeof(localhost)); rc = bind(server, (SOCKADDR *)&localhost, sizeof(localhost));
ok(rc != SOCKET_ERROR, "bind failed, error %u\n", WSAGetLastError()); ok(rc != SOCKET_ERROR || WSAGetLastError() == WSAEADDRNOTAVAIL, "bind failed, error %u\n", WSAGetLastError());
if (WSAGetLastError() == WSAEADDRNOTAVAIL)
{
skip("IPv6 not supported, skipping test\n");
goto cleanup;
}
rc = connect(client, (SOCKADDR *)&localhost, sizeof(localhost)); rc = connect(client, (SOCKADDR *)&localhost, sizeof(localhost));
ok(rc != SOCKET_ERROR, "connect failed, error %u\n", WSAGetLastError()); ok(rc != SOCKET_ERROR, "connect failed, error %u\n", WSAGetLastError());
...@@ -2820,6 +2832,7 @@ static void test_ipv6_cmsg(void) ...@@ -2820,6 +2832,7 @@ static void test_ipv6_cmsg(void)
rc = setsockopt(server, IPPROTO_IPV6, IPV6_RECVTCLASS, (const char *)&off, sizeof(off)); rc = setsockopt(server, IPPROTO_IPV6, IPV6_RECVTCLASS, (const char *)&off, sizeof(off));
ok(!rc, "failed to clear IPV6_RECVTCLASS, error %u\n", WSAGetLastError()); ok(!rc, "failed to clear IPV6_RECVTCLASS, error %u\n", WSAGetLastError());
cleanup:
closesocket(server); closesocket(server);
closesocket(client); closesocket(client);
} }
......
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