From fc41ff397cdd41a8ed1e344ceb0513704a6087a2 Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Sun, 25 Jul 2010 21:05:55 +0200 Subject: d3d9/tests: Test GetAdapterDisplayModeEx with D3DDISPLAYROTATION null-pointer --- dlls/d3d9/tests/d3d9ex.c | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index f84ad7d..ea0313c 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -312,10 +312,27 @@ static void test_get_adapter_displaymode_ex(void) /* check that orientation is returned correctly by GetAdapterDisplayModeEx and EnumDisplaySettingsEx*/ todo_wine ok(startmode.dmDisplayOrientation == DMDO_180 && rotation == D3DDISPLAYROTATION_180, "rotation is %d instead of %d\n", rotation, startmode.dmDisplayOrientation); + trace("GetAdapterDisplayModeEx returned Width = %d,Height = %d, RefreshRate = %d, Format = %x, ScanLineOrdering = %x, rotation = %d\n", mode_ex.Width, mode_ex.Height, mode_ex.RefreshRate, mode_ex.Format, mode_ex.ScanLineOrdering, rotation); + + /* test GetAdapterDisplayModeEx with null pointer for D3DDISPLAYROTATION */ + memset(&mode_ex, 0, sizeof(mode_ex)); + mode_ex.Size = sizeof(D3DDISPLAYMODEEX); + + hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, D3DADAPTER_DEFAULT, &mode_ex, NULL); + todo_wine ok(SUCCEEDED(hr), "GetAdapterDisplayModeEx failed, hr %#x.\n", hr); + + ok(mode_ex.Size == sizeof(D3DDISPLAYMODEEX), "size is %d\n", mode_ex.Size); + todo_wine ok(mode_ex.Width == mode.Width, "width is %d instead of %d\n", mode_ex.Width, mode.Width); + todo_wine ok(mode_ex.Height == mode.Height, "height is %d instead of %d\n", mode_ex.Height, mode.Height); + todo_wine ok(mode_ex.RefreshRate == mode.RefreshRate, "RefreshRate is %d instead of %d\n", mode_ex.RefreshRate, mode.RefreshRate); + todo_wine ok(mode_ex.Format == mode.Format, "format is %x instead of %x\n", mode_ex.Format, mode.Format); + /* don't know yet how to test for ScanLineOrdering, just testing that it is set to a value by GetAdapterDisplayModeEx*/ + todo_wine ok(mode_ex.ScanLineOrdering != 0, "ScanLineOrdering returned 0\n"); + + trace("GetAdapterDisplayModeEx with D3DDISPLAYROTATION null-pointer returned Width = %d,Height = %d, RefreshRate = %d, Format = %x, ScanLineOrdering = %x\n", mode_ex.Width, mode_ex.Height, mode_ex.RefreshRate, mode_ex.Format, mode_ex.ScanLineOrdering); + /* return to the default mode */ pChangeDisplaySettingsExA(NULL, NULL, NULL, 0, NULL); - trace("GetAdapterDisplayModeEx returned Width = %d,Height = %d, RefreshRate = %d, Format = %x, ScanLineOrdering = %x, rotation = %d\n", - mode_ex.Width, mode_ex.Height, mode_ex.RefreshRate, mode_ex.Format, mode_ex.ScanLineOrdering, rotation); out: IDirect3D9_Release(d3d9); IDirect3D9Ex_Release(d3d9ex); -- 1.7.0.4