expect_messages points to a local variable. When it go out of scope, it reads into random memory, causing failures.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d8/tests/device.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index d87832b716..2b7a768f65 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -3200,6 +3200,7 @@ static void test_wndproc(void) flush_events(); ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it, i=%u.\n", expect_messages->message, expect_messages->window, i); + expect_messages = NULL;
/* World of Warplanes hides the window by removing WS_VISIBLE and expects Reset() to show it again. */ device_style = GetWindowLongA(device_window, GWL_STYLE); @@ -3219,6 +3220,7 @@ static void test_wndproc(void) flush_events(); ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it.\n", expect_messages->message, expect_messages->window); + expect_messages = NULL;
ok(windowpos.hwnd == device_window && !windowpos.hwndInsertAfter && !windowpos.x && !windowpos.y && !windowpos.cx && !windowpos.cy
Hi,
While running your changed tests, 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=68431
Your paranoid android.
=== w1064v1809_2scr (32 bit report) ===
d3d8: device.c:1002: Test failed: The cursor handle is 00010005
On Mon, 30 Mar 2020 at 11:48, Zhiyi Zhang zzhang@codeweavers.com wrote:
@@ -3200,6 +3200,7 @@ static void test_wndproc(void) flush_events(); ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it, i=%u.\n", expect_messages->message, expect_messages->window, i);
expect_messages = NULL;
/* World of Warplanes hides the window by removing WS_VISIBLE and expects Reset() to show it again. */ device_style = GetWindowLongA(device_window, GWL_STYLE);
@@ -3219,6 +3220,7 @@ static void test_wndproc(void) flush_events(); ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it.\n", expect_messages->message, expect_messages->window);
expect_messages = NULL;
ok(windowpos.hwnd == device_window && !windowpos.hwndInsertAfter && !windowpos.x && !windowpos.y && !windowpos.cx && !windowpos.cy
We should probably clear "expect_messages" before creating windows that use test_proc(), instead of relying on the preceding tests to clean things up properly. That's not to say we shouldn't clear "expect_messages" at the "done:" label in test_wndproc() like we do for "filter_messages" as well though. Also, mode_change_messages[] and mode_change_messages_hidden[] should be static const. (The reason they aren't already is probably "windowpos", but there is no particular reason that couldn't be static as well.)