Fix a possible test failure.
From: Zhiyi Zhang zzhang@codeweavers.com
Fix a possible test failure. --- dlls/comctl32/tests/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index ac4c3abaf30..bc404c4b59a 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -581,7 +581,7 @@ static void test_WM_THEMECHANGED(void) {TOOLTIPS_CLASSA, wm_themechanged_no_paint_seq}, {TRACKBAR_CLASSA, wm_themechanged_paint_seq}, {WC_TREEVIEWA, wm_themechanged_paint_erase_seq, 1, {0x1128}}, - {UPDOWN_CLASSA, wm_themechanged_paint_erase_seq}, + {UPDOWN_CLASSA, wm_themechanged_paint_erase_seq, 1, {WM_NCPAINT}}, {WC_SCROLLBARA, wm_themechanged_paint_erase_seq, 1, {SBM_GETSCROLLINFO}}, };
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/tests/misc.c | 156 ++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index bc404c4b59a..5da44e7af8c 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -997,17 +997,171 @@ static void test_themed_background(void) pSetThreadDpiAwarenessContext(old_context); }
+static WNDPROC old_proc; + +static const struct message wm_stylechanged_seq[] = +{ + {WM_STYLECHANGED, sent}, + {0} +}; + +static const struct message wm_stylechanged_repaint_seq[] = +{ + {WM_STYLECHANGED, sent}, + {WM_PAINT, sent}, + {WM_ERASEBKGND, sent | defwinproc}, + {0} +}; + +static const struct message wm_stylechanged_combox_seq[] = +{ + {WM_STYLECHANGED, sent}, + {WM_ERASEBKGND, sent | defwinproc}, + {WM_PAINT, sent}, + {0} +}; + +static const struct message wm_stylechanged_pager_seq[] = +{ + {WM_STYLECHANGED, sent}, + {WM_PAINT, sent}, + {WM_NCPAINT, sent | defwinproc}, + {WM_ERASEBKGND, sent | defwinproc}, + {0} +}; + +static const struct message wm_stylechanged_progress_seq[] = +{ + {WM_STYLECHANGED, sent}, + {WM_PAINT, sent | optional}, /* WM_PAINT and WM_ERASEBKGND are missing with comctl32 v5 */ + {WM_ERASEBKGND, sent | defwinproc | optional}, + {0} +}; + +static const struct message wm_stylechanged_trackbar_seq[] = +{ + {WM_STYLECHANGED, sent}, + {WM_PAINT, sent | defwinproc}, + {WM_PAINT, sent}, + {0} +}; + +static LRESULT WINAPI test_wm_stylechanged_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) +{ + static int defwndproc_counter = 0; + struct message msg = {0}; + LRESULT ret; + + if (message == WM_STYLECHANGED + || message == WM_PAINT + || message == WM_ERASEBKGND + || message == WM_NCPAINT) + { + msg.message = message; + msg.flags = sent | wparam | lparam; + if (defwndproc_counter) + msg.flags |= defwinproc; + msg.wParam = wp; + msg.lParam = lp; + add_message(sequences, CHILD_SEQ_INDEX, &msg); + } + + ++defwndproc_counter; + ret = CallWindowProcA(old_proc, hwnd, message, wp, lp); + --defwndproc_counter; + return ret; +} + +static void test_WM_STYLECHANGED(void) +{ + HWND parent, hwnd; + STYLESTRUCT style; + unsigned int i; + + static const struct test + { + const CHAR *class_name; + const struct message *seq; + BOOL todo; + } + tests[] = + { + {ANIMATE_CLASSA, wm_stylechanged_seq, TRUE}, + {WC_BUTTONA, wm_stylechanged_seq}, + {WC_COMBOBOXA, wm_stylechanged_combox_seq, TRUE}, + {WC_COMBOBOXEXA, wm_stylechanged_seq}, + {DATETIMEPICK_CLASSA, wm_stylechanged_seq, TRUE}, + {WC_EDITA, wm_stylechanged_seq}, + {WC_HEADERA, wm_stylechanged_repaint_seq, TRUE}, + {HOTKEY_CLASSA, wm_stylechanged_seq}, + {WC_IPADDRESSA, wm_stylechanged_seq}, + {WC_LISTBOXA, wm_stylechanged_repaint_seq, TRUE}, + {WC_LISTVIEWA, wm_stylechanged_seq, TRUE}, + {MONTHCAL_CLASSA, wm_stylechanged_repaint_seq, TRUE}, + {WC_NATIVEFONTCTLA, wm_stylechanged_seq}, + {WC_PAGESCROLLERA, wm_stylechanged_pager_seq, TRUE}, + {PROGRESS_CLASSA, wm_stylechanged_progress_seq}, + {REBARCLASSNAMEA, wm_stylechanged_seq}, + {WC_STATICA, wm_stylechanged_seq}, + {STATUSCLASSNAMEA, wm_stylechanged_seq}, + {"SysLink", wm_stylechanged_seq, TRUE}, + {WC_TABCONTROLA, wm_stylechanged_seq, TRUE}, + {TOOLBARCLASSNAMEA, wm_stylechanged_seq}, + {TOOLTIPS_CLASSA, wm_stylechanged_seq}, + {TRACKBAR_CLASSA, wm_stylechanged_trackbar_seq, TRUE}, + {WC_TREEVIEWA, wm_stylechanged_seq, TRUE}, + {UPDOWN_CLASSA, wm_stylechanged_seq, TRUE}, + {WC_SCROLLBARA, wm_stylechanged_seq}, + }; + + parent = CreateWindowA(WC_STATICA, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 100, 100, + 0, 0, 0, 0); + ok(parent != NULL, "CreateWindowA failed, error %lu.\n", GetLastError()); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + winetest_push_context("%s", tests[i].class_name); + + hwnd = CreateWindowA(tests[i].class_name, "test", WS_CHILD | WS_VISIBLE, 0, 0, 50, 50, + parent, 0, 0, 0); + /* SysLink is unavailable in comctl32 v5 */ + if (!hwnd && !lstrcmpA(tests[i].class_name, "SysLink")) + { + winetest_pop_context(); + continue; + } + ok(hwnd != NULL, "CreateWindowA failed, error %lu.\n", GetLastError()); + old_proc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)test_wm_stylechanged_proc); + ok(old_proc != NULL, "SetWindowLongPtrA failed, error %lu.\n", GetLastError()); + flush_events(); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + style.styleOld = GetWindowLongA(hwnd, GWL_STYLE); + style.styleNew = style.styleOld | WS_TABSTOP; + SendMessageA(hwnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM)&style); + flush_events(); + ok_sequence(sequences, CHILD_SEQ_INDEX, tests[i].seq, "WM_STYLECHANGED", tests[i].todo); + + DestroyWindow(hwnd); + winetest_pop_context(); + } + + DestroyWindow(parent); +} + START_TEST(misc) { ULONG_PTR ctx_cookie; HANDLE hCtx;
+ init_msg_sequences(sequences, NUM_MSG_SEQUENCES); if(!InitFunctionPtrs()) return;
test_GetPtrAW(); test_Alloc(); test_comctl32_classes(FALSE); + test_WM_STYLECHANGED();
FreeLibrary(hComctl32);
@@ -1015,7 +1169,6 @@ START_TEST(misc) return; if(!init_functions_v6()) return; - init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
test_comctl32_classes(TRUE); test_builtin_classes(); @@ -1023,6 +1176,7 @@ START_TEST(misc) test_themed_background(); test_WM_THEMECHANGED(); test_WM_SYSCOLORCHANGE(); + test_WM_STYLECHANGED();
unload_v6_module(ctx_cookie, hCtx); FreeLibrary(hComctl32);
From: Zhiyi Zhang zzhang@codeweavers.com
Some applications subclass treeview and change style multiple times when painting. Invalidating control when handling WM_STYLECHANGED causes infinite WM_PAINT messages in this case and end up stalling the message queue. --- dlls/comctl32/tests/misc.c | 2 +- dlls/comctl32/treeview.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 5da44e7af8c..73526020843 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1109,7 +1109,7 @@ static void test_WM_STYLECHANGED(void) {TOOLBARCLASSNAMEA, wm_stylechanged_seq}, {TOOLTIPS_CLASSA, wm_stylechanged_seq}, {TRACKBAR_CLASSA, wm_stylechanged_trackbar_seq, TRUE}, - {WC_TREEVIEWA, wm_stylechanged_seq, TRUE}, + {WC_TREEVIEWA, wm_stylechanged_seq}, {UPDOWN_CLASSA, wm_stylechanged_seq, TRUE}, {WC_SCROLLBARA, wm_stylechanged_seq}, }; diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 23e87bdce04..d3a69bb438e 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -5627,7 +5627,6 @@ TREEVIEW_StyleChanged(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TREEVIEW_EndEditLabelNow(infoPtr, TRUE); TREEVIEW_UpdateSubTree(infoPtr, infoPtr->root); TREEVIEW_UpdateScrollBars(infoPtr); - TREEVIEW_Invalidate(infoPtr, NULL);
return 0; }
From: Zhiyi Zhang zzhang@codeweavers.com
Some applications subclass listview and change style multiple times when painting. Invalidating control when handling WM_STYLECHANGED causes infinite WM_PAINT messages in this case and end up stalling the message queue. --- dlls/comctl32/listview.c | 3 --- dlls/comctl32/tests/misc.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 38d43a9f742..d060fd5c977 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -11298,9 +11298,6 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, /* add scrollbars if needed */ LISTVIEW_UpdateScroll(infoPtr);
- /* invalidate client area + erase background */ - LISTVIEW_InvalidateList(infoPtr); - return 0; }
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 73526020843..d9f07570fd0 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1096,7 +1096,7 @@ static void test_WM_STYLECHANGED(void) {HOTKEY_CLASSA, wm_stylechanged_seq}, {WC_IPADDRESSA, wm_stylechanged_seq}, {WC_LISTBOXA, wm_stylechanged_repaint_seq, TRUE}, - {WC_LISTVIEWA, wm_stylechanged_seq, TRUE}, + {WC_LISTVIEWA, wm_stylechanged_seq}, {MONTHCAL_CLASSA, wm_stylechanged_repaint_seq, TRUE}, {WC_NATIVEFONTCTLA, wm_stylechanged_seq}, {WC_PAGESCROLLERA, wm_stylechanged_pager_seq, TRUE},
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=125077
Your paranoid android.
=== debian11 (build log) ===
Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24784. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24784. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24784.
This merge request was approved by Nikolay Sivov.