Module: wine Branch: master Commit: 5f7b9a5b837a77a85754b3b55b974e39e199f817 URL: https://gitlab.winehq.org/wine/wine/-/commit/5f7b9a5b837a77a85754b3b55b974e3...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Mon May 27 15:06:28 2024 +0300
comctl32/tests: Create a fully updated ListView window.
so that the tests don't get remaining messages from the window creation process, and verify message sequences for the actually being tested functionality.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
---
dlls/comctl32/tests/listview.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index ad60fa5b6b6..1081a045cde 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -115,7 +115,6 @@ static const struct message redraw_listview_seq[] = { { WM_NCPAINT, sent|id|defwinproc, 0, 0, HEADER_ID }, { WM_ERASEBKGND, sent|id|defwinproc|optional, 0, 0, HEADER_ID }, { WM_NOTIFY, sent|id|defwinproc, 0, 0, LISTVIEW_ID }, - { WM_NCPAINT, sent|id|defwinproc, 0, 0, LISTVIEW_ID }, { WM_ERASEBKGND, sent|id|defwinproc|optional, 0, 0, LISTVIEW_ID }, { 0 } }; @@ -810,6 +809,8 @@ static HWND create_listview_control(DWORD style)
if (!hwnd) return NULL;
+ UpdateWindow(hwnd); + oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)listview_subclass_proc); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); @@ -833,6 +834,8 @@ static HWND create_listview_controlW(DWORD style, HWND parent)
if (!hwnd) return NULL;
+ UpdateWindow(hwnd); + oldproc = (WNDPROC)SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)listview_subclass_proc); SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); @@ -1888,7 +1891,10 @@ static void test_create(BOOL is_version_6)
/* WM_MEASUREITEM should be sent when created with LVS_OWNERDRAWFIXED */ flush_sequences(sequences, NUM_MSG_SEQUENCES); - hList = create_listview_control(LVS_OWNERDRAWFIXED | LVS_REPORT); + hList = CreateWindowExA(0, WC_LISTVIEWA, NULL, + WS_CHILD | WS_BORDER | WS_VISIBLE | LVS_OWNERDRAWFIXED | LVS_REPORT, + 0, 0, 100, 100, hwndparent, NULL, GetModuleHandleA(NULL), NULL); + ok(hList != NULL, "Failed to create ListView window.\n"); ok_sequence(sequences, PARENT_SEQ_INDEX, create_ownerdrawfixed_parent_seq, "created with LVS_OWNERDRAWFIXED|LVS_REPORT - parent seq", FALSE); DestroyWindow(hList); @@ -2198,8 +2204,8 @@ static void test_color(void)
rect.right = rect.bottom = 1; r = GetUpdateRect(hwnd, &rect, TRUE); - todo_wine expect(FALSE, r); - ok(rect.right == 0 && rect.bottom == 0, "got update rectangle\n"); + expect(FALSE, r); + ok(rect.right == 0 && rect.bottom == 0, "got update rectangle %s\n", wine_dbgstr_rect(&rect));
r = ValidateRect(hwnd, NULL); expect(TRUE, r); @@ -2208,8 +2214,8 @@ static void test_color(void)
rect.right = rect.bottom = 1; r = GetUpdateRect(hwnd, &rect, TRUE); - todo_wine expect(FALSE, r); - ok(rect.right == 0 && rect.bottom == 0, "got update rectangle\n"); + expect(FALSE, r); + ok(rect.right == 0 && rect.bottom == 0, "got update rectangle %s\n", wine_dbgstr_rect(&rect));
r = ValidateRect(hwnd, NULL); expect(TRUE, r); @@ -2218,8 +2224,8 @@ static void test_color(void)
rect.right = rect.bottom = 1; r = GetUpdateRect(hwnd, &rect, TRUE); - todo_wine expect(FALSE, r); - ok(rect.right == 0 && rect.bottom == 0, "got update rectangle\n"); + expect(FALSE, r); + ok(rect.right == 0 && rect.bottom == 0, "got update rectangle %s\n", wine_dbgstr_rect(&rect));
DestroyWindow(hwnd); }