=?UTF-8?Q?R=C3=A9mi=20Bernon=20?=: dinput8/tests: Add window name and window class name test.

Alexandre Julliard julliard at winehq.org
Tue Aug 27 15:28:16 CDT 2019


Module: wine
Branch: master
Commit: e001daf5c1f3455ea126a12d92508e5b5d4c5463
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e001daf5c1f3455ea126a12d92508e5b5d4c5463

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Aug 26 16:06:57 2019 +0200

dinput8/tests: Add window name and window class name test.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput8/tests/device.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
index cd86289..0bf6936 100644
--- a/dlls/dinput8/tests/device.c
+++ b/dlls/dinput8/tests/device.c
@@ -628,7 +628,20 @@ static void test_mouse_keyboard(void)
     ok(raw_devices_count == 0, "Unexpected raw devices registered: %d\n", raw_devices_count);
 
     if (raw_devices[0].hwndTarget != NULL)
+    {
+        WCHAR di_hwnd_class[] = {'D','I','E','m','W','i','n',0};
+        WCHAR str[16];
+        int i;
+
         di_hwnd = raw_devices[0].hwndTarget;
+        i = GetClassNameW(di_hwnd, str, ARRAY_SIZE(str));
+        ok(i == lstrlenW(di_hwnd_class), "GetClassName returned incorrect length\n");
+        ok(!lstrcmpW(di_hwnd_class, str), "GetClassName returned incorrect name for this window's class\n");
+
+        i = GetWindowTextW(di_hwnd, str, ARRAY_SIZE(str));
+        ok(i == lstrlenW(di_hwnd_class), "GetClassName returned incorrect length\n");
+        ok(!lstrcmpW(di_hwnd_class, str), "GetClassName returned incorrect name for this window's class\n");
+    }
 
     hr = IDirectInputDevice8_Acquire(di_mouse);
     ok(SUCCEEDED(hr), "IDirectInputDevice8_Acquire failed: %08x\n", hr);




More information about the wine-cvs mailing list