[DINPUT_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924

svn path=/trunk/; revision=68520
This commit is contained in:
Amine Khaldi 2015-07-21 23:23:09 +00:00
parent 016d59d5d7
commit cc62311c13
2 changed files with 21 additions and 1 deletions

View file

@ -540,7 +540,6 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
dip_gain_set.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dip_gain_set.diph.dwObj = 0;
dip_gain_set.diph.dwHow = DIPH_DEVICE;
dip_gain_set.dwData = 10000;
dip_gain_get.diph.dwSize = sizeof(DIPROPDWORD);
dip_gain_get.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dip_gain_get.diph.dwObj = 0;

View file

@ -95,6 +95,27 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
for (i = 0; i < sizeof(custom_state) / sizeof(custom_state[0]); i++)
ok(custom_state[i] == 0, "Should be zeroed, got 0x%08x\n", custom_state[i]);
/* simulate some keyboard input */
SetFocus(hwnd);
keybd_event('Q', 0, 0, 0);
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state);
ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState() failed: %08x\n", hr);
if (!custom_state[0])
win_skip("Keyboard event not processed, skipping test\n");
else
{
/* unacquiring should reset the device state */
hr = IDirectInputDevice_Unacquire(pKeyboard);
ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr);
hr = IDirectInputDevice_Acquire(pKeyboard);
ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %08x\n", hr);
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state);
ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState failed: %08x\n", hr);
for (i = 0; i < sizeof(custom_state) / sizeof(custom_state[0]); i++)
ok(custom_state[i] == 0, "Should be zeroed, got 0x%08x\n", custom_state[i]);
}
keybd_event('Q', 0, KEYEVENTF_KEYUP, 0);
if (pKeyboard) IUnknown_Release(pKeyboard);
}