[PATCH 0/1] MR7510: msxml6/tests: Make test pass with Windows 7.
Currently test patterns show a systematic failure with Windows 7. https://test.winehq.org/data/patterns.html#msxml6:saxreader This is caused by the VisualBasic wrappers crashing when receiving some NULL parameters. Would this qualify for a version check like in a few other more central tests? If it would, is leaving the indentation that way ok? [This is a testbot run](https://testbot.winehq.org/JobDetails.pl?Key=151665) with this patch. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7510
From: Bernhard Übelacker <bernhardu(a)mailbox.org> --- dlls/msxml6/tests/saxreader.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/msxml6/tests/saxreader.c b/dlls/msxml6/tests/saxreader.c index b7b3a471e84..0dda5a57584 100644 --- a/dlls/msxml6/tests/saxreader.c +++ b/dlls/msxml6/tests/saxreader.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <assert.h> +#include "winternl.h" #include "windows.h" #include "ole2.h" #include "msxml6.h" @@ -34,6 +35,21 @@ #include "wine/test.h" +static BOOL check_win_version(int min_major, int min_minor) +{ + HMODULE hntdll = GetModuleHandleA("ntdll.dll"); + NTSTATUS (WINAPI *pRtlGetVersion)(RTL_OSVERSIONINFOEXW *); + RTL_OSVERSIONINFOEXW rtlver; + + rtlver.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOEXW); + pRtlGetVersion = (void *)GetProcAddress(hntdll, "RtlGetVersion"); + pRtlGetVersion(&rtlver); + return rtlver.dwMajorVersion > min_major || + (rtlver.dwMajorVersion == min_major && + rtlver.dwMinorVersion >= min_minor); +} +#define is_win8_plus() check_win_version(6, 2) + struct class_support { const GUID *clsid; @@ -1928,9 +1944,11 @@ static void test_mxwriter_comment(void) todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (is_win8_plus()) { /* Win7 crashes with NULL parameter */ hr = IVBSAXLexicalHandler_comment(vblexical, NULL); todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + } hr = ISAXLexicalHandler_comment(lexical, L"comment", 0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -2161,9 +2179,11 @@ static void test_mxwriter_dtd(void) todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (is_win8_plus()) { /* Win7 crashes with NULL parameter */ hr = IVBSAXLexicalHandler_startDTD(vblexical, NULL, NULL, NULL); todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + } hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, L"pub", 3, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); @@ -2230,9 +2250,11 @@ static void test_mxwriter_dtd(void) todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (is_win8_plus()) { /* Win7 crashes with NULL parameter */ hr = IVBSAXDeclHandler_elementDecl(vbdecl, NULL, NULL); todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + } hr = ISAXDeclHandler_elementDecl(decl, L"name", 4, NULL, 0); todo_wine @@ -2313,9 +2335,11 @@ static void test_mxwriter_dtd(void) todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (is_win8_plus()) { /* Win7 crashes with NULL parameter */ hr = IVBSAXDeclHandler_internalEntityDecl(vbdecl, NULL, NULL); todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + } hr = ISAXDeclHandler_internalEntityDecl(decl, _bstr_("name"), -1, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); @@ -2339,9 +2363,11 @@ static void test_mxwriter_dtd(void) hr = ISAXDeclHandler_externalEntityDecl(decl, NULL, 0, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + if (is_win8_plus()) { /* Win7 crashes with NULL parameter */ hr = IVBSAXDeclHandler_externalEntityDecl(vbdecl, NULL, NULL, NULL); todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + } hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), 0, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); @@ -2625,7 +2651,7 @@ static void test_mxattr_clear(void) hr = ISAXAttributes_getQName(saxattr, 0, NULL, NULL); todo_wine - ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr); + ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* Win7 */, "Unexpected hr %#lx.\n", hr); hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); @@ -2642,6 +2668,7 @@ static void test_mxattr_clear(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(len == 1, "got %d\n", len); + if (is_win8_plus()) { /* Win7 crashes with NULL parameter */ len = -1; hr = ISAXAttributes_getQName(saxattr, 0, NULL, &len); ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr); @@ -2652,6 +2679,7 @@ static void test_mxattr_clear(void) ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr); todo_wine ok(!ptr, "Unexpected pointer %p.\n", ptr); + } len = 0; hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len); @@ -2672,9 +2700,9 @@ static void test_mxattr_clear(void) hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); todo_wine - ok(!len, "Unexpected length %d.\n", len); + ok(!len || broken(len == -1) /* Win7 */, "Unexpected length %d.\n", len); todo_wine - ok(!ptr, "Unexpected pointer %p.\n", ptr); + ok(!ptr || broken(ptr == (void*)0xdeadbeef) /* Win7 */, "Unexpected pointer %p.\n", ptr); IMXAttributes_Release(mxattr); ISAXAttributes_Release(saxattr); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7510
I think we could simply use if(0) for those, and re-enable them once we no longer collect win7 results. Version checks like that is not what we do normally. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7510#note_96955
participants (2)
-
Bernhard Übelacker -
Nikolay Sivov (@nsivov)