Colin Finck : gdi32: Add a test to demonstrate a CreateCompatibleDC problem .

Alexandre Julliard julliard at winehq.org
Mon Apr 14 07:14:06 CDT 2008


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

Author: Colin Finck <mail at colinfinck.de>
Date:   Fri Apr 11 15:07:20 2008 +0200

gdi32: Add a test to demonstrate a CreateCompatibleDC problem.

---

 dlls/gdi32/tests/dc.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c
index 79b6ef7..d0ca5cf 100644
--- a/dlls/gdi32/tests/dc.c
+++ b/dlls/gdi32/tests/dc.c
@@ -234,9 +234,33 @@ static void test_GdiConvertToDevmodeW(void)
     HeapFree(GetProcessHeap(), 0, dmW);
 }
 
+static void test_CreateCompatibleDC(void)
+{
+    BOOL bRet;
+    HDC hDC;
+    HDC hNewDC;
+
+    /* Create a DC compatible with the screen */
+    hDC = CreateCompatibleDC(NULL);
+    ok(hDC != NULL, "CreateCompatibleDC returned %p\n", hDC);
+
+    /* Delete this DC, this should succeed */
+    bRet = DeleteDC(hDC);
+    ok(bRet == TRUE, "DeleteDC returned %u\n", bRet);
+
+todo_wine
+{
+    /* Try to create a DC compatible to the deleted DC. This has to fail */
+    hNewDC = CreateCompatibleDC(hDC);
+    ok(hNewDC == NULL, "CreateCompatibleDC returned %p\n", hNewDC);
+}
+
+}
+
 START_TEST(dc)
 {
     test_savedc();
     test_savedc_2();
     test_GdiConvertToDevmodeW();
+    test_CreateCompatibleDC();
 }




More information about the wine-cvs mailing list