Akihiro Sagawa : dinput/tests: Add more tests for keyboard subtypes.

Alexandre Julliard julliard at winehq.org
Sun Mar 3 13:21:29 CST 2019


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

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Fri Aug 17 17:14:52 2018 +0900

dinput/tests: Add more tests for keyboard subtypes.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 937dcde349781025ea4d6aa9e4d928f3d9836ac8)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/dinput/tests/keyboard.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput/tests/keyboard.c b/dlls/dinput/tests/keyboard.c
index 72b23e7..a60342d 100644
--- a/dlls/dinput/tests/keyboard.c
+++ b/dlls/dinput/tests/keyboard.c
@@ -207,6 +207,7 @@ static void test_capabilities(IDirectInputA *pDI, HWND hwnd)
     HRESULT hr;
     IDirectInputDeviceA *pKeyboard = NULL;
     DIDEVCAPS caps;
+    int kbd_type, kbd_subtype, dev_subtype;
 
     hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL);
     ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr);
@@ -219,8 +220,21 @@ static void test_capabilities(IDirectInputA *pDI, HWND hwnd)
     ok (caps.dwFlags & DIDC_ATTACHED, "GetCapabilities dwFlags: 0x%08x\n", caps.dwFlags);
     ok (GET_DIDEVICE_TYPE(caps.dwDevType) == DIDEVTYPE_KEYBOARD,
         "GetCapabilities invalid device type for dwDevType: 0x%08x\n", caps.dwDevType);
-    ok (GET_DIDEVICE_SUBTYPE(caps.dwDevType) != DIDEVTYPEKEYBOARD_UNKNOWN,
-        "GetCapabilities invalid device subtype for dwDevType: 0x%08x\n", caps.dwDevType);
+    kbd_type = GetKeyboardType(0);
+    kbd_subtype = GetKeyboardType(1);
+    dev_subtype = GET_DIDEVICE_SUBTYPE(caps.dwDevType);
+    if (kbd_type == 4 || (kbd_type == 7 && kbd_subtype == 0))
+        ok (dev_subtype == DIDEVTYPEKEYBOARD_PCENH,
+            "GetCapabilities invalid device subtype for dwDevType: 0x%08x (%04x:%04x)\n",
+            caps.dwDevType, kbd_type, kbd_subtype);
+    else if (kbd_type == 7 && kbd_subtype == 2)
+        todo_wine ok (dev_subtype == DIDEVTYPEKEYBOARD_JAPAN106,
+            "GetCapabilities invalid device subtype for dwDevType: 0x%08x (%04x:%04x)\n",
+            caps.dwDevType, kbd_type, kbd_subtype);
+    else
+        ok (dev_subtype != DIDEVTYPEKEYBOARD_UNKNOWN,
+            "GetCapabilities invalid device subtype for dwDevType: 0x%08x (%04x:%04x)\n",
+            caps.dwDevType, kbd_type, kbd_subtype);
 
     IUnknown_Release(pKeyboard);
 }




More information about the wine-cvs mailing list