[PATCH 0/1] MR1829: user32/tests: Don't expect WM_DISPLAYCHANGE with the default display mode.
It looks like the behavior changes when only this test is run vs when it is run as part of the winetest suite. This is probably because ChangeDisplaySettingsExW only sends the message the first time it is called (since boot?). Having other tests run before it, one of them probably changed display settings already and we're not getting the message anymore. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53894 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1829
From: Rémi Bernon <rbernon(a)codeweavers.com> It looks like the behavior changes when only this test is run vs when it is run as part of the winetest suite. This is probably because ChangeDisplaySettingsExW only sends the message the first time it is called (since boot?). Having other tests run before it, one of them probably changed display settings already and we're not getting the message anymore. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53894 --- dlls/user32/tests/sysparams.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index a53c43b391a..debe05c42a3 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -2463,16 +2463,19 @@ static void test_WM_DISPLAYCHANGE(void) ok( settings.dmBitsPerPel == 32, "got dmBitsPerPel %lu\n", settings.dmBitsPerPel ); default_bpp = settings.dmBitsPerPel; - /* setting the default mode here sends a WM_DISPLAYCHANGE */ + /* setting default mode most of the time doesn't send WM_DISPLAYCHANGE, + * it only does the first time ChangeDisplaySettingsExW is called */ last_bpp = -1; change_counter = 0; displaychange_ok = TRUE; res = ChangeDisplaySettingsExW( NULL, &settings, NULL, 0, NULL ); ok( !res, "ChangeDisplaySettingsExW returned %ld\n", res ); - res = WaitForSingleObject( displaychange_sem, 10000 ); - ok( !res, "WaitForSingleObject returned %#lx\n", res ); - ok( last_bpp == default_bpp, "got WM_DISPLAYCHANGE bpp %u\n", last_bpp ); + res = WaitForSingleObject( displaychange_sem, 1000 ); + todo_wine + ok( res == WAIT_TIMEOUT || broken( !res ), "WaitForSingleObject returned %#lx\n", res ); + todo_wine + ok( last_bpp == -1 || broken( last_bpp == default_bpp ), "got WM_DISPLAYCHANGE bpp %u\n", last_bpp ); displaychange_ok = FALSE; for (i = 0; i < ARRAY_SIZE(test_bpps); i++) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1829
Sven Baars (@sbaars) commented about dlls/user32/tests/sysparams.c:
+ /* setting default mode most of the time doesn't send WM_DISPLAYCHANGE, + * it only does the first time ChangeDisplaySettingsExW is called */
last_bpp = -1; change_counter = 0; displaychange_ok = TRUE; res = ChangeDisplaySettingsExW( NULL, &settings, NULL, 0, NULL ); ok( !res, "ChangeDisplaySettingsExW returned %ld\n", res ); - res = WaitForSingleObject( displaychange_sem, 10000 ); - ok( !res, "WaitForSingleObject returned %#lx\n", res ); - ok( last_bpp == default_bpp, "got WM_DISPLAYCHANGE bpp %u\n", last_bpp ); + res = WaitForSingleObject( displaychange_sem, 1000 ); + todo_wine + ok( res == WAIT_TIMEOUT || broken( !res ), "WaitForSingleObject returned %#lx\n", res ); + todo_wine + ok( last_bpp == -1 || broken( last_bpp == default_bpp ), "got WM_DISPLAYCHANGE bpp %u\n", last_bpp ); While you're at it, maybe it's a good idea to change all the `%u` in the test to `%d` since `last_bpp` is signed?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1829#note_19750
participants (2)
-
Rémi Bernon -
Sven Baars (@sbaars)