Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputDevice8_SetEventNotification tests.

Alexandre Julliard julliard at winehq.org
Thu Sep 16 15:34:30 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Sep 16 10:20:41 2021 +0200

dinput8/tests: Add some HID joystick IDirectInputDevice8_SetEventNotification tests.

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

---

 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 2bbf7a9e978..fbf1b894fd1 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -3405,6 +3405,7 @@ static void test_simple_joystick(void)
     IDirectInputDevice8W *device;
     DIDEVCAPS caps = {0};
     IDirectInput8W *di;
+    HANDLE event;
     HRESULT hr;
     WCHAR *tmp;
     ULONG ref;
@@ -3691,9 +3692,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 );
 




More information about the wine-cvs mailing list