19#define ok_size(x, y) \
20 ok(x == y, "Wrong size, expected '%s' to equal '%s'\n", wine_dbgstr_size(&x), wine_dbgstr_size(&y))
22#define ok_point(x, y) \
23 ok(x == y, "Wrong point, expected '%s' to equal '%s'\n", wine_dbgstr_point(&x), wine_dbgstr_point(&y))
24#define nok_point(x, y) \
25 ok(x != y, "Wrong point, expected '%s' NOT to equal '%s'\n", wine_dbgstr_point(&x), wine_dbgstr_point(&y))
27#define ok_rect(x, y) \
28 ok(x == y, "Wrong rect, expected '%s' to equal '%s'\n", wine_dbgstr_rect(&x), wine_dbgstr_rect(&y))
29#define nok_rect(x, y) \
30 ok(x != y, "Wrong rect, expected '%s' to NOT equal '%s'\n", wine_dbgstr_rect(&x), wine_dbgstr_rect(&y))
36 ok(
empty.cx == 0,
"Expected cx to be 0, was %ld\n",
empty.cx);
37 ok(
empty.cy == 0,
"Expected cy to be 0, was %ld\n",
empty.cy);
39 CSize szPointA(10, 25);
52 CSize szPointD(ptObject);
62 ptObject = szPointA +
pt;
66 ptObject = szPointA -
pt;
74 sz1 =
CSize(222, 222);
75 sz2 =
CSize(111, 111);
78 sz1 =
CSize(100, 100);
82 CSize szResult(150, 125);
85 sz1 =
CSize(100, 100);
93 sz1 =
CSize(100, 100);
96 szResult =
CSize(50, 75);
102 sz1 =
CSize(100, 100);
106 sz1 =
CSize(100, 100);
110 szResult =
CSize(150, 125);
121 szResult =
CSize(50, 75);
130 szResult =
CSize(-50, -75);
135 RECT rc = { 1, 2, 3, 4 };
137 CRect rcres = sz1 + &rc;
138 CRect rcexp(101, 102, 103, 104);
142 rcexp =
CRect(-99, -98, -97, -96);
151 ok(
empty.x == 0,
"Expected x to be 0, was %ld\n",
empty.x);
152 ok(
empty.y == 0,
"Expected y to be 0, was %ld\n",
empty.y);
175 CPoint ptResult(135, 135);
204 ptTest =
CPoint(111, 333);
212 CSize szOffset(35, 35);
227 ptResult =
CPoint(65, 65);
241 ptResult =
CPoint(135, 135);
248 ptResult =
CPoint(433, 211);
252 ptResult =
CPoint(65, 65);
263 ptResult =
CPoint(433, 211);
267 ptResult =
CPoint(100, 100);
276 RECT rc = { 1, 2, 3, 4 };
279 CRect rcexp(101, 102, 103, 104);
283 rcexp =
CRect(-99, -98, -97, -96);
291 ok(
empty.left == 0,
"Expected left to be 0, was %ld\n",
empty.left);
292 ok(
empty.top == 0,
"Expected top to be 0, was %ld\n",
empty.top);
293 ok(
empty.Width() == 0,
"Expected Width to be 0, was %i\n",
empty.Width());
294 ok(
empty.Height() == 0,
"Expected Height to be 0, was %i\n",
empty.Height());
297 ok(
rect.Width() == 100,
"Expected Width to be 100, was %i\n",
rect.Width());
298 ok(
rect.Height() == 50,
"Expected Height to be 50, was %i\n",
rect.Height());
307 CRect rect3(&sdkRect);
316 CPoint ptBottomRight(100, 50);
317 CRect rect5(
pt, ptBottomRight);
323 ptDown =
rect.BottomRight();
331 rect2.BottomRight() = ptLow;
340 pt2 =
rect2.BottomRight();
344 pt2 =
rect2.TopLeft();
348 rect2.TopLeft().Offset(3, 3);
349 rect3 =
CRect(13, 13, 180, 180);
352 CRect rectSource(35, 10, 125, 10);
358 rectSource2.
left = 0;
361 rectSource2.
right = 640;
367 rect.DeflateRect(1, 2);
373 CRect rectDeflate(1, 2, 3, 4);
375 rect2.DeflateRect(&rectDeflate);
379 rect2.DeflateRect(sz);
383 rect2.OffsetRect(sz);
387 CRect rect1(35, 150, 10, 25);
389 rect3 =
CRect(98, 999, 6, 3);
407 rect.InflateRect(50, 200);
412 rect.InflateRect(sz);
418 int nHt =
rect.Height();
420 ok(nHt == 40,
"Expected nHt to be 40, was %i\n", nHt);
422 CRect rectOne(125, 0, 150, 200);
423 CRect rectTwo(0, 75, 350, 95);
431 CRect rectInter2 = rectOne;
432 rectInter2 &= rectTwo;
436 CRect rectNone(0, 0, 0, 0);
437 CRect rectSome(35, 50, 135, 150);
442 CRect rectEmpty(35, 35, 35, 35);
448 CRect rectNotNull(0, 0, 35, 50);
451 rect1 =
CRect(35, 150, 10, 25);
453 rect3 =
CRect(98, 999, 6, 3);
467 rect1 =
CRect(100, 235, 200, 335);
475 rect1 =
CRect(100, 235, 200, 335);
477 CRect rectResult(135, 300, 235, 400);
481 rectResult =
CRect(65, 85, 210, 360);
485 rectResult =
CRect(135, 385, 190, 310);
489 rectResult =
CRect(65, 170, 165, 270);
496 rect1 =
CRect(100, 0, 200, 300);
499 rect3 = rect1 &
rect2;
501 rectResult =
CRect(100, 100, 200, 200);
504 rect3 = rect1 |
rect2;
505 rectResult =
CRect(0, 0, 300, 300);
512 rectResult =
CRect(100, 50, 400, 350);
516 rectResult =
CRect(65, -100, 410, 375);
520 rectResult =
CRect(-35, -150, 310, 325);
524 rectResult =
CRect(0, 0, 300, 300);
528 rectResult =
CRect(100, 50, 400, 350);
532 rectResult =
CRect(-100, -50, 200, 250);
537 rectResult =
CRect(30, 20, 320, 120);
542 rectResult =
CRect(10, 40, 300, 140);
546 rect2.MoveToXY(30, 40);
547 rectResult =
CRect(30, 40, 320, 140);
551 rectResult =
CRect(-100, -50, 100, 80);
552 rect2.NormalizeRect();
555 rect2.SetRectEmpty();
556 rectResult =
CRect(0, 0, 0, 0);
561 rect1 =
CRect(5, 40, 40, 120);
564 rectResult =
CRect(10, 30, 80, 100);
568 rect1 =
CRect(10, 40, 70, 110);
571 rectResult =
CRect(8, 20, 40, 130);
static const char * wine_dbgstr_size(const SIZE *psize)
#define ok_int(expression, result)
static const char * wine_dbgstr_rect(const RECT *prc)
static void test_CPoint()
BOOL IsRectNull() const noexcept
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2) noexcept
void CopyRect(LPCRECT lpSrcRect) noexcept
BOOL IsRectEmpty() const noexcept
BOOL EqualRect(LPCRECT lpRect) const noexcept
static const WCHAR empty[]
REFIID LPVOID DWORD_PTR dw
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)