From: Jetro Jormalainen Subject: [4/4] dinput8/tests: Add test for username in EnumDevicesBySemantics. Message-Id: <20170222232221.5615-4-jje-wine@jv.jetro.fi> Date: Thu, 23 Feb 2017 01:22:21 +0200 In-Reply-To: <20170222232221.5615-1-jje-wine@jv.jetro.fi> References: <20170222232221.5615-1-jje-wine@jv.jetro.fi> Tested on Windows 10, Windows XP and Arch Linux. Signed-off-by: Jetro Jormalainen --- dlls/dinput8/tests/dinput.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/dinput8/tests/dinput.c b/dlls/dinput8/tests/dinput.c index 18f3001596..e16542ab13 100644 --- a/dlls/dinput8/tests/dinput.c +++ b/dlls/dinput8/tests/dinput.c @@ -562,6 +562,13 @@ static void test_EnumDevicesBySemantics(void) /* Keep the device total */ device_total = data.device_count; + /* There should be no devices for any user. No device should be enumerated with DIEDBSFL_THISUSER. + MSDN defines that all unowned devices are also enumerated but this doesn't seem to be happening. */ + data.device_count = 0; + hr = IDirectInput8_EnumDevicesBySemantics(pDI, "Sh4d0w M4g3", &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER); + ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr); + ok (data.device_count == 0, "No devices should be assigned for this user assigned=%d\n", data.device_count); + /* This enumeration builds and sets the action map for all devices with a NULL username */ hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, set_action_map_callback, &data, DIEDBSFL_ATTACHEDONLY); ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr); @@ -570,7 +577,7 @@ static void test_EnumDevicesBySemantics(void) data.device_count = 0; hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, &data, DIEDBSFL_AVAILABLEDEVICES); ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr); - todo_wine ok (data.device_count == 0, "No device should be available after action mapping available=%d\n", data.device_count); + ok (data.device_count == 0, "No device should be available after action mapping available=%d\n", data.device_count); /* Now we'll give all the devices to a specific user */ data.username = "Sh4d0w M4g3"; @@ -593,7 +600,7 @@ static void test_EnumDevicesBySemantics(void) data.device_count = 0; hr = IDirectInput8_EnumDevicesBySemantics(pDI, "Ninja Brian", &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER); ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr); - todo_wine ok (data.device_count == 0, "This user should own no devices owned=%d\n", data.device_count); + ok (data.device_count == 0, "This user should own no devices owned=%d\n", data.device_count); /* Sh4d0w M4g3 has ownership of all devices */ data.device_count = 0; -- 2.11.0