Also fixes test failures on Windows 11.
From: Hans Leidekker hans@codeweavers.com
Also fixes test failures on Windows 11.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=54045 --- dlls/ntdll/rtl.c | 2 -- dlls/ntdll/tests/rtl.c | 45 +++++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 59dde6359e3..84488ea1d81 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -1126,9 +1126,7 @@ static NTSTATUS ipv6_string_to_address(const WCHAR *str, BOOL ex, { if (str[1] != ':') goto error; str++; - /* Windows bug: a double colon at the beginning is treated as 4 bytes of zeros instead of 2 */ address->u.Word[0] = 0; - n_bytes = 2; }
for (;;) diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 1e5e8c2580c..c2ca8ea11a7 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -1409,7 +1409,7 @@ static const struct /* win_broken: XP and Vista do not handle this correctly ex_fail: Ex function does need the string to be terminated, non-Ex does not. ex_skip: test doesn't make sense for Ex (f.e. it's invalid for non-Ex but valid for Ex) */ - enum { normal_6, win_broken_6 = 1, ex_fail_6 = 2, ex_skip_6 = 4 } flags; + enum { normal_6, win_broken_6 = 1, ex_fail_6 = 2, ex_skip_6 = 4, win_extra_zero = 8 } flags; } ipv6_tests[] = { { "0000:0000:0000:0000:0000:0000:0000:0000", STATUS_SUCCESS, 39, @@ -1576,12 +1576,12 @@ static const struct { 0, 0, 0, 0, 0, 0, 0, 0 } }, { "::0:0:0:0:0:0", STATUS_SUCCESS, 13, { 0, 0, 0, 0, 0, 0, 0, 0 } }, - /* this one and the next one are incorrectly parsed by windows, + /* this one and the next one are incorrectly parsed before Windows 11, it adds one zero too many in front, cutting off the last digit. */ - { "::0:0:0:0:0:0:0", STATUS_SUCCESS, 13, - { 0, 0, 0, 0, 0, 0, 0, 0 }, ex_fail_6 }, - { "::0:a:b:c:d:e:f", STATUS_SUCCESS, 13, - { 0, 0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00 }, ex_fail_6 }, + { "::0:0:0:0:0:0:0", STATUS_SUCCESS, 15, + { 0, 0, 0, 0, 0, 0, 0, 0 }, win_broken_6|win_extra_zero }, + { "::0:a:b:c:d:e:f", STATUS_SUCCESS, 15, + { 0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00, 0xf00 }, win_broken_6|win_extra_zero }, { "::123.123.123.123", STATUS_SUCCESS, 17, { 0, 0, 0, 0, 0, 0, 0x7b7b, 0x7b7b } }, { "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", STATUS_SUCCESS, 39, @@ -2103,19 +2103,32 @@ static void test_RtlIpv6StringToAddress(void) } else { - ok(terminator == ipv6_tests[i].address + ipv6_tests[i].terminator_offset, - "[%s] terminator = %p, expected %p\n", - ipv6_tests[i].address, terminator, ipv6_tests[i].address + ipv6_tests[i].terminator_offset); + if (ipv6_tests[i].flags & win_extra_zero) + ok(terminator == ipv6_tests[i].address + ipv6_tests[i].terminator_offset || + broken(terminator != ipv6_tests[i].address + ipv6_tests[i].terminator_offset), + "[%s] terminator = %p, expected %p\n", + ipv6_tests[i].address, terminator, ipv6_tests[i].address + ipv6_tests[i].terminator_offset); + else + ok(terminator == ipv6_tests[i].address + ipv6_tests[i].terminator_offset, + "[%s] terminator = %p, expected %p\n", + ipv6_tests[i].address, terminator, ipv6_tests[i].address + ipv6_tests[i].terminator_offset); }
init_ip6(&expected_ip, ipv6_tests[i].ip); - ok(!memcmp(&ip, &expected_ip, sizeof(ip)), - "[%s] ip = %x:%x:%x:%x:%x:%x:%x:%x, expected %x:%x:%x:%x:%x:%x:%x:%x\n", - ipv6_tests[i].address, - ip.s6_words[0], ip.s6_words[1], ip.s6_words[2], ip.s6_words[3], - ip.s6_words[4], ip.s6_words[5], ip.s6_words[6], ip.s6_words[7], - expected_ip.s6_words[0], expected_ip.s6_words[1], expected_ip.s6_words[2], expected_ip.s6_words[3], - expected_ip.s6_words[4], expected_ip.s6_words[5], expected_ip.s6_words[6], expected_ip.s6_words[7]); + if (ipv6_tests[i].flags & win_extra_zero) + ok(!memcmp(&ip, &expected_ip, sizeof(ip)) || broken(memcmp(&ip, &expected_ip, sizeof(ip))), + "[%s] ip = %x:%x:%x:%x:%x:%x:%x:%x, expected %x:%x:%x:%x:%x:%x:%x:%x\n", + ipv6_tests[i].address, ip.s6_words[0], ip.s6_words[1], ip.s6_words[2], ip.s6_words[3], + ip.s6_words[4], ip.s6_words[5], ip.s6_words[6], ip.s6_words[7], + expected_ip.s6_words[0], expected_ip.s6_words[1], expected_ip.s6_words[2], expected_ip.s6_words[3], + expected_ip.s6_words[4], expected_ip.s6_words[5], expected_ip.s6_words[6], expected_ip.s6_words[7]); + else + ok(!memcmp(&ip, &expected_ip, sizeof(ip)), + "[%s] ip = %x:%x:%x:%x:%x:%x:%x:%x, expected %x:%x:%x:%x:%x:%x:%x:%x\n", + ipv6_tests[i].address, ip.s6_words[0], ip.s6_words[1], ip.s6_words[2], ip.s6_words[3], + ip.s6_words[4], ip.s6_words[5], ip.s6_words[6], ip.s6_words[7], + expected_ip.s6_words[0], expected_ip.s6_words[1], expected_ip.s6_words[2], expected_ip.s6_words[3], + expected_ip.s6_words[4], expected_ip.s6_words[5], expected_ip.s6_words[6], expected_ip.s6_words[7]); } }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128273
Your paranoid android.
=== debian11 (32 bit report) ===
urlmon: uri.c:7889: Test failed: Error: CreateUri returned 0x00000000, expected 0x80070057 on invalid_uri_tests[13].
user32: win.c:11680: Test failed: 00490138: expected prev 01B200F2, got 00000000 win.c:11694: Test failed: hwnd should NOT be topmost win.c:11640: Test failed: 1: hwnd 00490138 is still topmost
ws2_32: protocol.c:1079: Test failed: Address "::0:0:0:0:0:0:0": got 1 protocol.c:1087: Test failed: Address "::0:0:0:0:0:0:0": got 1 protocol.c:1079: Test failed: Address "::0:a:b:c:d:e:f": got 1 protocol.c:1081: Test failed: Address "::0:a:b:c:d:e:f": address didn't match protocol.c:1087: Test failed: Address "::0:a:b:c:d:e:f": got 1 protocol.c:1089: Test failed: Address "::0:a:b:c:d:e:f": address didn't match protocol.c:1545: Test failed: ascii: addr "::1:2:3:4:5:6:7": got 0 protocol.c:1546: Test failed: ascii: addr "::1:2:3:4:5:6:7": got error 0 protocol.c:1547: Test failed: ascii: addr "::1:2:3:4:5:6:7": got family 0x17 protocol.c:1549: Test failed: ascii: addr "::1:2:3:4:5:6:7": got addr 0:100:200:300:400:500:600:700 protocol.c:1558: Test failed: ascii: addr "::1:2:3:4:5:6:7": got len 28 protocol.c:1545: Test failed: unicode: addr "::1:2:3:4:5:6:7": got 0 protocol.c:1546: Test failed: unicode: addr "::1:2:3:4:5:6:7": got error 0 protocol.c:1547: Test failed: unicode: addr "::1:2:3:4:5:6:7": got family 0x17 protocol.c:1549: Test failed: unicode: addr "::1:2:3:4:5:6:7": got addr 0:100:200:300:400:500:600:700 protocol.c:1558: Test failed: unicode: addr "::1:2:3:4:5:6:7": got len 28