Zhiyi Zhang : gdi32/tests: Fix a test failure on Win10 1809.

Alexandre Julliard julliard at winehq.org
Thu Sep 19 16:35:18 CDT 2019


Module: wine
Branch: master
Commit: 9cffe80fdc0fcdcea42a5e52f13e7ab1e08d7aa7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9cffe80fdc0fcdcea42a5e52f13e7ab1e08d7aa7

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Thu Sep 19 15:56:38 2019 +0100

gdi32/tests: Fix a test failure on Win10 1809.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/tests/dc.c | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c
index 2d9ef1dd88..366ea88924 100644
--- a/dlls/gdi32/tests/dc.c
+++ b/dlls/gdi32/tests/dc.c
@@ -731,19 +731,23 @@ static void test_DeleteDC(void)
     ok(hdc != 0, "GetDC failed\n");
     ret = GetObjectType(hdc);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
     ret = DeleteDC(hdc);
     ok(ret, "DeleteDC failed\n");
-    ret = GetObjectType(hdc);
-    ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     hdc = GetWindowDC(hwnd);
     ok(hdc != 0, "GetDC failed\n");
     ret = GetObjectType(hdc);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
     ret = DeleteDC(hdc);
     ok(ret, "DeleteDC failed\n");
-    ret = GetObjectType(hdc);
-    ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     DestroyWindow(hwnd);
 
@@ -755,19 +759,23 @@ static void test_DeleteDC(void)
     ok(hdc != 0, "GetDC failed\n");
     ret = GetObjectType(hdc);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
     ret = DeleteDC(hdc);
     ok(ret, "DeleteDC failed\n");
-    ret = GetObjectType(hdc);
-    ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     hdc = GetWindowDC(hwnd);
     ok(hdc != 0, "GetDC failed\n");
     ret = GetObjectType(hdc);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
     ret = DeleteDC(hdc);
     ok(ret, "DeleteDC failed\n");
-    ret = GetObjectType(hdc);
-    ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     /* CS_CLASSDC */
     memset(&cls, 0, sizeof(cls));
@@ -802,21 +810,25 @@ static void test_DeleteDC(void)
     ok(hdc != 0, "GetDC failed\n");
     ret = GetObjectType(hdc);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
     ret = DeleteDC(hdc);
     ok(ret, "DeleteDC failed\n");
-    ret = GetObjectType(hdc);
-    ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     DestroyWindow(hwnd);
 
     ret = GetObjectType(hdc_test);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc_test, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
 
     ret = UnregisterClassA("Wine class DC", GetModuleHandleA(NULL));
     ok(ret, "UnregisterClassA failed\n");
 
-    ret = GetObjectType(hdc_test);
-    ok(!ret, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc_test, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     /* CS_OWNDC */
     memset(&cls, 0, sizeof(cls));
@@ -849,10 +861,12 @@ static void test_DeleteDC(void)
     ok(hdc != 0, "GetDC failed\n");
     ret = GetObjectType(hdc);
     ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret);
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(ret == DT_RASDISPLAY, "GetDeviceCaps rets %d\n", ret);
     ret = DeleteDC(hdc);
     ok(ret, "DeleteDC failed\n");
-    ret = GetObjectType(hdc);
-    ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n");
+    ret = GetDeviceCaps(hdc, TECHNOLOGY);
+    ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
 
     DestroyWindow(hwnd);
 




More information about the wine-cvs mailing list