Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d9/tests/device.c | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 03ebe242e9..c59a09d839 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -3476,6 +3476,47 @@ err_out: IDirect3D9_Release(d3d9_ptr); }
+static void test_multi_adapter(void) +{ + UINT adapter_count, expected_adapter_count = 0; + DISPLAY_DEVICEA display_device; + MONITORINFO monitor_info; + HMONITOR monitor; + IDirect3D9 *d3d9; + UINT i; + + d3d9 = Direct3DCreate9(D3D_SDK_VERSION); + ok(d3d9 != NULL, "Failed to create a D3D object.\n"); + + display_device.cb = sizeof(display_device); + for (i = 0; EnumDisplayDevicesA(NULL, i, &display_device, 0); ++i) + { + if (display_device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) + ++expected_adapter_count; + } + + adapter_count = IDirect3D9_GetAdapterCount(d3d9); + todo_wine_if(expected_adapter_count > 1) + ok(adapter_count == expected_adapter_count, "Expect adapter count %d, got %d\n", + expected_adapter_count, adapter_count); + + for (i = 0; i < adapter_count; ++i) + { + monitor = IDirect3D9_GetAdapterMonitor(d3d9, i); + ok(monitor != NULL, "IDirect3D9_GetAdapterMonitor failed\n"); + + monitor_info.cbSize = sizeof(monitor_info); + ok(GetMonitorInfoA(monitor, &monitor_info), "GetMonitorInfoA failed, error %#x.\n", GetLastError()); + + if (i == 0) + ok(monitor_info.dwFlags == MONITORINFOF_PRIMARY, "Expect adapter is primary.\n"); + else + ok(monitor_info.dwFlags == 0, "Expect adapter is non-primary.\n"); + } + + IDirect3D9_Release(d3d9); +} + static void test_multi_device(void) { IDirect3DDevice9 *device1, *device2; @@ -13441,6 +13482,7 @@ START_TEST(device) test_vertex_declaration_alignment(); test_unused_declaration_type(); test_fpu_setup(); + test_multi_adapter(); test_multi_device(); test_display_formats(); test_display_modes();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64577
Your paranoid android.
=== w1064v1809_he (32 bit report) ===
d3d9: device.c:9804: Test failed: Failed to update texture, hr 0x80004005, case 6. device.c:9804: Test failed: Failed to update texture, hr 0x80004005, case 7.