Ivo Ivanov : dinput8/tests: Add a device gain report to test_device_managed_effect.

Alexandre Julliard julliard at winehq.org
Wed Dec 1 15:23:49 CST 2021


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

Author: Ivo Ivanov <logos128 at gmail.com>
Date:   Wed Dec  1 12:44:54 2021 +0100

dinput8/tests: Add a device gain report to test_device_managed_effect.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52062
Signed-off-by: Ivo Ivanov <logos128 at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput8/tests/hid.c | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index c0bfc8e8b30..57e5672bd92 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -8462,6 +8462,20 @@ static void test_device_managed_effect(void)
                 OUTPUT(1, Data|Var|Abs),
             END_COLLECTION,
 
+            USAGE(1, PID_USAGE_DEVICE_GAIN_REPORT),
+            COLLECTION(1, Logical),
+                REPORT_ID(1, 6),
+
+                USAGE(1, PID_USAGE_DEVICE_GAIN),
+                LOGICAL_MINIMUM(1, 0),
+                LOGICAL_MAXIMUM(2, 0x00ff),
+                PHYSICAL_MINIMUM(1, 0),
+                PHYSICAL_MAXIMUM(2, 0x2710),
+                REPORT_SIZE(1, 8),
+                REPORT_COUNT(1, 1),
+                OUTPUT(1, Data|Var|Abs),
+            END_COLLECTION,
+
             USAGE(1, PID_USAGE_POOL_REPORT),
             COLLECTION(1, Logical),
                 REPORT_ID(1, 1),
@@ -8558,6 +8572,23 @@ static void test_device_managed_effect(void)
     {
         .InputReportByteLength = 5,
     };
+    struct hid_expect expect_acquire[] =
+    {
+        /* device reset */
+        {
+            .code = IOCTL_HID_WRITE_REPORT,
+            .report_id = 1,
+            .report_len = 2,
+            .report_buf = {1, 0x01},
+        },
+        /* device gain */
+        {
+            .code = IOCTL_HID_WRITE_REPORT,
+            .report_id = 6,
+            .report_len = 2,
+            .report_buf = {6, 0xff},
+        },
+    };
     struct hid_expect expect_reset[] =
     {
         /* device reset */
@@ -8835,7 +8866,7 @@ static void test_device_managed_effect(void)
     hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET );
     ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "SendForceFeedbackCommand returned %#x\n", hr );
 
-    set_hid_expect( file, expect_reset, sizeof(expect_reset) );
+    set_hid_expect( file, expect_acquire, sizeof(expect_acquire) );
     hr = IDirectInputDevice8_Acquire( device );
     ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
     wait_hid_expect( file, 100 );
@@ -8901,7 +8932,7 @@ static void test_device_managed_effect(void)
     hr = IDirectInputEffect_GetEffectStatus( effect, &res );
     ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetEffectStatus returned %#x\n", hr );
 
-    set_hid_expect( file, expect_reset, sizeof(expect_reset) );
+    set_hid_expect( file, expect_acquire, sizeof(expect_acquire) );
     hr = IDirectInputDevice8_Acquire( device );
     ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
     wait_hid_expect( file, 100 );




More information about the wine-cvs mailing list