From c357f3670f71f3fc40aad0d89f3c9553e653c246 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Wed, 31 Oct 2018 21:01:40 +1100 Subject: [PATCH] dinput/tests: Test that the GUID is the same for Instance and Product. Signed-off-by: Brendan McGrath Signed-off-by: Alexandre Julliard --- dlls/dinput/tests/dinput.c | 11 +++++++++++ dlls/dinput8/tests/dinput.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/dlls/dinput/tests/dinput.c b/dlls/dinput/tests/dinput.c index 7e2da9ff32d..d9d327931eb 100644 --- a/dlls/dinput/tests/dinput.c +++ b/dlls/dinput/tests/dinput.c @@ -392,6 +392,17 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo { struct enum_devices_test *enum_test = context; + if ((instance->dwDevType & 0xff) == DIDEVTYPE_KEYBOARD || + (instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE) { + const char *device = ((instance->dwDevType & 0xff) == + DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse"; + todo_wine + ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct), + "%s guidInstance (%s) does not match guidProduct (%s)\n", + device, wine_dbgstr_guid(&instance->guidInstance), + wine_dbgstr_guid(&instance->guidProduct)); + } + enum_test->device_count++; return enum_test->return_value; } diff --git a/dlls/dinput8/tests/dinput.c b/dlls/dinput8/tests/dinput.c index b093437096d..403c4a84697 100644 --- a/dlls/dinput8/tests/dinput.c +++ b/dlls/dinput8/tests/dinput.c @@ -377,6 +377,17 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo instance->wUsagePage, instance->wUsage); + if ((instance->dwDevType & 0xff) == DI8DEVTYPE_KEYBOARD || + (instance->dwDevType & 0xff) == DI8DEVTYPE_MOUSE) { + const char *device = ((instance->dwDevType & 0xff) == + DI8DEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse"; + todo_wine + ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct), + "%s guidInstance (%s) does not match guidProduct (%s)\n", + device, wine_dbgstr_guid(&instance->guidInstance), + wine_dbgstr_guid(&instance->guidProduct)); + } + enum_test->device_count++; return enum_test->return_value; }