From: Paul Gofman pgofman@codeweavers.com
--- dlls/dinput/tests/joystick8.c | 39 ++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index b5ec94f4876..bc4a00410ef 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -6013,6 +6013,39 @@ static void test_joystick_id(void) desc.attributes = default_attributes; desc2 = desc; desc2.attributes.ProductID++; + + d.di8 = di8; + +if(1){ + desc.attributes.ProductID = 1; + if (!hid_device_start( &desc, 1 )) goto done; + trace("----1.\n"); + d.default_instance_found = FALSE; + hr = IDirectInput8_EnumDevices( di8, DI8DEVCLASS_GAMECTRL, select_default_instance, &d, DIEDFL_ALLDEVICES ); + ok( hr == DI_OK, "got hr %#lx.\n", hr ); + hid_device_stop( &desc, 1 ); + + desc.attributes.ProductID = 2; + if (!hid_device_start( &desc, 1 )) goto done; + trace("----2.\n"); + d.default_instance_found = FALSE; + hr = IDirectInput8_EnumDevices( di8, DI8DEVCLASS_GAMECTRL, select_default_instance, &d, DIEDFL_ALLDEVICES ); + ok( hr == DI_OK, "got hr %#lx.\n", hr ); + desc.attributes.ProductID = 1; + if (!hid_device_start( &desc, 1 )) goto done; + trace("----3.\n"); + d.default_instance_found = FALSE; + hr = IDirectInput8_EnumDevices( di8, DI8DEVCLASS_GAMECTRL, select_default_instance, &d, DIEDFL_ALLDEVICES ); + ok( hr == DI_OK, "got hr %#lx.\n", hr ); + hid_device_stop( &desc, 1 ); + desc.attributes.ProductID = 2; + hid_device_stop( &desc, 1 ); + IDirectInput8_Release( di8 ); + return; +} + + + if (!hid_device_start( &desc, 1 )) goto done; if (!hid_device_start( &desc2, 1 )) goto done;
@@ -6045,6 +6078,7 @@ static void test_joystick_id(void) ok( hr == DIERR_DEVICENOTREG, "got %#lx.\n", hr );
done: +trace("qqqq.\n"); IDirectInput8_Release( di8 ); hid_device_stop( &desc, 1 ); hid_device_stop( &desc2, 1 ); @@ -6062,7 +6096,10 @@ START_TEST( joystick8 )
dinput_test_init(); if (!bus_device_start()) goto done; - winetest_mute_threshold = 3; + winetest_mute_threshold = 3000000; + +test_joystick_id(); +goto done;
if (test_device_types( 0x800 )) {