Author: tkreuzer
Date: Sun Nov 11 03:19:42 2007
New Revision: 30343
URL:
http://svn.reactos.org/svn/reactos?rev=30343&view=rev
Log:
some more tests for NtUserScrollDC and NtGdiBitBlt
Added:
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c (with props)
Modified:
trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c
trunk/rostests/apitests/w32knapi/testlist.c
Added: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c (added)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c Sun Nov 11 03:19:42 2007
@@ -1,0 +1,14 @@
+
+INT
+Test_NtGdiBitBlt(PTESTINFO pti)
+{
+ BOOL bRet;
+
+ /* Test invalid dc */
+ SetLastError(ERROR_SUCCESS);
+ bRet = NtGdiBitBlt((HDC)0x123456, 0, 0, 10, 10, (HDC)0x123456, 10, 10, SRCCOPY, 0, 0);
+ TEST(bRet == FALSE);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ return APISTATUS_NORMAL;
+}
Propchange: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c (original)
+++ trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c Sun Nov 11 03:19:42 2007
@@ -29,35 +29,79 @@
hRgn = CreateRectRgn(0,0,10,10);
+
+ /* Test inverted clip rect */
+ rcScroll.left = 0;
+ rcScroll.top = 25;
+ rcScroll.right = 100;
+ rcScroll.bottom = 40;
+ rcClip.left = 0;
+ rcClip.top = 35;
+ rcClip.right = -70;
+ rcClip.bottom = -1000;
+ SetLastError(ERROR_SUCCESS);
+ Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, &rcUpdate);
+ RTEST(Result == 1);
+ RTEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test inverted scroll rect */
+ rcScroll.left = 0;
+ rcScroll.top = 25;
+ rcScroll.right = -100;
+ rcScroll.bottom = -40;
+ rcClip.left = 0;
+ rcClip.top = 35;
+ rcClip.right = 70;
+ rcClip.bottom = 1000;
+ SetLastError(ERROR_SUCCESS);
+ Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, &rcUpdate);
+ RTEST(Result == 1);
+ RTEST(GetLastError() == ERROR_SUCCESS);
+
rcScroll.left = 0;
rcScroll.top = 25;
rcScroll.right = 100;
rcScroll.bottom = 40;
- rcClip.left = 0;
- rcClip.top = 35;
- rcClip.right = 70;
- rcClip.bottom = 1000;
+ /* Test invalid update region */
+ SetLastError(ERROR_SUCCESS);
+ Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, (HRGN)0x123456,
&rcUpdate);
+ RTEST(Result == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+
+ /* Test invalid dc */
+ SetLastError(ERROR_SUCCESS);
+ Result = NtUserScrollDC((HDC)0x123456, 10, 20, &rcScroll, &rcClip, hRgn,
&rcUpdate);
+ RTEST(Result == 0);
+ RTEST(GetLastError() == ERROR_SUCCESS);
+ printf("%ld\n", GetLastError());
+
+ /* Test invalid update rect */
+ SetLastError(ERROR_SUCCESS);
+ Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn,
(PVOID)0x80001000);
+ RTEST(Result == 0);
+ RTEST(GetLastError() == ERROR_NOACCESS);
Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, &rcUpdate);
- TEST(Result == TRUE);
- TEST(rcUpdate.left == 0);
- TEST(rcUpdate.top == 35);
- TEST(rcUpdate.right == 70);
- TEST(rcUpdate.bottom == 55);
+ RTEST(Result == TRUE);
+ RTEST(rcUpdate.left == 0);
+ RTEST(rcUpdate.top == 35);
+ RTEST(rcUpdate.right == 70);
+ RTEST(rcUpdate.bottom == 55);
hTmpRgn = CreateRectRgn(10,45,70,55);
Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
- TEST(Result == SIMPLEREGION);
+ RTEST(Result == SIMPLEREGION);
SetRectRgn(hTmpRgn,0,35,70,40);
Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
- TEST(Result == NULLREGION);
+ RTEST(Result == NULLREGION);
DeleteObject(hTmpRgn);
/* TODO: Test with another window in front */
+ /* TODO: Test with different viewport extension */
ReleaseDC(hWnd, hDC);
DestroyWindow(hWnd);
Modified: trunk/rostests/apitests/w32knapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/testlis…
==============================================================================
--- trunk/rostests/apitests/w32knapi/testlist.c (original)
+++ trunk/rostests/apitests/w32knapi/testlist.c Sun Nov 11 03:19:42 2007
@@ -7,6 +7,7 @@
#include "ntdd/NtGdiDdQueryDirectDrawObject.c"
#include "ntgdi/NtGdiArcInternal.c"
+#include "ntgdi/NtGdiBitBlt.c"
#include "ntgdi/NtGdiCreateBitmap.c"
#include "ntgdi/NtGdiCreateCompatibleBitmap.c"
#include "ntgdi/NtGdiDoPalette.c"
@@ -35,6 +36,7 @@
/* ntgdi */
{ L"NtGdiArcInternal", Test_NtGdiArcInternal },
+ { L"NtGdiBitBlt", Test_NtGdiBitBlt },
{ L"NtGdiCreateBitmap", Test_NtGdiCreateBitmap },
{ L"NtGdiCreateCompatibleBitmap", Test_NtGdiCreateCompatibleBitmap },
{ L"NtGdiDoPalette", Test_NtGdiDoPalette },