Author: rharabien
Date: Wed Jun 1 18:20:51 2011
New Revision: 52045
URL:
http://svn.reactos.org/svn/reactos?rev=52045&view=rev
Log:
[APITESTS]
- Add more Rectangle function tests
- Improve ScrollDC tests
Modified:
trunk/rostests/apitests/gdi32/Rectangle.c
trunk/rostests/apitests/user32/ScrollDC.c
Modified: trunk/rostests/apitests/gdi32/Rectangle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/Rectangle.…
==============================================================================
--- trunk/rostests/apitests/gdi32/Rectangle.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/Rectangle.c [iso-8859-1] Wed Jun 1 18:20:51 2011
@@ -15,6 +15,7 @@
HBITMAP hBmp;
BOOL ret;
HBRUSH hBrush;
+ HPEN hPen;
COLORREF color;
hdc = CreateCompatibleDC(NULL);
@@ -48,7 +49,7 @@
ok( color == RGB(0, 0, 0), "Expected 0, got 0x%08x\n", (UINT)color);
ret = BitBlt(hdc, 0, 0, 4, 4, NULL, 0, 0, WHITENESS);
- ok(ret, "BitBlt failed to blank the bitmap!\n");
+ ok(ret, "BitBlt failed to blank the bitmap!\n");
/* Try well ordered rectangle coordinates */
ret = Rectangle(hdc, 0, 0, 2, 2);
ok(ret, "Rectangle failed!");
@@ -62,6 +63,28 @@
ok( color == RGB(255, 255, 255), "Expected 0x00FFFFFF, got 0x%08x\n",
(UINT)color);
color = GetPixel(hdc, 1, 1);
ok( color == RGB(0, 0, 0), "Expected 0, got 0x%08x\n", (UINT)color);
+
+ /* tests with NULL pen */
+ hPen = SelectObject(hdc, GetStockObject(NULL_PEN));
+
+ /* Blank the bitmap */
+ ret = BitBlt(hdc, 0, 0, 4, 4, NULL, 0, 0, WHITENESS);
+ ok(ret, "BitBlt failed to blank the bitmap!\n");
+
+ ret = Rectangle(hdc, 0, 0, 3, 3);
+ ok(ret, "Rectangle failed!");
+ color = GetPixel(hdc, 0, 0);
+ ok( color == RGB(0, 0, 0), "Expected 0, got 0x%08x\n", (UINT)color);
+ color = GetPixel(hdc, 2, 2);
+ ok( color == RGB(255, 255, 255), "Expected 0x00FFFFFF, got 0x%08x\n",
(UINT)color);
+ color = GetPixel(hdc, 0, 2);
+ ok( color == RGB(255, 255, 255), "Expected 0x00FFFFFF, got 0x%08x\n",
(UINT)color);
+ color = GetPixel(hdc, 2, 0);
+ ok( color == RGB(255, 255, 255), "Expected 0x00FFFFFF, got 0x%08x\n",
(UINT)color);
+ color = GetPixel(hdc, 1, 1);
+ ok( color == RGB(0, 0, 0), "Expected 0, got 0x%08x\n", (UINT)color);
+
+ SelectObject(hdc, hPen);
/* Same tests with GM_ADVANCED */
ok(SetGraphicsMode(hdc, GM_ADVANCED) == GM_COMPATIBLE, "Default mode for the DC
is not GM_COMPATIBLE.\n");
Modified: trunk/rostests/apitests/user32/ScrollDC.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/ScrollDC.…
==============================================================================
--- trunk/rostests/apitests/user32/ScrollDC.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/ScrollDC.c [iso-8859-1] Wed Jun 1 18:20:51 2011
@@ -27,30 +27,35 @@
/* Test that no update region is there */
hrgn = CreateRectRgn(0,0,0,0);
iResult = GetUpdateRgn(hWnd, hrgn, FALSE);
- ok (iResult == NULLREGION, "\n");
+ ok (iResult == NULLREGION, "Expected NULLREGION, got %d\n", iResult);
/* Test normal scrolling */
- ok(ScrollDC(hDC, 0, 0, NULL, NULL, hrgn, NULL) == TRUE, "\n");
+ ok(ScrollDC(hDC, 0, 0, NULL, NULL, hrgn, NULL) == TRUE, "ScrollDC failed\n");
/* Scroll with invalid update region */
DeleteObject(hrgn);
- ok(ScrollDC(hDC, 50, 0, NULL, NULL, hrgn, NULL) == FALSE, "\n");
+ ok(ScrollDC(hDC, 50, 0, NULL, NULL, (HRGN)0x12345678, NULL) == FALSE, "ScrollDC
successed\n");
+ ok(ScrollDC(hDC, 50, 0, NULL, NULL, hrgn, NULL) == FALSE, "ScrollDC
successed\n");
hrgn = CreateRectRgn(0,0,0,0);
- ok(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION, "\n");
+ iResult = GetUpdateRgn(hWnd, hrgn, FALSE);
+ ok(iResult == NULLREGION, "Expected NULLREGION, got %d\n", iResult);
/* Scroll with invalid update rect pointer */
- ok(ScrollDC(hDC, 50, 0, NULL, NULL, NULL, (PRECT)1) == 0, "\n");
- ok(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION, "\n");
+ ok(ScrollDC(hDC, 50, 0, NULL, NULL, NULL, (PRECT)1) == FALSE, "ScrollDC
failed\n");
+ iResult = GetUpdateRgn(hWnd, hrgn, FALSE);
+ ok(iResult == NULLREGION, "Expected NULLREGION, got %d\n", iResult);
/* Scroll with a clip rect */
rcClip.left = 50; rcClip.top = 0; rcClip.right = 100; rcClip.bottom = 100;
- ok(ScrollDC(hDC, 50, 0, NULL, &rcClip, hrgn, NULL) == TRUE, "\n");
- ok(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION, "\n");
+ ok(ScrollDC(hDC, 50, 0, NULL, &rcClip, hrgn, NULL) == TRUE, "ScrollDC
failed\n");
+ iResult = GetUpdateRgn(hWnd, hrgn, FALSE);
+ ok(iResult == NULLREGION, "Expected NULLREGION, got %d\n", iResult);
/* Scroll with a clip rect */
rcClip.left = 50; rcClip.top = 0; rcClip.right = 100; rcClip.bottom = 100;
- ok(ScrollDC(hDC, 50, 50, NULL, &rcClip, hrgn, NULL) == TRUE, "\n");
- ok(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION, "\n");
+ ok(ScrollDC(hDC, 50, 50, NULL, &rcClip, hrgn, NULL) == TRUE, "ScrollDC
failed\n");
+ iResult = GetUpdateRgn(hWnd, hrgn, FALSE);
+ ok(iResult == NULLREGION, "Expected NULLREGION, got %d\n", iResult);
/* Overlap with another window */
hWnd2 = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW
| WS_VISIBLE,