[PATCH 1/7] d3d8/tests: Fix possible test failures.

Henri Verbeet hverbeet at gmail.com
Mon Mar 30 11:00:32 CDT 2020


On Mon, 30 Mar 2020 at 11:48, Zhiyi Zhang <zzhang at 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.)



More information about the wine-devel mailing list