Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
user32 patch series of the comctl32 committed patches.
dlls/user32/tests/listbox.c | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 019d284..4b5d574 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -371,6 +371,35 @@ static void test_ownerdraw(void) ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top);
DestroyWindow(hLB); + + /* Both FIXED and VARIABLE, FIXED should override VARIABLE. */ + hLB = CreateWindowA("listbox", "TestList", LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE, 0, 0, 100, 100, + NULL, NULL, NULL, 0); + ok(hLB != NULL, "last error 0x%08x\n", GetLastError()); + + ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0); + ok(ret == 0, "Unexpected return value %d.\n", ret); + ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0); + ok(ret == 1, "Unexpected return value %d.\n", ret); + + ret = SendMessageA(hLB, LB_SETITEMHEIGHT, 0, 13); + ok(ret == LB_OKAY, "Failed to set item height, %d.\n", ret); + + ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); + ok(ret == 13, "Unexpected item height %d.\n", ret); + + ret = SendMessageA(hLB, LB_SETITEMHEIGHT, 1, 42); + ok(ret == LB_OKAY, "Failed to set item height, %d.\n", ret); + + ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); +todo_wine + ok(ret == 42, "Unexpected item height %d.\n", ret); + + ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 1, 0); + ok(ret == 42, "Unexpected item height %d.\n", ret); + + DestroyWindow (hLB); + DestroyWindow(parent); }
@@ -1695,7 +1724,13 @@ static void test_listbox_dlgdir(void)
static void test_set_count( void ) { + static const DWORD styles[] = + { + LBS_OWNERDRAWFIXED, + LBS_HASSTRINGS, + }; HWND parent, listbox; + unsigned int i; LONG ret; RECT r;
@@ -1725,6 +1760,21 @@ static void test_set_count( void ) ok( !IsRectEmpty( &r ), "got empty rect\n");
DestroyWindow( listbox ); + + for (i = 0; i < ARRAY_SIZE(styles); ++i) + { + listbox = create_listbox( styles[i] | WS_CHILD | WS_VISIBLE, parent ); + + SetLastError( 0xdeadbeef ); + ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); + todo_wine_if(i == 0) + ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret ); + todo_wine_if(i == 0) + ok( GetLastError() == ERROR_SETCOUNT_ON_BAD_LB, "Unexpected error %d.\n", GetLastError() ); + + DestroyWindow( listbox ); + } + DestroyWindow( parent ); }
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/tests/listbox.c | 156 +++++++++++++++++++++++++++--------- 1 file changed, 118 insertions(+), 38 deletions(-)
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 4b5d574..6e90d1d 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -90,7 +90,6 @@ struct listbox_stat { };
struct listbox_test { - struct listbox_prop prop; struct listbox_stat init, init_todo; struct listbox_stat click, click_todo; struct listbox_stat step, step_todo; @@ -130,8 +129,7 @@ keypress (HWND handle, WPARAM keycode, BYTE scancode, BOOL extended)
#define listbox_field_ok(t, s, f, got) \ ok (t.s.f==got.f, "style %#x, step " #s ", field " #f \ - ": expected %d, got %d\n", (unsigned int)t.prop.add_style, \ - t.s.f, got.f) + ": expected %d, got %d\n", style, t.s.f, got.f)
#define listbox_todo_field_ok(t, s, f, got) \ todo_wine_if (t.s##_todo.f) { listbox_field_ok(t, s, f, got); } @@ -143,13 +141,15 @@ keypress (HWND handle, WPARAM keycode, BYTE scancode, BOOL extended) listbox_todo_field_ok(t, s, selcount, got)
static void -check (const struct listbox_test test) +check (DWORD style, const struct listbox_test test) { struct listbox_stat answer; - HWND hLB=create_listbox (test.prop.add_style, 0); RECT second_item; int i; int res; + HWND hLB; + + hLB = create_listbox (style, 0);
listbox_query (hLB, &answer); listbox_ok (test, init, answer); @@ -166,13 +166,13 @@ check (const struct listbox_test test) listbox_ok (test, step, answer);
DestroyWindow (hLB); - hLB=create_listbox (test.prop.add_style, 0); + hLB = create_listbox(style, 0);
SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2)); listbox_query (hLB, &answer); listbox_ok (test, sel, answer);
- for (i=0;i<4;i++) { + for (i = 0; i < 4 && !(style & LBS_NODATA); i++) { DWORD size = SendMessageA(hLB, LB_GETTEXTLEN, i, 0); CHAR *txt; WCHAR *txtw; @@ -184,13 +184,9 @@ check (const struct listbox_test test)
txtw = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, 2*size+2); resW=SendMessageW(hLB, LB_GETTEXT, i, (LPARAM)txtw); - if (resA != resW) { - trace("SendMessageW(LB_GETTEXT) not supported on this platform (resA=%d resW=%d), skipping...\n", - resA, resW); - } else { - WideCharToMultiByte( CP_ACP, 0, txtw, -1, txt, size, NULL, NULL ); - ok(!strcmp (txt, strings[i]), "returned string for item %d does not match %s vs %s\n", i, txt, strings[i]); - } + ok(resA == resW, "Unexpected text length.\n"); + WideCharToMultiByte( CP_ACP, 0, txtw, -1, txt, size, NULL, NULL ); + ok(!strcmp (txt, strings[i]), "returned string for item %d does not match %s vs %s\n", i, txt, strings[i]);
HeapFree (GetProcessHeap(), 0, txtw); HeapFree (GetProcessHeap(), 0, txt); @@ -2044,75 +2040,158 @@ static void test_WM_MEASUREITEM(void) DestroyWindow(parent); }
+static void test_LBS_NODATA(void) +{ + static const UINT invalid_idx[] = { -2, 2 }; + static const UINT valid_idx[] = { 0, 1 }; + static const ULONG_PTR zero_data; + unsigned int i; + ULONG_PTR data; + HWND listbox; + INT ret; + + listbox = CreateWindowA("listbox", "TestList", LBS_NODATA | LBS_OWNERDRAWFIXED | WS_VISIBLE, + 0, 0, 100, 100, NULL, NULL, NULL, 0); + ok(listbox != NULL, "Failed to create ListBox window.\n"); + + ret = SendMessageA(listbox, LB_INSERTSTRING, -1, 0); + ok(ret == 0, "Unexpected return value %d.\n", ret); + ret = SendMessageA(listbox, LB_INSERTSTRING, -1, 0); + ok(ret == 1, "Unexpected return value %d.\n", ret); + ret = SendMessageA(listbox, LB_GETCOUNT, 0, 0); + ok(ret == 2, "Unexpected return value %d.\n", ret); + + /* Invalid indices. */ + for (i = 0; i < ARRAY_SIZE(invalid_idx); ++i) + { + ret = SendMessageA(listbox, LB_SETITEMDATA, invalid_idx[i], 42); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ret = SendMessageA(listbox, LB_GETTEXTLEN, invalid_idx[i], 0); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + if (ret == LB_ERR) + { + ret = SendMessageA(listbox, LB_GETTEXT, invalid_idx[i], (LPARAM)&data); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + } + ret = SendMessageA(listbox, LB_GETITEMDATA, invalid_idx[i], 0); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + } + + /* Valid indices. */ + for (i = 0; i < ARRAY_SIZE(valid_idx); ++i) + { + ret = SendMessageA(listbox, LB_SETITEMDATA, valid_idx[i], 42); + ok(ret == TRUE, "Unexpected return value %d.\n", ret); + ret = SendMessageA(listbox, LB_GETTEXTLEN, valid_idx[i], 0); + todo_wine_if(sizeof(void *) == 8) + ok(ret == sizeof(data), "Unexpected return value %d.\n", ret); + + memset(&data, 0xee, sizeof(data)); + ret = SendMessageA(listbox, LB_GETTEXT, valid_idx[i], (LPARAM)&data); + todo_wine_if(sizeof(void *) == 8) + ok(ret == sizeof(data), "Unexpected return value %d.\n", ret); + todo_wine + ok(!memcmp(&data, &zero_data, sizeof(data)), "Unexpected item data.\n"); + + ret = SendMessageA(listbox, LB_GETITEMDATA, valid_idx[i], 0); + todo_wine + ok(ret == 0, "Unexpected return value %d.\n", ret); + } + + /* More messages that don't work with LBS_NODATA. */ + ret = SendMessageA(listbox, LB_FINDSTRING, 1, 42); +todo_wine + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 42); +todo_wine + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 42); +todo_wine + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + + DestroyWindow(listbox); +} + START_TEST(listbox) { const struct listbox_test SS = /* {add_style} */ - {{0}, - {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, + {{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, { 1, 1, 1, LB_ERR}, {0,0,0,0}, { 2, 2, 2, LB_ERR}, {0,0,0,0}, {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}}; /* {selected, anchor, caret, selcount}{TODO fields} */ const struct listbox_test SS_NS = - {{LBS_NOSEL}, - {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, + {{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, { 1, 1, 1, LB_ERR}, {0,0,0,0}, { 2, 2, 2, LB_ERR}, {0,0,0,0}, {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}}; const struct listbox_test MS = - {{LBS_MULTIPLESEL}, - { 0, LB_ERR, 0, 0}, {0,0,0,0}, + {{ 0, LB_ERR, 0, 0}, {0,0,0,0}, { 1, 1, 1, 1}, {0,0,0,0}, { 2, 1, 2, 1}, {0,0,0,0}, { 0, LB_ERR, 0, 2}, {0,0,0,0}}; const struct listbox_test MS_NS = - {{LBS_MULTIPLESEL | LBS_NOSEL}, - {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, + {{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, { 1, 1, 1, LB_ERR}, {0,0,0,0}, { 2, 2, 2, LB_ERR}, {0,0,0,0}, {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}}; const struct listbox_test ES = - {{LBS_EXTENDEDSEL}, - { 0, LB_ERR, 0, 0}, {0,0,0,0}, + {{ 0, LB_ERR, 0, 0}, {0,0,0,0}, { 1, 1, 1, 1}, {0,0,0,0}, { 2, 2, 2, 1}, {0,0,0,0}, { 0, LB_ERR, 0, 2}, {0,0,0,0}}; const struct listbox_test ES_NS = - {{LBS_EXTENDEDSEL | LBS_NOSEL}, - {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, + {{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, { 1, 1, 1, LB_ERR}, {0,0,0,0}, { 2, 2, 2, LB_ERR}, {0,0,0,0}, {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}}; const struct listbox_test EMS = - {{LBS_EXTENDEDSEL | LBS_MULTIPLESEL}, - { 0, LB_ERR, 0, 0}, {0,0,0,0}, + {{ 0, LB_ERR, 0, 0}, {0,0,0,0}, { 1, 1, 1, 1}, {0,0,0,0}, { 2, 2, 2, 1}, {0,0,0,0}, { 0, LB_ERR, 0, 2}, {0,0,0,0}}; const struct listbox_test EMS_NS = - {{LBS_EXTENDEDSEL | LBS_MULTIPLESEL | LBS_NOSEL}, - {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, + {{LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}, { 1, 1, 1, LB_ERR}, {0,0,0,0}, { 2, 2, 2, LB_ERR}, {0,0,0,0}, {LB_ERR, LB_ERR, 0, LB_ERR}, {0,0,0,0}};
trace (" Testing single selection...\n"); - check (SS); + check (0, SS); + trace (" ... with NOSEL\n"); + check (LBS_NOSEL, SS_NS); + trace (" ... LBS_NODATA variant ...\n"); + check (LBS_NODATA | LBS_OWNERDRAWFIXED, SS); trace (" ... with NOSEL\n"); - check (SS_NS); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_NOSEL, SS_NS); + trace (" Testing multiple selection...\n"); - check (MS); + check (LBS_MULTIPLESEL, MS); + trace (" ... with NOSEL\n"); + check (LBS_MULTIPLESEL | LBS_NOSEL, MS_NS); + trace (" ... LBS_NODATA variant ...\n"); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_MULTIPLESEL, MS); trace (" ... with NOSEL\n"); - check (MS_NS); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_MULTIPLESEL | LBS_NOSEL, MS_NS); + trace (" Testing extended selection...\n"); - check (ES); + check (LBS_EXTENDEDSEL, ES); + trace (" ... with NOSEL\n"); + check (LBS_EXTENDEDSEL | LBS_NOSEL, ES_NS); + trace (" ... LBS_NODATA variant ...\n"); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_EXTENDEDSEL, ES); trace (" ... with NOSEL\n"); - check (ES_NS); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_EXTENDEDSEL | LBS_NOSEL, ES_NS); + trace (" Testing extended and multiple selection...\n"); - check (EMS); + check (LBS_EXTENDEDSEL | LBS_MULTIPLESEL, EMS); + trace (" ... with NOSEL\n"); + check (LBS_EXTENDEDSEL | LBS_MULTIPLESEL | LBS_NOSEL, EMS_NS); + trace (" ... LBS_NODATA variant ...\n"); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_EXTENDEDSEL | LBS_MULTIPLESEL, EMS); trace (" ... with NOSEL\n"); - check (EMS_NS); + check (LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_EXTENDEDSEL | LBS_MULTIPLESEL | LBS_NOSEL, EMS_NS);
check_item_height(); test_ownerdraw(); @@ -2129,4 +2208,5 @@ START_TEST(listbox) test_extents(); test_WM_MEASUREITEM(); test_LB_SETSEL(); + test_LBS_NODATA(); }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/tests/listbox.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 6e90d1d..dc5657c 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -264,6 +264,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA } else { + todo_wine_if((style & LBS_NODATA) && strings[mi->itemID]) ok((void*)mi->itemData == strings[mi->itemID], "mi->itemData = %08lx, expected %p\n", mi->itemData, strings[mi->itemID]); } @@ -2042,12 +2043,21 @@ static void test_WM_MEASUREITEM(void)
static void test_LBS_NODATA(void) { + static const DWORD invalid_styles[] = + { + 0, + LBS_OWNERDRAWVARIABLE, + LBS_SORT, + LBS_HASSTRINGS, + LBS_OWNERDRAWFIXED | LBS_SORT, + LBS_OWNERDRAWFIXED | LBS_HASSTRINGS, + }; static const UINT invalid_idx[] = { -2, 2 }; static const UINT valid_idx[] = { 0, 1 }; static const ULONG_PTR zero_data; + HWND listbox, parent; unsigned int i; ULONG_PTR data; - HWND listbox; INT ret;
listbox = CreateWindowA("listbox", "TestList", LBS_NODATA | LBS_OWNERDRAWFIXED | WS_VISIBLE, @@ -2110,6 +2120,28 @@ todo_wine ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
DestroyWindow(listbox); + + /* Invalid window style combinations. */ + parent = create_parent(); + ok(parent != NULL, "Failed to create parent window.\n"); + + for (i = 0; i < ARRAY_SIZE(invalid_styles); ++i) + { + DWORD style; + + listbox = CreateWindowA("listbox", "TestList", LBS_NODATA | WS_CHILD | invalid_styles[i], + 0, 0, 100, 100, parent, (HMENU)1, NULL, 0); + ok(listbox != NULL, "Failed to create a listbox.\n"); + + style = GetWindowLongA(listbox, GWL_STYLE); + ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#x.\n", i, style); + ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0); + todo_wine_if(i == 1 || i == 4) + ok(ret == LB_ERR, "%u: unexpected return value %d.\n", i, ret); + DestroyWindow(listbox); + } + + DestroyWindow(parent); }
START_TEST(listbox)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 2 ++ dlls/user32/tests/listbox.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index c8bd148..f021029 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2525,6 +2525,8 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc )
if (descr->style & LBS_OWNERDRAWFIXED) { + descr->style &= ~LBS_OWNERDRAWVARIABLE; + if( descr->lphc && (descr->lphc->dwStyle & CBS_DROPDOWN)) { /* WinWord gets VERY unhappy if we send WM_MEASUREITEM from here */ diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index dc5657c..776e3f3 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -374,6 +374,8 @@ static void test_ownerdraw(void) NULL, NULL, NULL, 0); ok(hLB != NULL, "last error 0x%08x\n", GetLastError());
+ ok(GetWindowLongA(hLB, GWL_STYLE) & LBS_OWNERDRAWVARIABLE, "Unexpected window style.\n"); + ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0); @@ -389,7 +391,6 @@ static void test_ownerdraw(void) ok(ret == LB_OKAY, "Failed to set item height, %d.\n", ret);
ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); -todo_wine ok(ret == 42, "Unexpected item height %d.\n", ret);
ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 1, 0);
Hi,
While running your changed tests on Windows, 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=44420
Your paranoid android.
=== debian9 (32 bit Wine report) ===
user32: msg.c:8263: Test failed: WaitForSingleObject failed 102 msg.c:8269: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8269: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8269: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
I don't know where these failures are from, my patches only update listbox.c, they're not even from the same file nor have anything to do with synchronization or w/e.
On Thu, Nov 15, 2018 at 12:14 PM Marvin testbot@winehq.org wrote:
Hi,
While running your changed tests on Windows, 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=44420
Your paranoid android.
=== debian9 (32 bit Wine report) ===
user32: msg.c:8263: Test failed: WaitForSingleObject failed 102 msg.c:8269: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8269: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8269: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
On Thu, 15 Nov 2018, Gabriel Ivăncescu wrote:
I don't know where these failures are from, my patches only update listbox.c, they're not even from the same file nor have anything to do with synchronization or w/e.
The patch series modifies dlls/user32/listbox.c, that is user32.dll, which, when running in Wine, could impact any of the user32 tests (*). So to make sure we don't miss new failures, when a patch modifies a dll the TestBot now reruns all of that dll's tests.
Of course it ignores existing errors but this is defined as errors that happened in the last WineTest run. But in this case the "WaitForSingleObject" and "destroy child on thread exit" errors are somewhat random and did not happen in the last WineTest run.
For the standard 32 bit tests, I find them on the 12th but not on the 13th or 14th:
12: https://test.winehq.org/data/ebae298aa4d2711fef35d4ac60c6012438f36d61/linux_... 13: https://test.winehq.org/data/ead7e637c0d18760acd446d686ad18526e76e0f0/linux_... 14: https://test.winehq.org/data/d9c7d4147b569553bc97ef57c6200002fe81565e/linux_...
Random errors are the bane of WineTest :-(
(*) It could even break things in other dlls in fact.
On Thu, Nov 15, 2018 at 1:50 PM Francois Gouget fgouget@codeweavers.com wrote:
On Thu, 15 Nov 2018, Gabriel Ivăncescu wrote:
I don't know where these failures are from, my patches only update listbox.c, they're not even from the same file nor have anything to do with synchronization or w/e.
The patch series modifies dlls/user32/listbox.c, that is user32.dll, which, when running in Wine, could impact any of the user32 tests (*). So to make sure we don't miss new failures, when a patch modifies a dll the TestBot now reruns all of that dll's tests.
Of course it ignores existing errors but this is defined as errors that happened in the last WineTest run. But in this case the "WaitForSingleObject" and "destroy child on thread exit" errors are somewhat random and did not happen in the last WineTest run.
For the standard 32 bit tests, I find them on the 12th but not on the 13th or 14th:
12: https://test.winehq.org/data/ebae298aa4d2711fef35d4ac60c6012438f36d61/linux_... 13: https://test.winehq.org/data/ead7e637c0d18760acd446d686ad18526e76e0f0/linux_... 14: https://test.winehq.org/data/d9c7d4147b569553bc97ef57c6200002fe81565e/linux_...
Random errors are the bane of WineTest :-(
(*) It could even break things in other dlls in fact.
-- Francois Gouget fgouget@codeweavers.com
Ah I see, thank you for the information. I guess these really are random errors though, not only because they seem totally unrelated to what is tested, but because the exact same diffs were sent yesterday for testing and had 0 failures.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index f021029..2fcd735 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2521,6 +2521,8 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc ) if (descr->style & LBS_EXTENDEDSEL) descr->style |= LBS_MULTIPLESEL; if (descr->style & LBS_MULTICOLUMN) descr->style &= ~LBS_OWNERDRAWVARIABLE; if (descr->style & LBS_OWNERDRAWVARIABLE) descr->style |= LBS_NOINTEGRALHEIGHT; + if ((descr->style & (LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_SORT)) != LBS_OWNERDRAWFIXED) + descr->style &= ~LBS_NODATA; descr->item_height = LISTBOX_SetFont( descr, 0 );
if (descr->style & LBS_OWNERDRAWFIXED)
Hi,
While running your changed tests on Windows, 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=44421
Your paranoid android.
=== debian9 (64 bit Wow Wine report) ===
user32: msg.c:8263: Test failed: WaitForSingleObject failed 102 msg.c:8269: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8269: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8269: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 2 +- dlls/user32/tests/listbox.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 2fcd735..b5b7dc6 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1757,7 +1757,7 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count ) { LRESULT ret;
- if (HAS_STRINGS(descr)) + if (!(descr->style & LBS_NODATA)) { SetLastError(ERROR_SETCOUNT_ON_BAD_LB); return LB_ERR; diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 776e3f3..813968f 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -264,7 +264,6 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA } else { - todo_wine_if((style & LBS_NODATA) && strings[mi->itemID]) ok((void*)mi->itemData == strings[mi->itemID], "mi->itemData = %08lx, expected %p\n", mi->itemData, strings[mi->itemID]); } @@ -1765,9 +1764,7 @@ static void test_set_count( void )
SetLastError( 0xdeadbeef ); ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); - todo_wine_if(i == 0) ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret ); - todo_wine_if(i == 0) ok( GetLastError() == ERROR_SETCOUNT_ON_BAD_LB, "Unexpected error %d.\n", GetLastError() );
DestroyWindow( listbox ); @@ -2137,7 +2134,6 @@ todo_wine style = GetWindowLongA(listbox, GWL_STYLE); ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#x.\n", i, style); ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0); - todo_wine_if(i == 1 || i == 4) ok(ret == LB_ERR, "%u: unexpected return value %d.\n", i, ret); DestroyWindow(listbox); }
Hi,
While running your changed tests on Windows, 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=44422
Your paranoid android.
=== debian9 (64 bit Wow Wine report) ===
user32: msg.c:8263: Test failed: WaitForSingleObject failed 102 msg.c:8269: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8269: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8269: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 6 +++--- dlls/user32/tests/listbox.c | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index b5b7dc6..5746293 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -799,8 +799,8 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL __ENDTRY } else { if (buffer) - *((LPDWORD)buffer)=*(LPDWORD)(&descr->items[index].data); - len = sizeof(DWORD); + *((ULONG_PTR *)buffer) = descr->items[index].data; + len = sizeof(ULONG_PTR); } return len; } @@ -2707,7 +2707,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam SetLastError(ERROR_INVALID_INDEX); return LB_ERR; } - if (!HAS_STRINGS(descr)) return sizeof(DWORD); + if (!HAS_STRINGS(descr)) return sizeof(ULONG_PTR); if (unicode) return strlenW( descr->items[wParam].str ); return WideCharToMultiByte( CP_ACP, 0, descr->items[wParam].str, strlenW(descr->items[wParam].str), NULL, 0, NULL, NULL ); diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 813968f..658893a 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -2091,12 +2091,10 @@ static void test_LBS_NODATA(void) ret = SendMessageA(listbox, LB_SETITEMDATA, valid_idx[i], 42); ok(ret == TRUE, "Unexpected return value %d.\n", ret); ret = SendMessageA(listbox, LB_GETTEXTLEN, valid_idx[i], 0); - todo_wine_if(sizeof(void *) == 8) ok(ret == sizeof(data), "Unexpected return value %d.\n", ret);
memset(&data, 0xee, sizeof(data)); ret = SendMessageA(listbox, LB_GETTEXT, valid_idx[i], (LPARAM)&data); - todo_wine_if(sizeof(void *) == 8) ok(ret == sizeof(data), "Unexpected return value %d.\n", ret); todo_wine ok(!memcmp(&data, &zero_data, sizeof(data)), "Unexpected item data.\n");
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 3 ++- dlls/user32/tests/listbox.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 5746293..044d73d 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -799,7 +799,8 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL __ENDTRY } else { if (buffer) - *((ULONG_PTR *)buffer) = descr->items[index].data; + *((ULONG_PTR *)buffer) = (descr->style & LBS_NODATA) + ? 0 : descr->items[index].data; len = sizeof(ULONG_PTR); } return len; diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 658893a..3c3de71 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -2096,7 +2096,6 @@ static void test_LBS_NODATA(void) memset(&data, 0xee, sizeof(data)); ret = SendMessageA(listbox, LB_GETTEXT, valid_idx[i], (LPARAM)&data); ok(ret == sizeof(data), "Unexpected return value %d.\n", ret); - todo_wine ok(!memcmp(&data, &zero_data, sizeof(data)), "Unexpected item data.\n");
ret = SendMessageA(listbox, LB_GETITEMDATA, valid_idx[i], 0);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 2 +- dlls/user32/tests/listbox.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 044d73d..d46f685 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2684,7 +2684,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam SetLastError(ERROR_INVALID_INDEX); return LB_ERR; } - return descr->items[wParam].data; + return (descr->style & LBS_NODATA) ? 0 : descr->items[wParam].data;
case LB_SETITEMDATA: if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items)) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 3c3de71..2115ee4 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -2099,7 +2099,6 @@ static void test_LBS_NODATA(void) ok(!memcmp(&data, &zero_data, sizeof(data)), "Unexpected item data.\n");
ret = SendMessageA(listbox, LB_GETITEMDATA, valid_idx[i], 0); - todo_wine ok(ret == 0, "Unexpected return value %d.\n", ret); }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 2 +- dlls/user32/tests/listbox.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index d46f685..7fc724c 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2692,7 +2692,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam SetLastError(ERROR_INVALID_INDEX); return LB_ERR; } - descr->items[wParam].data = lParam; + if (!(descr->style & LBS_NODATA)) descr->items[wParam].data = lParam; /* undocumented: returns TRUE, not LB_OKAY (0) */ return TRUE;
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 2115ee4..d0eb731 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -2104,13 +2104,10 @@ static void test_LBS_NODATA(void)
/* More messages that don't work with LBS_NODATA. */ ret = SendMessageA(listbox, LB_FINDSTRING, 1, 42); -todo_wine ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 42); -todo_wine ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 42); -todo_wine ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
DestroyWindow(listbox);
Hi,
While running your changed tests on Windows, 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=44426
Your paranoid android.
=== debian9 (32 bit Wine report) ===
user32: msg.c:8263: Test failed: WaitForSingleObject failed 102 msg.c:8269: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8269: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8269: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
=== debian9 (64 bit Wow Wine report) ===
user32: msg.c:8263: Test failed: WaitForSingleObject failed 102 msg.c:8269: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8269: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8269: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
With the user32 variant, it seems it sets the last error to ERROR_INVALID_PARAMETER, so it is skipped in HandleChar.
dlls/user32/listbox.c | 8 +++++++- dlls/user32/tests/listbox.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 7fc724c..286a33b 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -917,6 +917,12 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa INT i; LB_ITEMDATA *item;
+ if (descr->style & LBS_NODATA) + { + SetLastError(ERROR_INVALID_PARAMETER); + return LB_ERR; + } + if (start >= descr->nb_items) start = -1; item = descr->items + start + 1; if (HAS_STRINGS(descr)) @@ -2455,7 +2461,7 @@ static LRESULT LISTBOX_HandleChar( LB_DESCR *descr, WCHAR charW ) (LPARAM)descr->self ); if (caret == -2) return 0; } - if (caret == -1) + if (caret == -1 && !(descr->style & LBS_NODATA)) caret = LISTBOX_FindString( descr, descr->focus_item, str, FALSE); if (caret != -1) { diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index d0eb731..d13a4e3 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -2103,12 +2103,30 @@ static void test_LBS_NODATA(void) }
/* More messages that don't work with LBS_NODATA. */ + SetLastError(0xdeadbeef); + ret = SendMessageA(listbox, LB_FINDSTRING, 1, 0); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should return 0x57, got 0x%X\n", GetLastError()); + SetLastError(0xdeadbeef); ret = SendMessageA(listbox, LB_FINDSTRING, 1, 42); ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should return 0x57, got 0x%X\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 0); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should return 0x57, got 0x%X\n", GetLastError()); + SetLastError(0xdeadbeef); ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 42); ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should return 0x57, got 0x%X\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 0); + ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should return 0x57, got 0x%X\n", GetLastError()); + SetLastError(0xdeadbeef); ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 42); ok(ret == LB_ERR, "Unexpected return value %d.\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should return 0x57, got 0x%X\n", GetLastError());
DestroyWindow(listbox);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com