285{
287 ok(
empty.left == 0,
"Expected left to be 0, was %ld\n",
empty.left);
288 ok(
empty.top == 0,
"Expected top to be 0, was %ld\n",
empty.top);
289 ok(
empty.Width() == 0,
"Expected Width to be 0, was %i\n",
empty.Width());
290 ok(
empty.Height() == 0,
"Expected Height to be 0, was %i\n",
empty.Height());
291
293 ok(
rect.Width() == 100,
"Expected Width to be 100, was %i\n",
rect.Width());
294 ok(
rect.Height() == 50,
"Expected Height to be 50, was %i\n",
rect.Height());
295
301
303 CRect rect3(&sdkRect);
306
311
312 CPoint ptBottomRight(100, 50);
313 CRect rect5(
pt, ptBottomRight);
315
318
319 ptDown =
rect.BottomRight();
320
323
326
327 rect2.BottomRight() = ptLow;
328
331
335
336 pt2 =
rect2.BottomRight();
339
340 pt2 =
rect2.TopLeft();
343
344 rect2.TopLeft().Offset(3, 3);
345 rect3 =
CRect(13, 13, 180, 180);
347
348 CRect rectSource(35, 10, 125, 10);
350
352
354 rectSource2.
left = 0;
357 rectSource2.
right = 640;
358
360
362
363 rect.DeflateRect(1, 2);
364
367
369 CRect rectDeflate(1, 2, 3, 4);
370
371 rect2.DeflateRect(&rectDeflate);
374
375 rect2.DeflateRect(sz);
378
379 rect2.OffsetRect(sz);
382
383 CRect rect1(35, 150, 10, 25);
385 rect3 =
CRect(98, 999, 6, 3);
386
389
395
397
401
403 rect.InflateRect(50, 200);
404
407
408 rect.InflateRect(sz);
411
413
414 int nHt =
rect.Height();
415
416 ok(nHt == 40,
"Expected nHt to be 40, was %i\n", nHt);
417
418 CRect rectOne(125, 0, 150, 200);
419 CRect rectTwo(0, 75, 350, 95);
421
423
426
427 CRect rectInter2 = rectOne;
428 rectInter2 &= rectTwo;
431
432 CRect rectNone(0, 0, 0, 0);
433 CRect rectSome(35, 50, 135, 150);
434
435 ok(rectNone.IsRectEmpty(),
"Expected IsRectEmpty to return TRUE for %s\n",
wine_dbgstr_rect(&rectNone));
436 ok(!rectSome.IsRectEmpty(),
"Expected IsRectEmpty to return FALSE for %s\n",
wine_dbgstr_rect(&rectSome));
437
438 CRect rectEmpty(35, 35, 35, 35);
439 ok(rectEmpty.IsRectEmpty(),
"Expected IsRectEmpty to return TRUE for %s\n",
wine_dbgstr_rect(&rectEmpty));
440
441 ok(rectNone.IsRectNull(),
"Expected IsRectNull to return TRUE for %s\n",
wine_dbgstr_rect(&rectNone));
442 ok(!rectSome.IsRectNull(),
"Expected IsRectNull to return FALSE for %s\n",
wine_dbgstr_rect(&rectSome));
443
444 CRect rectNotNull(0, 0, 35, 50);
445 ok(!rectNotNull.IsRectNull(),
"Expected IsRectNull to return FALSE for %s\n",
wine_dbgstr_rect(&rectNotNull));
446
447 rect1 =
CRect(35, 150, 10, 25);
449 rect3 =
CRect(98, 999, 6, 3);
450
452
457
459
462
463 rect1 =
CRect(100, 235, 200, 335);
466
468
470
471 rect1 =
CRect(100, 235, 200, 335);
473 CRect rectResult(135, 300, 235, 400);
475
477 rectResult =
CRect(65, 85, 210, 360);
479
481 rectResult =
CRect(135, 385, 190, 310);
483
485 rectResult =
CRect(65, 170, 165, 270);
486
488
491
492 rect1 =
CRect(100, 0, 200, 300);
494
495 rect3 = rect1 &
rect2;
496
497 rectResult =
CRect(100, 100, 200, 200);
499
500 rect3 = rect1 |
rect2;
501 rectResult =
CRect(0, 0, 300, 300);
503
506
507 rect1 += sz;
508 rectResult =
CRect(100, 50, 400, 350);
510
512 rectResult =
CRect(65, -100, 410, 375);
514
515 rect1 -= sz;
516 rectResult =
CRect(-35, -150, 310, 325);
518
520 rectResult =
CRect(0, 0, 300, 300);
522
524 rectResult =
CRect(100, 50, 400, 350);
526
528 rectResult =
CRect(-100, -50, 200, 250);
530}
void CopyRect(LPCRECT lpSrcRect)
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2)
static __inline const char * wine_dbgstr_rect(const RECT *rect)