Add a gdi32 test to highlight the CreateCompatibleDC problem =

Colin Finck mail at colinfinck.de
Fri Apr 11 14:52:21 CDT 2008


described in bug #12493=0A=
=0A=
---=0A=
 dlls/gdi32/tests/dc.c |   20 ++++++++++++++++++++=0A=
 1 files changed, 20 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c=0A=
index 79b6ef7..9e0048e 100644=0A=
--- a/dlls/gdi32/tests/dc.c=0A=
+++ b/dlls/gdi32/tests/dc.c=0A=
@@ -234,9 +234,29 @@ static void test_GdiConvertToDevmodeW(void)=0A=
     HeapFree(GetProcessHeap(), 0, dmW);=0A=
 }=0A=
 =0A=
+static void test_CreateCompatibleDC(void)=0A=
+{=0A=
+    BOOL bRet;=0A=
+    HDC hDC;=0A=
+    HDC hNewDC;=0A=
+=0A=
+    /* Create a DC compatible with the screen */=0A=
+    hDC =3D CreateCompatibleDC(NULL);=0A=
+    ok(hDC !=3D NULL, "CreateCompatibleDC returned %p\n", hDC);=0A=
+=0A=
+    /* Delete this DC, this should succeed */=0A=
+    bRet =3D DeleteDC(hDC);=0A=
+    ok(bRet =3D=3D TRUE, "DeleteDC returned %u\n", bRet);=0A=
+=0A=
+    /* Try to create a DC compatible to the deleted DC. This has to =
fail */=0A=
+    hNewDC =3D CreateCompatibleDC(hDC);=0A=
+    ok(hNewDC =3D=3D NULL, "CreateCompatibleDC returned %p\n", hNewDC);=0A=
+}=0A=
+=0A=
 START_TEST(dc)=0A=
 {=0A=
     test_savedc();=0A=
     test_savedc_2();=0A=
     test_GdiConvertToDevmodeW();=0A=
+    test_CreateCompatibleDC();=0A=
 }=0A=
-- =0A=
1.4.4.2=0A=
=0A=

------=_NextPart_000_0038_01C89BE4.6A9D1F70--




More information about the wine-patches mailing list