Commit 63d98c75 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

d3d9/tests: Add multiple adapters tests.

parent c70222bf
...@@ -13405,6 +13405,48 @@ static void test_get_display_mode(void) ...@@ -13405,6 +13405,48 @@ static void test_get_display_mode(void)
DestroyWindow(window); DestroyWindow(window);
} }
static void test_multi_adapter(void)
{
unsigned int i, adapter_count, expected_adapter_count = 0;
DISPLAY_DEVICEA display_device;
MONITORINFO monitor_info;
HMONITOR monitor;
IDirect3D9 *d3d;
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "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(d3d);
todo_wine_if(expected_adapter_count > 1)
ok(adapter_count == expected_adapter_count, "Got unexpected adapter count %u, expected %u.\n",
adapter_count, expected_adapter_count);
for (i = 0; i < adapter_count; ++i)
{
monitor = IDirect3D9_GetAdapterMonitor(d3d, i);
ok(!!monitor, "Failed to get monitor for adapter %u.\n", i);
monitor_info.cbSize = sizeof(monitor_info);
ok(GetMonitorInfoA(monitor, &monitor_info),
"Failed to get monitor info for adapter %u, error %#x.\n", i, GetLastError());
if (!i)
ok(monitor_info.dwFlags == MONITORINFOF_PRIMARY,
"Got unexpected monitor flags %#x for adapter %u.\n", monitor_info.dwFlags, i);
else
ok(!monitor_info.dwFlags, "Got unexpected monitor flags %#x for adapter %u.\n", monitor_info.dwFlags, i);
}
IDirect3D9_Release(d3d);
}
START_TEST(device) START_TEST(device)
{ {
WNDCLASSA wc = {0}; WNDCLASSA wc = {0};
...@@ -13532,6 +13574,7 @@ START_TEST(device) ...@@ -13532,6 +13574,7 @@ START_TEST(device)
test_multiply_transform(); test_multiply_transform();
test_vertex_buffer_read_write(); test_vertex_buffer_read_write();
test_get_display_mode(); test_get_display_mode();
test_multi_adapter();
UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL)); UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment