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

Alexandre Julliard julliard at winehq.org
Thu Sep 30 16:04:42 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Sep 30 10:37:39 2021 +0200

dinput8/tests: Add some HID joystick IDirectInputDevice8_SendDeviceData 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 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 43834d1f602..7e48a7ef5d6 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -4658,6 +4658,21 @@ static void test_simple_joystick(void)
     todo_wine
     ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
 
+    objdata[0].dwOfs = 0xd;
+    objdata[0].dwData = 0x80;
+    res = 1;
+    hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0xdeadbeef );
+    todo_wine
+    ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+    res = 1;
+    hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 1 /*DISDD_CONTINUE*/ );
+    todo_wine
+    ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+    res = 1;
+    hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+    todo_wine
+    ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+
     hr = IDirectInputDevice8_Unacquire( device );
     ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
 
@@ -5518,6 +5533,7 @@ static void test_force_feedback_joystick( void )
         },
     };
     WCHAR cwd[MAX_PATH], tempdir[MAX_PATH];
+    DIDEVICEOBJECTDATA objdata = {0};
     DIDEVICEINSTANCEW devinst = {0};
     DIEFFECTINFOW effectinfo = {0};
     IDirectInputDevice8W *device;
@@ -5737,6 +5753,13 @@ static void test_force_feedback_joystick( void )
     todo_wine
     ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
 
+    objdata.dwOfs = 0x16;
+    objdata.dwData = 0x80;
+    res = 1;
+    hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), &objdata, &res, 0 );
+    todo_wine
+    ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr );
+
     set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
     hr = IDirectInputDevice8_Unacquire( device );
     ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );




More information about the wine-cvs mailing list