Louis Lenders : d3d9/tests: Test GetAdapterDisplayModeEx with D3DDISPLAYROTATION null-pointer.

Alexandre Julliard julliard at winehq.org
Mon Jul 26 13:22:41 CDT 2010


Module: wine
Branch: master
Commit: 5a05950271987d4dbfc4a9d84924276dc4056760
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5a05950271987d4dbfc4a9d84924276dc4056760

Author: Louis Lenders <xerox_xerox2000 at yahoo.co.uk>
Date:   Sun Jul 25 21:05:55 2010 +0200

d3d9/tests: Test GetAdapterDisplayModeEx with D3DDISPLAYROTATION null-pointer.

---

 dlls/d3d9/tests/d3d9ex.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c
index f84ad7d..6e11116 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -312,10 +312,26 @@ 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);
 
-    /* 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);
+
+    /* 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");
+
+    /* return to the default mode */
+    pChangeDisplaySettingsExA(NULL, NULL, NULL, 0, NULL);
 out:
     IDirect3D9_Release(d3d9);
     IDirect3D9Ex_Release(d3d9ex);




More information about the wine-cvs mailing list