[ros-diffs] [tkreuzer] 47130: [w32knapi} Patch by Jerome Gardou: add some more tests for NtGdiDeleteObjectApp

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat May 8 18:38:06 CEST 2010


Author: tkreuzer
Date: Sat May  8 18:38:05 2010
New Revision: 47130

URL: http://svn.reactos.org/svn/reactos?rev=47130&view=rev
Log:
[w32knapi}
Patch by Jerome Gardou: add some more tests for NtGdiDeleteObjectApp

Modified:
    trunk/rostests/apitests/w32knapi/ntgdi/NtGdiCreateCompatibleDC.c
    trunk/rostests/apitests/w32knapi/ntgdi/NtGdiDeleteObjectApp.c

Modified: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiCreateCompatibleDC.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/NtGdiCreateCompatibleDC.c?rev=47130&r1=47129&r2=47130&view=diff
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiCreateCompatibleDC.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiCreateCompatibleDC.c [iso-8859-1] Sat May  8 18:38:05 2010
@@ -21,6 +21,8 @@
 	/* The default pen should be GetStockObject(BLACK_PEN) */
 	hObj = SelectObject(hDC, GetStockObject(WHITE_PEN));
 	TEST(hObj == GetStockObject(BLACK_PEN));
+	
+	TEST(NtGdiDeleteObjectApp(hDC) != 0);
 
 	TEST(NtGdiDeleteObjectApp(hDC) != 0);
 

Modified: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiDeleteObjectApp.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/NtGdiDeleteObjectApp.c?rev=47130&r1=47129&r2=47130&view=diff
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiDeleteObjectApp.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiDeleteObjectApp.c [iso-8859-1] Sat May  8 18:38:05 2010
@@ -23,7 +23,27 @@
     TEST(NtGdiDeleteObjectApp(hdc) == 1);
     TEST(GetLastError() == 0);
     TEST(IsHandleValid(hdc) == 0);
-
+    
+    /* Delete a display DC */
+    SetLastError(0);
+    hdc = CreateDC("DISPLAY", NULL, NULL, NULL);
+    ASSERT(IsHandleValid(hdc) == 1);
+    TEST(NtGdiDeleteObjectApp(hdc) != 0);
+    TEST(GetLastError() == 0);
+    TEST(IsHandleValid(hdc) == 1);
+    TEST(SelectObject(hdc, GetStockObject(WHITE_PEN)) == NULL);
+    TESTX(GetLastError() == ERROR_INVALID_PARAMETER, "GetLasterror returned 0x%08x\n", (unsigned int)GetLastError());
+    
+    /* Once more */
+    SetLastError(0);
+    hdc = GetDC(0);
+    ASSERT(IsHandleValid(hdc) == 1);
+    TEST(NtGdiDeleteObjectApp(hdc) != 0);
+    TEST(GetLastError() == 0);
+    TEST(IsHandleValid(hdc) == 1);
+    TEST(SelectObject(hdc, GetStockObject(WHITE_PEN)) == NULL);
+    TESTX(GetLastError() == ERROR_INVALID_PARAMETER, "GetLasterror returned 0x%08x\n", (unsigned int)GetLastError());
+    
     /* Delete a display DC */
     SetLastError(0);
     hdc = CreateDC("DISPLAY", NULL, NULL, NULL);




More information about the Ros-diffs mailing list