mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 04:35:53 +00:00
parent
e7846c0c67
commit
62f6e3b397
42 changed files with 2715 additions and 2715 deletions
|
@ -10,108 +10,108 @@
|
|||
START_TEST(NtUserScrollDC)
|
||||
{
|
||||
HINSTANCE hinst = GetModuleHandle(NULL);
|
||||
HWND hWnd;
|
||||
HDC hDC;
|
||||
HRGN hRgn, hTmpRgn;
|
||||
RECT rcScroll, rcClip, rcUpdate;
|
||||
RECT rect = {0,0,100,100};
|
||||
INT Result;
|
||||
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,
|
||||
hinst,
|
||||
0);
|
||||
ASSERT(hWnd);
|
||||
RedrawWindow(hWnd, &rect, NULL, RDW_UPDATENOW);
|
||||
hWnd = CreateWindowA("BUTTON",
|
||||
"Test",
|
||||
BS_PUSHBUTTON | WS_VISIBLE,
|
||||
0,
|
||||
0,
|
||||
50,
|
||||
100,
|
||||
NULL,
|
||||
NULL,
|
||||
hinst,
|
||||
0);
|
||||
ASSERT(hWnd);
|
||||
RedrawWindow(hWnd, &rect, NULL, RDW_UPDATENOW);
|
||||
|
||||
hDC = GetDC(hWnd);
|
||||
ASSERT(hDC);
|
||||
hDC = GetDC(hWnd);
|
||||
ASSERT(hDC);
|
||||
|
||||
hRgn = CreateRectRgn(0,0,10,10);
|
||||
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 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);
|
||||
/* 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;
|
||||
rcScroll.left = 0;
|
||||
rcScroll.top = 25;
|
||||
rcScroll.right = 100;
|
||||
rcScroll.bottom = 40;
|
||||
|
||||
/* 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 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);
|
||||
/* Test invalid dc */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
Result = NtUserScrollDC((HDC)0x123456, 10, 20, &rcScroll, &rcClip, hRgn, &rcUpdate);
|
||||
RTEST(Result == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Test invalid update rect */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, (PVOID)0x80001000);
|
||||
RTEST(Result == 0);
|
||||
RTEST(GetLastError() == ERROR_NOACCESS);
|
||||
/* 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);
|
||||
Result = NtUserScrollDC(hDC, 10, 20, &rcScroll, &rcClip, hRgn, &rcUpdate);
|
||||
|
||||
RTEST(Result == TRUE);
|
||||
RTEST(rcUpdate.left == 0);
|
||||
RTEST(rcUpdate.top == 35);
|
||||
RTEST(rcUpdate.right == 70);
|
||||
RTEST(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);
|
||||
RTEST(Result == SIMPLEREGION);
|
||||
hTmpRgn = CreateRectRgn(10,45,70,55);
|
||||
Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
|
||||
RTEST(Result == SIMPLEREGION);
|
||||
|
||||
SetRectRgn(hTmpRgn,0,35,70,40);
|
||||
Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
|
||||
RTEST(Result == NULLREGION);
|
||||
SetRectRgn(hTmpRgn,0,35,70,40);
|
||||
Result = CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
|
||||
RTEST(Result == NULLREGION);
|
||||
|
||||
DeleteObject(hTmpRgn);
|
||||
DeleteObject(hTmpRgn);
|
||||
|
||||
/* TODO: Test with another window in front */
|
||||
/* TODO: Test with different viewport extension */
|
||||
/* TODO: Test with another window in front */
|
||||
/* TODO: Test with different viewport extension */
|
||||
|
||||
ReleaseDC(hWnd, hDC);
|
||||
DestroyWindow(hWnd);
|
||||
DeleteObject(hRgn);
|
||||
ReleaseDC(hWnd, hDC);
|
||||
DestroyWindow(hWnd);
|
||||
DeleteObject(hRgn);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue