[PATCH 4/6] dinput8/tests: Add some HID joystick IDirectInputDevice8_SetEventNotification tests.

Rémi Bernon rbernon at codeweavers.com
Thu Sep 16 03:20:41 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/dinput8/tests/hid.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 479f3a4f99a..ab3f4b933ef 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -3413,6 +3413,7 @@ static void test_simple_joystick(void)
     IDirectInputDevice8W *device;
     DIDEVCAPS caps = {0};
     IDirectInput8W *di;
+    HANDLE event;
     HRESULT hr;
     WCHAR *tmp;
     ULONG ref;
@@ -3699,9 +3700,19 @@ static void test_simple_joystick(void)
     hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 );
     ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
 
+    hr = IDirectInputDevice8_SetEventNotification( device, (HANDLE)0xdeadbeef );
+    todo_wine
+    ok( hr == E_HANDLE, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr );
+    event = CreateEventW( NULL, FALSE, FALSE, NULL );
+    ok( event != NULL, "CreateEventW failed, last error %u\n", GetLastError() );
+    hr = IDirectInputDevice8_SetEventNotification( device, event );
+    ok( hr == DI_OK, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr );
+
     ref = IDirectInputDevice8_Release( device );
     ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
 
+    CloseHandle( event );
+
     ref = IDirectInput8_Release( di );
     ok( ref == 0, "IDirectInput8_Release returned %d\n", ref );
 
-- 
2.33.0




More information about the wine-devel mailing list