289{
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());
295
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());
299
305
307 CRect rect3(&sdkRect);
310
315
316 CPoint ptBottomRight(100, 50);
317 CRect rect5(
pt, ptBottomRight);
319
322
323 ptDown =
rect.BottomRight();
324
327
330
331 rect2.BottomRight() = ptLow;
332
335
339
340 pt2 =
rect2.BottomRight();
343
344 pt2 =
rect2.TopLeft();
347
348 rect2.TopLeft().Offset(3, 3);
349 rect3 =
CRect(13, 13, 180, 180);
351
352 CRect rectSource(35, 10, 125, 10);
354
356
358 rectSource2.
left = 0;
361 rectSource2.
right = 640;
362
364
366
367 rect.DeflateRect(1, 2);
368
371
373 CRect rectDeflate(1, 2, 3, 4);
374
375 rect2.DeflateRect(&rectDeflate);
378
379 rect2.DeflateRect(sz);
382
383 rect2.OffsetRect(sz);
386
387 CRect rect1(35, 150, 10, 25);
389 rect3 =
CRect(98, 999, 6, 3);
390
393
399
401
405
407 rect.InflateRect(50, 200);
408
411
412 rect.InflateRect(sz);
415
417
418 int nHt =
rect.Height();
419
420 ok(nHt == 40,
"Expected nHt to be 40, was %i\n", nHt);
421
422 CRect rectOne(125, 0, 150, 200);
423 CRect rectTwo(0, 75, 350, 95);
425
427
430
431 CRect rectInter2 = rectOne;
432 rectInter2 &= rectTwo;
435
436 CRect rectNone(0, 0, 0, 0);
437 CRect rectSome(35, 50, 135, 150);
438
439 ok(rectNone.IsRectEmpty(),
"Expected IsRectEmpty to return TRUE for %s\n",
wine_dbgstr_rect(&rectNone));
440 ok(!rectSome.IsRectEmpty(),
"Expected IsRectEmpty to return FALSE for %s\n",
wine_dbgstr_rect(&rectSome));
441
442 CRect rectEmpty(35, 35, 35, 35);
443 ok(rectEmpty.IsRectEmpty(),
"Expected IsRectEmpty to return TRUE for %s\n",
wine_dbgstr_rect(&rectEmpty));
444
445 ok(rectNone.IsRectNull(),
"Expected IsRectNull to return TRUE for %s\n",
wine_dbgstr_rect(&rectNone));
446 ok(!rectSome.IsRectNull(),
"Expected IsRectNull to return FALSE for %s\n",
wine_dbgstr_rect(&rectSome));
447
448 CRect rectNotNull(0, 0, 35, 50);
449 ok(!rectNotNull.IsRectNull(),
"Expected IsRectNull to return FALSE for %s\n",
wine_dbgstr_rect(&rectNotNull));
450
451 rect1 =
CRect(35, 150, 10, 25);
453 rect3 =
CRect(98, 999, 6, 3);
454
456
461
463
466
467 rect1 =
CRect(100, 235, 200, 335);
470
472
474
475 rect1 =
CRect(100, 235, 200, 335);
477 CRect rectResult(135, 300, 235, 400);
479
481 rectResult =
CRect(65, 85, 210, 360);
483
485 rectResult =
CRect(135, 385, 190, 310);
487
489 rectResult =
CRect(65, 170, 165, 270);
490
492
495
496 rect1 =
CRect(100, 0, 200, 300);
498
499 rect3 = rect1 &
rect2;
500
501 rectResult =
CRect(100, 100, 200, 200);
503
504 rect3 = rect1 |
rect2;
505 rectResult =
CRect(0, 0, 300, 300);
507
510
511 rect1 += sz;
512 rectResult =
CRect(100, 50, 400, 350);
514
516 rectResult =
CRect(65, -100, 410, 375);
518
519 rect1 -= sz;
520 rectResult =
CRect(-35, -150, 310, 325);
522
524 rectResult =
CRect(0, 0, 300, 300);
526
528 rectResult =
CRect(100, 50, 400, 350);
530
532 rectResult =
CRect(-100, -50, 200, 250);
534
537 rectResult =
CRect(30, 20, 320, 120);
539
542 rectResult =
CRect(10, 40, 300, 140);
544
546 rect2.MoveToXY(30, 40);
547 rectResult =
CRect(30, 40, 320, 140);
549
551 rectResult =
CRect(-100, -50, 100, 80);
552 rect2.NormalizeRect();
554
555 rect2.SetRectEmpty();
556 rectResult =
CRect(0, 0, 0, 0);
558
560
561 rect1 =
CRect(5, 40, 40, 120);
564 rectResult =
CRect(10, 30, 80, 100);
567
568 rect1 =
CRect(10, 40, 70, 110);
571 rectResult =
CRect(8, 20, 40, 130);
574}
#define ok_int(expression, result)
static const char * wine_dbgstr_rect(const RECT *prc)
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2) noexcept
void CopyRect(LPCRECT lpSrcRect) noexcept
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)