Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d8/tests/device.c | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 80bf62e361..c897341629 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9760,6 +9760,47 @@ static void test_get_display_mode(void) DestroyWindow(window); }
+static void test_multi_adapter(void) +{ + UINT adapter_count, expected_adapter_count = 0; + DISPLAY_DEVICEA display_device; + MONITORINFO monitor_info; + HMONITOR monitor; + IDirect3D8 *d3d8; + DWORD i; + + d3d8 = Direct3DCreate8(D3D_SDK_VERSION); + ok(d3d8 != 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 = IDirect3D8_GetAdapterCount(d3d8); + todo_wine_if(expected_adapter_count > 1) + ok(adapter_count == expected_adapter_count, "Expect adapter count %u, got %u.\n", + expected_adapter_count, adapter_count); + + for (i = 0; i < adapter_count; ++i) + { + monitor = IDirect3D8_GetAdapterMonitor(d3d8, i); + ok(monitor != NULL, "IDirect3D8_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"); + } + + IDirect3D8_Release(d3d8); +} + START_TEST(device) { HMODULE d3d8_handle = GetModuleHandleA("d3d8.dll"); @@ -9876,6 +9917,7 @@ START_TEST(device) test_multiply_transform(); test_draw_primitive(); test_get_display_mode(); + test_multi_adapter();
UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); }
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=64576
Your paranoid android.
=== w1064v1809_ar (32 bit report) ===
d3d8: device.c:999: Test failed: The cursor handle is 00010003
=== w1064v1809_he (32 bit report) ===
d3d8: device.c:3787: Test failed: Expected device window style 0x14cf0000, got 0x14000000. device.c:3791: Test failed: Expected device window extended style 0x108, got 0x8. device.c:3805: Test failed: Client rect and window rect are equal. device.c:6611: Test failed: Failed to update texture, hr 0x80004005, case 6. device.c:6611: Test failed: Failed to update texture, hr 0x80004005, case 7.