[ros-diffs] [tkreuzer] 30342: Some tests for NtUserScrollDC

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sun Nov 11 00:04:33 CET 2007


Author: tkreuzer
Date: Sun Nov 11 02:04:33 2007
New Revision: 30342

URL: http://svn.reactos.org/svn/reactos?rev=30342&view=rev
Log:
Some tests for NtUserScrollDC

Added:
    trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c   (with props)
Modified:
    trunk/rostests/apitests/w32knapi/testlist.c

Added: trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c?rev=30342&view=auto
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c (added)
+++ trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c Sun Nov 11 02:04:33 2007
@@ -1,0 +1,68 @@
+
+
+INT
+Test_NtUserScrollDC(PTESTINFO pti)
+{
+	HWND hWnd;
+	HDC hDC;
+	HRGN hRgn, hTmpRgn;
+	RECT rcScroll, rcClip, rcUpdate;
+	RECT rect = {0,0,100,100};
+	INT Result;
+
+	hWnd = CreateWindowA("BUTTON",
+	                     "Test",
+	                     BS_PUSHBUTTON | WS_VISIBLE,
+	                     0,
+	                     0,
+	                     50,
+	                     100,
+	                     NULL,
+	                     NULL,
+	                     g_hInstance,
+	                     0);
+	ASSERT(hWnd);
+	RedrawWindow(hWnd, &rect, NULL, RDW_UPDATENOW);
+
+	hDC = GetDC(hWnd);
+	ASSERT(hDC);
+
+	hRgn = CreateRectRgn(0,0,10,10);
+
+	rcScroll.left = 0;
+	rcScroll.top = 25;
+	rcScroll.right = 100;
+	rcScroll.bottom = 40;
+
+	rcClip.left = 0;
+	rcClip.top = 35;
+	rcClip.right = 70;
+	rcClip.bottom = 1000;
+
+	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);
+
+	hTmpRgn = CreateRectRgn(10,45,70,55);
+	Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
+	TEST(Result == SIMPLEREGION);
+
+	SetRectRgn(hTmpRgn,0,35,70,40);
+	Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
+	TEST(Result == NULLREGION);
+
+	DeleteObject(hTmpRgn);
+
+	/* TODO: Test with another window in front */
+
+	ReleaseDC(hWnd, hDC);
+	DestroyWindow(hWnd);
+	DeleteObject(hRgn);
+
+	return APISTATUS_NORMAL;
+}
+

Propchange: trunk/rostests/apitests/w32knapi/ntuser/NtUserScrollDC.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/rostests/apitests/w32knapi/testlist.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/testlist.c?rev=30342&r1=30341&r2=30342&view=diff
==============================================================================
--- trunk/rostests/apitests/w32knapi/testlist.c (original)
+++ trunk/rostests/apitests/w32knapi/testlist.c Sun Nov 11 02:04:33 2007
@@ -22,6 +22,7 @@
 #include "ntuser/NtUserCountClipboardFormats.c"
 #include "ntuser/NtUserFindExistingCursorIcon.c"
 #include "ntuser/NtUserRedrawWindow.c"
+#include "ntuser/NtUserScrollDC.c"
 #include "ntuser/NtUserToUnicodeEx.c"
 
 /* The List of tests */
@@ -50,6 +51,7 @@
 	{ L"NtUserCountClipboardFormats", Test_NtUserCountClipboardFormats },
 	{ L"NtUserFindExistingCursorIcon", Test_NtUserFindExistingCursoricon },
 	{ L"NtUserRedrawWindow", Test_NtUserRedrawWindow },
+	{ L"NtUserScrollDC", Test_NtUserScrollDC },
 	{ L"NtUserToUnicodeEx", Test_NtUserToUnicodeEx }
 };
 




More information about the Ros-diffs mailing list