From 2800970d1abfea5bdcd9a55c6c3132e65f87b8ec Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 4 Dec 2009 11:50:50 +0100 Subject: [PATCH] dxgi/tests: Add a small test for IDXGIAdapter::GetDesc(). --- dlls/dxgi/tests/device.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 491616cd0c5..32e87e6b742 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -98,6 +98,36 @@ static void test_device_interfaces(IDXGIDevice *device) ok(SUCCEEDED(hr), "IDXGIDevice does not implement ID3D10Device\n"); } +static void test_adapter_desc(IDXGIDevice *device) +{ + DXGI_ADAPTER_DESC desc; + IDXGIAdapter *adapter; + HRESULT hr; + + hr = IDXGIDevice_GetAdapter(device, &adapter); + ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr); + + hr = IDXGIAdapter_GetDesc(adapter, NULL); + ok(hr == E_INVALIDARG, "GetDesc returned %#x, expected %#x.\n", + hr, E_INVALIDARG); + + hr = IDXGIAdapter_GetDesc(adapter, &desc); + ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr); + + trace("%s.\n", wine_dbgstr_w(desc.Description)); + trace("%04x: %04x:%04x (rev %02x).\n", + desc.SubSysId, desc.VendorId, desc.DeviceId, desc.Revision); + trace("Dedicated video memory: %lu (%lu MB).\n", + desc.DedicatedVideoMemory, desc.DedicatedVideoMemory / (1024 * 1024)); + trace("Dedicated system memory: %lu (%lu MB).\n", + desc.DedicatedSystemMemory, desc.DedicatedSystemMemory / (1024 * 1024)); + trace("Shared system memory: %lu (%lu MB).\n", + desc.SharedSystemMemory, desc.SharedSystemMemory / (1024 * 1024)); + trace("LUID: %08x:%08x.\n", desc.AdapterLuid.HighPart, desc.AdapterLuid.LowPart); + + IDXGIAdapter_Release(adapter); +} + static void test_create_surface(IDXGIDevice *device) { ID3D10Texture2D *texture; @@ -184,6 +214,7 @@ START_TEST(device) return; } + test_adapter_desc(device); test_device_interfaces(device); test_create_surface(device); test_parents(device);