[PATCH v2 1/2] gdi32/tests: Fix a test failure on Win10 1809.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> --- v2: Use GetDeviceCaps(hdc, TECHNOLOGY) to check for deleted DCs. dlls/gdi32/tests/dc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index 2d9ef1dd88..49ee708688 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -733,8 +733,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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"); @@ -742,8 +742,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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); @@ -757,8 +757,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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"); @@ -766,8 +766,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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)); @@ -804,8 +804,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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); @@ -815,8 +815,8 @@ static void test_DeleteDC(void) 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)); @@ -851,8 +851,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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); -- 2.23.0
On Tue, Sep 17, 2019 at 10:39:20PM +0800, Zhiyi Zhang wrote:
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> --- v2: Use GetDeviceCaps(hdc, TECHNOLOGY) to check for deleted DCs.
dlls/gdi32/tests/dc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index 2d9ef1dd88..49ee708688 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -733,8 +733,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %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");
Could we also add calls to GetDeviceCaps(hdc, TECHNOLOGY) before we destroy the dc, thus emphasising what's changed (leaving the existing GetObjectType() calls where they succeed is also fine). Huw.
participants (2)
-
Huw Davies -
Zhiyi Zhang