Dmitry Timoshkov : gdi32: Add some additional tests for negative axes extents.

Alexandre Julliard julliard at winehq.org
Tue Mar 8 11:03:51 CST 2011


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

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Tue Mar  8 16:55:24 2011 +0800

gdi32: Add some additional tests for negative axes extents.

---

 dlls/gdi32/tests/mapping.c |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/tests/mapping.c b/dlls/gdi32/tests/mapping.c
index fba0abf..b0688a7 100644
--- a/dlls/gdi32/tests/mapping.c
+++ b/dlls/gdi32/tests/mapping.c
@@ -210,15 +210,43 @@ static void test_world_transform(void)
     expect_world_transform(hdc, 20.0, 20.0);
     expect_LPtoDP(hdc, 20000, 20000);
 
+    size.cx = 0xdeadbeef;
+    size.cy = 0xdeadbeef;
+    ret = SetViewportExtEx(hdc, -1, -1, &size);
+    ok(ret, "SetViewportExtEx(-1, -1) failed\n");
+    ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy);
+    expect_viewport_ext(hdc, 1, 1);
+    expect_window_ext(hdc, 1, 1);
+    expect_world_transform(hdc, 20.0, 20.0);
+    expect_LPtoDP(hdc, 20000, 20000);
+
+    ret = SetMapMode(hdc, MM_ANISOTROPIC);
+    ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
+
+    expect_viewport_ext(hdc, 1, 1);
+    expect_window_ext(hdc, 1, 1);
+    expect_world_transform(hdc, 20.0, 20.0);
+    expect_LPtoDP(hdc, 20000, 20000);
+
+    size.cx = 0xdeadbeef;
+    size.cy = 0xdeadbeef;
+    ret = SetViewportExtEx(hdc, -1, -1, &size);
+    ok(ret, "SetViewportExtEx(-1, -1) failed\n");
+    ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy);
+    expect_viewport_ext(hdc, -1, -1);
+    expect_window_ext(hdc, 1, 1);
+    expect_world_transform(hdc, 20.0, 20.0);
+    expect_LPtoDP(hdc, -20000, -20000);
+
     ret = SetGraphicsMode(hdc, GM_COMPATIBLE);
     ok(ret, "SetGraphicsMode(GM_COMPATIBLE) should not fail if DC has't an identity transform\n");
     ret = GetGraphicsMode(hdc);
     ok(ret == GM_COMPATIBLE, "expected GM_COMPATIBLE, got %d\n", ret);
 
-    expect_viewport_ext(hdc, 1, 1);
+    expect_viewport_ext(hdc, -1, -1);
     expect_window_ext(hdc, 1, 1);
     expect_world_transform(hdc, 20.0, 20.0);
-    expect_LPtoDP(hdc, 20000, 20000);
+    expect_LPtoDP(hdc, -20000, -20000);
 
     DeleteDC(hdc);
 }




More information about the wine-cvs mailing list