Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/ws2_32/tests/protocol.c | 86 ++++++++++++++---------------------- 1 file changed, 33 insertions(+), 53 deletions(-)
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index 1ff335f7fe2..d902d399c00 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -1403,12 +1403,11 @@ static void test_WSAStringToAddress(void) { "", { 0, 0, 0, 0, 0, 0, 0, 0 }, 0, WSAEINVAL }, };
+ int len, ret, expected_len; WCHAR inputW[64]; - INT len, ret, expected_len, expected_ret; - short expected_family; SOCKADDR_IN sockaddr; SOCKADDR_IN6 sockaddr6; - int i, j; + unsigned int i, j;
len = 0; WSASetLastError( 0 ); @@ -1420,12 +1419,16 @@ static void test_WSAStringToAddress(void)
for (i = 0; i < 2; i++) { + winetest_push_context( i ? "unicode" : "ascii" ); + for (j = 0; j < ARRAY_SIZE(ipv4_tests); j++) { len = sizeof(sockaddr) + 10; expected_len = ipv4_tests[j].error ? len : sizeof(sockaddr); memset( &sockaddr, 0xab, sizeof(sockaddr) );
+ winetest_push_context( "addr %s", debugstr_a(ipv4_tests[j].input) ); + WSASetLastError( 0 ); if (i == 0) { @@ -1436,26 +1439,16 @@ static void test_WSAStringToAddress(void) MultiByteToWideChar( CP_ACP, 0, ipv4_tests[j].input, -1, inputW, ARRAY_SIZE(inputW) ); ret = WSAStringToAddressW( inputW, AF_INET, NULL, (SOCKADDR *)&sockaddr, &len ); } - expected_ret = ipv4_tests[j].error ? SOCKET_ERROR : 0; - expected_family = ipv4_tests[j].error ? 0 : AF_INET; - ok( ret == expected_ret, - "WSAStringToAddress(%s) returned %d, expected %d\n", - wine_dbgstr_a( ipv4_tests[j].input ), ret, expected_ret ); - ok( WSAGetLastError() == ipv4_tests[j].error, - "WSAStringToAddress(%s) gave error %d, expected %d\n", - wine_dbgstr_a( ipv4_tests[j].input ), WSAGetLastError(), ipv4_tests[j].error ); - ok( sockaddr.sin_family == expected_family, - "WSAStringToAddress(%s) gave family %d, expected %d\n", - wine_dbgstr_a( ipv4_tests[j].input ), sockaddr.sin_family, expected_family ); + ok( ret == (ipv4_tests[j].error ? SOCKET_ERROR : 0), "got %d\n", ret ); + ok( WSAGetLastError() == ipv4_tests[j].error, "got error %d\n", WSAGetLastError() ); + ok( sockaddr.sin_family == (ipv4_tests[j].error ? 0 : AF_INET), + "got family %#x\n", sockaddr.sin_family ); ok( sockaddr.sin_addr.s_addr == htonl( ipv4_tests[j].address ), - "WSAStringToAddress(%s) gave address %08x, expected %08x\n", - wine_dbgstr_a( ipv4_tests[j].input ), sockaddr.sin_addr.s_addr, htonl( ipv4_tests[j].address) ); - ok( sockaddr.sin_port == htons( ipv4_tests[j].port ), - "WSAStringToAddress(%s) gave port %04x, expected %04x\n", - wine_dbgstr_a( ipv4_tests[j].input ), sockaddr.sin_port, htons( ipv4_tests[j].port ) ); - ok( len == expected_len, - "WSAStringToAddress(%s) gave length %d, expected %d\n", - wine_dbgstr_a( ipv4_tests[j].input ), len, expected_len ); + "got addr %08x\n", sockaddr.sin_addr.s_addr ); + ok( sockaddr.sin_port == htons( ipv4_tests[j].port ), "got port %u\n", sockaddr.sin_port ); + ok( len == expected_len, "got len %d\n", len ); + + winetest_pop_context(); }
for (j = 0; j < ARRAY_SIZE(ipv6_tests); j++) @@ -1479,41 +1472,28 @@ static void test_WSAStringToAddress(void) win_skip("IPv6 not supported\n"); break; } - expected_ret = ipv6_tests[j].error ? SOCKET_ERROR : 0; - expected_family = ipv6_tests[j].error ? 0 : AF_INET6; - ok( ret == expected_ret, - "WSAStringToAddress(%s) returned %d, expected %d\n", - wine_dbgstr_a( ipv6_tests[j].input ), ret, expected_ret ); - ok( WSAGetLastError() == ipv6_tests[j].error, - "WSAStringToAddress(%s) gave error %d, expected %d\n", - wine_dbgstr_a( ipv6_tests[j].input ), WSAGetLastError(), ipv6_tests[j].error ); - ok( sockaddr6.sin6_family == expected_family, - "WSAStringToAddress(%s) gave family %d, expected %d\n", - wine_dbgstr_a( ipv4_tests[j].input ), sockaddr6.sin6_family, expected_family ); - ok( memcmp(&sockaddr6.sin6_addr, ipv6_tests[j].address, sizeof(sockaddr6.sin6_addr)) == 0, - "WSAStringToAddress(%s) gave address %x:%x:%x:%x:%x:%x:%x:%x, expected %x:%x:%x:%x:%x:%x:%x:%x\n", - wine_dbgstr_a( ipv6_tests[j].input ), + + winetest_push_context( "addr %s", debugstr_a(ipv6_tests[j].input) ); + + ok( ret == (ipv6_tests[j].error ? SOCKET_ERROR : 0), "got %d\n", ret ); + ok( WSAGetLastError() == ipv6_tests[j].error, "got error %d\n", WSAGetLastError() ); + ok( sockaddr6.sin6_family == (ipv6_tests[j].error ? 0 : AF_INET6), + "got family %#x\n", sockaddr6.sin6_family ); + ok( !memcmp( &sockaddr6.sin6_addr, ipv6_tests[j].address, sizeof(sockaddr6.sin6_addr) ), + "got addr %x:%x:%x:%x:%x:%x:%x:%x\n", sockaddr6.sin6_addr.s6_words[0], sockaddr6.sin6_addr.s6_words[1], sockaddr6.sin6_addr.s6_words[2], sockaddr6.sin6_addr.s6_words[3], sockaddr6.sin6_addr.s6_words[4], sockaddr6.sin6_addr.s6_words[5], - sockaddr6.sin6_addr.s6_words[6], sockaddr6.sin6_addr.s6_words[7], - ipv6_tests[j].address[0], ipv6_tests[j].address[1], - ipv6_tests[j].address[2], ipv6_tests[j].address[3], - ipv6_tests[j].address[4], ipv6_tests[j].address[5], - ipv6_tests[j].address[6], ipv6_tests[j].address[7] ); - ok( sockaddr6.sin6_scope_id == 0, - "WSAStringToAddress(%s) gave scope %d, expected 0\n", - wine_dbgstr_a( ipv6_tests[j].input ), sockaddr6.sin6_scope_id ); - ok( sockaddr6.sin6_port == ipv6_tests[j].port, - "WSAStringToAddress(%s) gave port %04x, expected %04x\n", - wine_dbgstr_a( ipv6_tests[j].input ), sockaddr6.sin6_port, ipv6_tests[j].port ); - ok( sockaddr6.sin6_flowinfo == 0, - "WSAStringToAddress(%s) gave flowinfo %d, expected 0\n", - wine_dbgstr_a( ipv6_tests[j].input ), sockaddr6.sin6_flowinfo ); - ok( len == expected_len, - "WSAStringToAddress(%s) gave length %d, expected %d\n", - wine_dbgstr_a( ipv6_tests[j].input ), len, expected_len ); + sockaddr6.sin6_addr.s6_words[6], sockaddr6.sin6_addr.s6_words[7] ); + ok( !sockaddr6.sin6_scope_id, "got scope id %u\n", sockaddr6.sin6_scope_id ); + ok( sockaddr6.sin6_port == ipv6_tests[j].port, "got port %u\n", sockaddr6.sin6_port ); + ok( !sockaddr6.sin6_flowinfo, "got flowinfo %u\n", sockaddr6.sin6_flowinfo ); + ok( len == expected_len, "got len %d\n", len ); + + winetest_pop_context(); } + + winetest_pop_context(); } }
They share almost no code.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/ws2_32/tests/protocol.c | 144 ++++++++++++++++------------------- 1 file changed, 65 insertions(+), 79 deletions(-)
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index d902d399c00..865fbbd5947 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -1169,10 +1169,10 @@ static void test_WSAAddressToString(void) SOCKADDR_IN6 sockaddr6; char output[64]; WCHAR outputW[64], expected_outputW[64]; + unsigned int i; SOCKET v6; INT ret; DWORD len; - int i, j;
len = 0; sockaddr.sin_family = AF_INET; @@ -1201,87 +1201,73 @@ static void test_WSAAddressToString(void) ok( len == 8, "got %u\n", len ); ok( !wcscmp(outputW, L"0.0.0.0"), "got %s\n", wine_dbgstr_w(outputW) );
- for (i = 0; i < 2; i++) + for (i = 0; i < ARRAY_SIZE(ipv4_tests); ++i) { - for (j = 0; j < ARRAY_SIZE(ipv4_tests); j++) - { - sockaddr.sin_family = AF_INET; - sockaddr.sin_addr.s_addr = ipv4_tests[j].address; - sockaddr.sin_port = ipv4_tests[j].port; - - if (i == 0) - { - len = sizeof(output); - memset(output, 0, len); - ret = WSAAddressToStringA( (SOCKADDR *)&sockaddr, sizeof(sockaddr), NULL, output, &len ); - ok( !ret, "ipv4_tests[%d] failed unexpectedly: %d\n", j, WSAGetLastError() ); - ok( !strcmp( output, ipv4_tests[j].output ), - "ipv4_tests[%d]: got address %s, expected %s\n", - j, wine_dbgstr_a(output), wine_dbgstr_a(ipv4_tests[j].output) ); - ok( len == strlen(ipv4_tests[j].output) + 1, - "ipv4_tests[%d]: got length %d, expected %d\n", - j, len, strlen(ipv4_tests[j].output) + 1 ); - } - else - { - len = sizeof(outputW); - memset(outputW, 0, len); - ret = WSAAddressToStringW( (SOCKADDR *)&sockaddr, sizeof(sockaddr), NULL, outputW, &len ); - MultiByteToWideChar( CP_ACP, 0, ipv4_tests[j].output, -1, - expected_outputW, ARRAY_SIZE(expected_outputW) ); - ok( !ret, "ipv4_tests[%d] failed unexpectedly: %d\n", j, WSAGetLastError() ); - ok( !wcscmp( outputW, expected_outputW ), - "ipv4_tests[%d]: got address %s, expected %s\n", - j, wine_dbgstr_w(outputW), wine_dbgstr_w(expected_outputW) ); - ok( len == wcslen(expected_outputW) + 1, - "ipv4_tests[%d]: got length %d, expected %d\n", - j, len, wcslen(expected_outputW) + 1 ); - } - } - - /* check to see if IPv6 is available */ - v6 = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); - if (v6 == INVALID_SOCKET) { - skip("Could not create IPv6 socket (LastError: %d; %d expected if IPv6 not available).\n", - WSAGetLastError(), WSAEAFNOSUPPORT); - continue; - } - closesocket(v6); + sockaddr.sin_family = AF_INET; + sockaddr.sin_addr.s_addr = ipv4_tests[i].address; + sockaddr.sin_port = ipv4_tests[i].port; + + len = sizeof(output); + memset( output, 0, len ); + ret = WSAAddressToStringA( (SOCKADDR *)&sockaddr, sizeof(sockaddr), NULL, output, &len ); + ok( !ret, "ipv4_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); + ok( !strcmp( output, ipv4_tests[i].output ), + "ipv4_tests[%d]: got address %s, expected %s\n", + i, debugstr_a(output), debugstr_a(ipv4_tests[i].output) ); + ok( len == strlen(ipv4_tests[i].output) + 1, + "ipv4_tests[%d]: got length %d, expected %d\n", + i, len, strlen(ipv4_tests[i].output) + 1 ); + + len = sizeof(outputW); + memset( outputW, 0, len ); + ret = WSAAddressToStringW( (SOCKADDR *)&sockaddr, sizeof(sockaddr), NULL, outputW, &len ); + MultiByteToWideChar( CP_ACP, 0, ipv4_tests[i].output, -1, + expected_outputW, ARRAY_SIZE(expected_outputW) ); + ok( !ret, "ipv4_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); + ok( !wcscmp( outputW, expected_outputW ), + "ipv4_tests[%d]: got address %s, expected %s\n", + i, debugstr_w(outputW), debugstr_w(expected_outputW) ); + ok( len == wcslen(expected_outputW) + 1, + "ipv4_tests[%d]: got length %d, expected %d\n", + i, len, wcslen(expected_outputW) + 1 ); + }
- for (j = 0; j < ARRAY_SIZE(ipv6_tests); j++) - { - sockaddr6.sin6_family = AF_INET6; - sockaddr6.sin6_scope_id = ipv6_tests[j].scope; - sockaddr6.sin6_port = ipv6_tests[j].port; - memcpy( sockaddr6.sin6_addr.s6_addr, ipv6_tests[j].address, sizeof(ipv6_tests[j].address) ); + v6 = socket( AF_INET6, SOCK_STREAM, IPPROTO_TCP ); + if (v6 == -1 && WSAGetLastError() == WSAEAFNOSUPPORT) + { + skip( "IPv6 is not supported\n" ); + return; + } + closesocket( v6 );
- if (i == 0) - { - len = sizeof(output); - ret = WSAAddressToStringA( (SOCKADDR *)&sockaddr6, sizeof(sockaddr6), NULL, output, &len ); - ok( !ret, "ipv6_tests[%d] failed unexpectedly: %d\n", j, WSAGetLastError() ); - ok( !strcmp( output, ipv6_tests[j].output ), - "ipv6_tests[%d]: gave address %s, expected %s\n", - j, wine_dbgstr_a(output), wine_dbgstr_a(ipv6_tests[j].output) ); - ok( len == strlen(ipv6_tests[j].output) + 1, - "ipv6_tests[%d]: got length %d, expected %d\n", - j, len, strlen(ipv6_tests[j].output) + 1 ); - } - else - { - len = sizeof(outputW); - ret = WSAAddressToStringW( (SOCKADDR *)&sockaddr6, sizeof(sockaddr6), NULL, outputW, &len ); - MultiByteToWideChar( CP_ACP, 0, ipv6_tests[j].output, -1, - expected_outputW, ARRAY_SIZE(expected_outputW) ); - ok( !ret, "ipv6_tests[%d] failed unexpectedly: %d\n", j, WSAGetLastError() ); - ok( !wcscmp( outputW, expected_outputW ), - "ipv6_tests[%d]: got address %s, expected %s\n", - j, wine_dbgstr_w(outputW), wine_dbgstr_w(expected_outputW) ); - ok( len == wcslen(expected_outputW) + 1, - "ipv6_tests[%d]: got length %d, expected %d\n", - j, len, wcslen(expected_outputW) + 1 ); - } - } + for (i = 0; i < ARRAY_SIZE(ipv6_tests); ++i) + { + sockaddr6.sin6_family = AF_INET6; + sockaddr6.sin6_scope_id = ipv6_tests[i].scope; + sockaddr6.sin6_port = ipv6_tests[i].port; + memcpy( sockaddr6.sin6_addr.s6_addr, ipv6_tests[i].address, sizeof(ipv6_tests[i].address) ); + + len = sizeof(output); + ret = WSAAddressToStringA( (SOCKADDR *)&sockaddr6, sizeof(sockaddr6), NULL, output, &len ); + ok( !ret, "ipv6_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); + ok( !strcmp( output, ipv6_tests[i].output ), + "ipv6_tests[%d]: gave address %s, expected %s\n", + i, debugstr_a(output), debugstr_a(ipv6_tests[i].output) ); + ok( len == strlen(ipv6_tests[i].output) + 1, + "ipv6_tests[%d]: got length %d, expected %d\n", + i, len, strlen(ipv6_tests[i].output) + 1 ); + + len = sizeof(outputW); + ret = WSAAddressToStringW( (SOCKADDR *)&sockaddr6, sizeof(sockaddr6), NULL, outputW, &len ); + MultiByteToWideChar( CP_ACP, 0, ipv6_tests[i].output, -1, + expected_outputW, ARRAY_SIZE(expected_outputW) ); + ok( !ret, "ipv6_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); + ok( !wcscmp( outputW, expected_outputW ), + "ipv6_tests[%d]: got address %s, expected %s\n", + i, debugstr_w(outputW), debugstr_w(expected_outputW) ); + ok( len == wcslen(expected_outputW) + 1, + "ipv6_tests[%d]: got length %d, expected %d\n", + i, len, wcslen(expected_outputW) + 1 ); } }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/ws2_32/tests/protocol.c | 48 +++++++++++++++--------------------- 1 file changed, 20 insertions(+), 28 deletions(-)
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index 865fbbd5947..cdc549cf3a2 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -1203,6 +1203,8 @@ static void test_WSAAddressToString(void)
for (i = 0; i < ARRAY_SIZE(ipv4_tests); ++i) { + winetest_push_context( "Test %u", i ); + sockaddr.sin_family = AF_INET; sockaddr.sin_addr.s_addr = ipv4_tests[i].address; sockaddr.sin_port = ipv4_tests[i].port; @@ -1210,26 +1212,20 @@ static void test_WSAAddressToString(void) len = sizeof(output); memset( output, 0, len ); ret = WSAAddressToStringA( (SOCKADDR *)&sockaddr, sizeof(sockaddr), NULL, output, &len ); - ok( !ret, "ipv4_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); - ok( !strcmp( output, ipv4_tests[i].output ), - "ipv4_tests[%d]: got address %s, expected %s\n", - i, debugstr_a(output), debugstr_a(ipv4_tests[i].output) ); - ok( len == strlen(ipv4_tests[i].output) + 1, - "ipv4_tests[%d]: got length %d, expected %d\n", - i, len, strlen(ipv4_tests[i].output) + 1 ); + ok( !ret, "got error %d\n", WSAGetLastError() ); + ok( !strcmp( output, ipv4_tests[i].output ), "got string %s\n", debugstr_a(output) ); + ok( len == strlen(ipv4_tests[i].output) + 1, "got len %u\n", len );
len = sizeof(outputW); memset( outputW, 0, len ); ret = WSAAddressToStringW( (SOCKADDR *)&sockaddr, sizeof(sockaddr), NULL, outputW, &len ); MultiByteToWideChar( CP_ACP, 0, ipv4_tests[i].output, -1, expected_outputW, ARRAY_SIZE(expected_outputW) ); - ok( !ret, "ipv4_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); - ok( !wcscmp( outputW, expected_outputW ), - "ipv4_tests[%d]: got address %s, expected %s\n", - i, debugstr_w(outputW), debugstr_w(expected_outputW) ); - ok( len == wcslen(expected_outputW) + 1, - "ipv4_tests[%d]: got length %d, expected %d\n", - i, len, wcslen(expected_outputW) + 1 ); + ok( !ret, "got error %d\n", WSAGetLastError() ); + ok( !wcscmp( outputW, expected_outputW ), "got string %s\n", debugstr_w(outputW) ); + ok( len == wcslen(expected_outputW) + 1, "got len %u\n", len ); + + winetest_pop_context(); }
v6 = socket( AF_INET6, SOCK_STREAM, IPPROTO_TCP ); @@ -1242,6 +1238,8 @@ static void test_WSAAddressToString(void)
for (i = 0; i < ARRAY_SIZE(ipv6_tests); ++i) { + winetest_push_context( "Test %u", i ); + sockaddr6.sin6_family = AF_INET6; sockaddr6.sin6_scope_id = ipv6_tests[i].scope; sockaddr6.sin6_port = ipv6_tests[i].port; @@ -1249,25 +1247,19 @@ static void test_WSAAddressToString(void)
len = sizeof(output); ret = WSAAddressToStringA( (SOCKADDR *)&sockaddr6, sizeof(sockaddr6), NULL, output, &len ); - ok( !ret, "ipv6_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); - ok( !strcmp( output, ipv6_tests[i].output ), - "ipv6_tests[%d]: gave address %s, expected %s\n", - i, debugstr_a(output), debugstr_a(ipv6_tests[i].output) ); - ok( len == strlen(ipv6_tests[i].output) + 1, - "ipv6_tests[%d]: got length %d, expected %d\n", - i, len, strlen(ipv6_tests[i].output) + 1 ); + ok( !ret, "got error %d\n", WSAGetLastError() ); + ok( !strcmp( output, ipv6_tests[i].output ), "got string %s\n", debugstr_a(output) ); + ok( len == strlen(ipv6_tests[i].output) + 1, "got len %u\n", len );
len = sizeof(outputW); ret = WSAAddressToStringW( (SOCKADDR *)&sockaddr6, sizeof(sockaddr6), NULL, outputW, &len ); MultiByteToWideChar( CP_ACP, 0, ipv6_tests[i].output, -1, expected_outputW, ARRAY_SIZE(expected_outputW) ); - ok( !ret, "ipv6_tests[%d] failed unexpectedly: %d\n", i, WSAGetLastError() ); - ok( !wcscmp( outputW, expected_outputW ), - "ipv6_tests[%d]: got address %s, expected %s\n", - i, debugstr_w(outputW), debugstr_w(expected_outputW) ); - ok( len == wcslen(expected_outputW) + 1, - "ipv6_tests[%d]: got length %d, expected %d\n", - i, len, wcslen(expected_outputW) + 1 ); + ok( !ret, "got error %d\n", WSAGetLastError() ); + ok( !wcscmp( outputW, expected_outputW ), "got string %s\n", debugstr_w(outputW) ); + ok( len == wcslen(expected_outputW) + 1, "got len %u\n", len ); + + winetest_pop_context(); } }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/ws2_32/tests/protocol.c | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index cdc549cf3a2..374fa01789d 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -952,29 +952,29 @@ static void test_inet_pton(void) WCHAR inputW[32]; DWORD addr;
+ winetest_push_context( "Address %s", debugstr_a(ipv4_tests[i].input) ); + WSASetLastError(0xdeadbeef); addr = 0xdeadbeef; ret = p_inet_pton(AF_INET, ipv4_tests[i].input, &addr); - ok(ret == ipv4_tests[i].ret, "%s: got %d\n", debugstr_a(ipv4_tests[i].input), ret); - ok(WSAGetLastError() == 0xdeadbeef, "%s: got error %u\n", - debugstr_a(ipv4_tests[i].input), WSAGetLastError()); - ok(addr == ipv4_tests[i].addr, "%s: got addr %#08x\n", debugstr_a(ipv4_tests[i].input), addr); + ok(ret == ipv4_tests[i].ret, "got %d\n", ret); + ok(WSAGetLastError() == 0xdeadbeef, "got error %u\n", WSAGetLastError()); + ok(addr == ipv4_tests[i].addr, "got addr %#08x\n", addr);
MultiByteToWideChar(CP_ACP, 0, ipv4_tests[i].input, -1, inputW, ARRAY_SIZE(inputW)); WSASetLastError(0xdeadbeef); addr = 0xdeadbeef; ret = pInetPtonW(AF_INET, inputW, &addr); - ok(ret == ipv4_tests[i].ret, "%s: got %d\n", debugstr_a(ipv4_tests[i].input), ret); - ok(WSAGetLastError() == (ret ? 0xdeadbeef : WSAEINVAL), "%s: got error %u\n", - debugstr_a(ipv4_tests[i].input), WSAGetLastError()); - ok(addr == ipv4_tests[i].addr, "%s: got addr %#08x\n", debugstr_a(ipv4_tests[i].input), addr); + ok(ret == ipv4_tests[i].ret, "got %d\n", ret); + ok(WSAGetLastError() == (ret ? 0xdeadbeef : WSAEINVAL), "got error %u\n", WSAGetLastError()); + ok(addr == ipv4_tests[i].addr, "got addr %#08x\n", addr);
WSASetLastError(0xdeadbeef); addr = inet_addr(ipv4_tests[i].input); - ok(addr == ipv4_tests[i].ret ? ipv4_tests[i].addr : INADDR_NONE, - "%s: got addr %#08x\n", debugstr_a(ipv4_tests[i].input), addr); - ok(WSAGetLastError() == 0xdeadbeef, "%s: got error %u\n", - debugstr_a(ipv4_tests[i].input), WSAGetLastError()); + ok(addr == ipv4_tests[i].ret ? ipv4_tests[i].addr : INADDR_NONE, "got addr %#08x\n", addr); + ok(WSAGetLastError() == 0xdeadbeef, "got error %u\n", WSAGetLastError()); + + winetest_pop_context(); }
for (i = 0; i < ARRAY_SIZE(ipv6_tests); ++i) @@ -982,24 +982,24 @@ static void test_inet_pton(void) unsigned short addr[8]; WCHAR inputW[64];
+ winetest_push_context( "Address %s", debugstr_a(ipv6_tests[i].input) ); + WSASetLastError(0xdeadbeef); memset(addr, 0xab, sizeof(addr)); ret = p_inet_pton(AF_INET6, ipv6_tests[i].input, addr); - ok(ret == ipv6_tests[i].ret, "%s: got %d\n", debugstr_a(ipv6_tests[i].input), ret); - ok(WSAGetLastError() == 0xdeadbeef, "%s: got error %u\n", - debugstr_a(ipv6_tests[i].input), WSAGetLastError()); - ok(!memcmp(addr, ipv6_tests[i].addr, sizeof(addr)), - "%s: address didn't match\n", debugstr_a(ipv6_tests[i].input)); + ok(ret == ipv6_tests[i].ret, "got %d\n", ret); + ok(WSAGetLastError() == 0xdeadbeef, "got error %u\n", WSAGetLastError()); + ok(!memcmp(addr, ipv6_tests[i].addr, sizeof(addr)), "address didn't match\n");
MultiByteToWideChar(CP_ACP, 0, ipv6_tests[i].input, -1, inputW, ARRAY_SIZE(inputW)); WSASetLastError(0xdeadbeef); memset(addr, 0xab, sizeof(addr)); ret = pInetPtonW(AF_INET6, inputW, addr); - ok(ret == ipv6_tests[i].ret, "%s: got %d\n", debugstr_a(ipv6_tests[i].input), ret); - ok(WSAGetLastError() == (ret ? 0xdeadbeef : WSAEINVAL), "%s: got error %u\n", - debugstr_a(ipv6_tests[i].input), WSAGetLastError()); - ok(!memcmp(addr, ipv6_tests[i].addr, sizeof(addr)), - "%s: address didn't match\n", debugstr_a(ipv6_tests[i].input)); + ok(ret == ipv6_tests[i].ret, "got %d\n", ret); + ok(WSAGetLastError() == (ret ? 0xdeadbeef : WSAEINVAL), "got error %u\n", WSAGetLastError()); + ok(!memcmp(addr, ipv6_tests[i].addr, sizeof(addr)), "address didn't match\n"); + + winetest_pop_context(); } }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=107648
Your paranoid android.
=== w8adm (32 bit report) ===
ws2_32: protocol.c:1734: Test failed: got 11001 expected success protocol.c:1735: Test failed: got 00000000
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- include/wine/afd.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/wine/afd.h b/include/wine/afd.h index efd5787e90a..993730cacdb 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -126,7 +126,7 @@ struct afd_poll_params { SOCKET socket; int flags; - NTSTATUS status; + int status; } sockets[1]; };
@@ -140,7 +140,7 @@ struct afd_poll_params_64 { ULONGLONG socket; int flags; - NTSTATUS status; + int status; } sockets[1]; };
@@ -154,7 +154,7 @@ struct afd_poll_params_32 { ULONG socket; int flags; - NTSTATUS status; + int status; } sockets[1]; }; #include <poppack.h> @@ -180,7 +180,7 @@ struct afd_event_select_params_32 struct afd_get_events_params { int flags; - NTSTATUS status[13]; + int status[13]; }; C_ASSERT( sizeof(struct afd_get_events_params) == 56 );