Author: gschneider
Date: Sat May 8 18:27:36 2010
New Revision: 47128
URL:
http://svn.reactos.org/svn/reactos?rev=47128&view=rev
Log:
Add some win32k/gdi DC tests created by Jerome Gardou
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/N…
==============================================================================
--- 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:27:36 2010
@@ -22,6 +22,8 @@
hObj = SelectObject(hDC, GetStockObject(WHITE_PEN));
TEST(hObj == GetStockObject(BLACK_PEN));
+ TEST(NtGdiDeleteObjectApp(hDC) != 0);
+
return APISTATUS_NORMAL;
}
Modified: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiDeleteObjectApp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- 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:27:36 2010
@@ -16,13 +16,33 @@
TEST(NtGdiDeleteObjectApp((PVOID)(GDI_HANDLE_STOCK_MASK | 0x1234)) == 1);
TEST(GetLastError() == 0);
- /* Delete a DC */
+ /* Delete a compatible DC */
SetLastError(0);
hdc = CreateCompatibleDC(NULL);
ASSERT(IsHandleValid(hdc) == 1);
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 brush */
SetLastError(0);