Stefan Dösinger : d3d9/tests: Try to make test_cursor_pos more reliable.
Alexandre Julliard
julliard at winehq.org
Mon Jan 31 15:55:18 CST 2022
Module: wine
Branch: master
Commit: ead1672c0ed36b91d6f0280084454f9a1010f757
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ead1672c0ed36b91d6f0280084454f9a1010f757
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Jan 31 13:19:42 2022 +0300
d3d9/tests: Try to make test_cursor_pos more reliable.
Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d9/tests/device.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index c480a9d163e..d4ff9d0e4ed 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -5197,6 +5197,20 @@ static void test_cursor_pos(void)
{0, 0},
};
+ /* Windows 10 1709 is unreliable. One or more of the cursor movements we
+ * expect don't show up. Moving the mouse to a defined position beforehand
+ * seems to get it into better shape - only the final 150x150 move we do
+ * below is missing - it looks as if this Windows version filters redundant
+ * SetCursorPos calls on the user32 level, although I am not entirely sure.
+ *
+ * The weird thing is that the previous test leaves the cursor position
+ * reliably at 512x384 on the testbot. So the 50x50 mouse move shouldn't
+ * be stripped away anyway, but it might be a difference between moving the
+ * cursor through SetCursorPos vs moving it by changing the display mode. */
+ ret = SetCursorPos(99, 99);
+ ok(ret, "Failed to set cursor position.\n");
+ flush_events();
+
wc.lpfnWndProc = test_cursor_proc;
wc.lpszClassName = "d3d9_test_cursor_wc";
ok(RegisterClassA(&wc), "Failed to register window class.\n");
@@ -5231,7 +5245,8 @@ static void test_cursor_pos(void)
IDirect3DDevice9_SetCursorPosition(device, 75, 75, 0);
flush_events();
- /* SetCursorPosition() eats duplicates. */
+ /* SetCursorPosition() eats duplicates. FIXME: Since we accept unexpected
+ * mouse moves the test doesn't actually demonstrate that. */
IDirect3DDevice9_SetCursorPosition(device, 75, 75, 0);
flush_events();
@@ -5252,13 +5267,14 @@ static void test_cursor_pos(void)
IDirect3DDevice9_SetCursorPosition(device, 150, 150, 0);
flush_events();
- /* SetCursorPos() doesn't. */
+ /* SetCursorPos() doesn't. Except for Win10 1709. */
ret = SetCursorPos(150, 150);
ok(ret, "Failed to set cursor position.\n");
flush_events();
- ok(!expect_pos->x && !expect_pos->y, "Didn't receive MOUSEMOVE %u (%d, %d).\n",
- (unsigned)(expect_pos - points), expect_pos->x, expect_pos->y);
+ ok((!expect_pos->x && !expect_pos->y) || broken(expect_pos - points == 7),
+ "Didn't receive MOUSEMOVE %u (%d, %d).\n",
+ (unsigned)(expect_pos - points), expect_pos->x, expect_pos->y);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
More information about the wine-cvs
mailing list