Module: wine Branch: master Commit: 937dcde349781025ea4d6aa9e4d928f3d9836ac8 URL: https://source.winehq.org/git/wine.git/?a=commit;h=937dcde349781025ea4d6aa9e...
Author: Akihiro Sagawa sagawa.aki@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@gmail.com Signed-off-by: Alexandre Julliard julliard@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 535f0bd..f7923d3 100644 --- a/dlls/dinput/tests/keyboard.c +++ b/dlls/dinput/tests/keyboard.c @@ -263,6 +263,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); @@ -275,8 +276,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); }