Changeset 6301a24f in mainline for uspace/lib/gfx/test/coord.c
- Timestamp:
- 2020-06-05T20:20:06Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8aef01c
- Parents:
- d70e7b7b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfx/test/coord.c
rd70e7b7b r6301a24f 560 560 } 561 561 562 /** Clip rectangle with no clipping rectangle */ 563 PCUT_TEST(rect_clip_rect_noclip) 564 { 565 gfx_rect_t rect; 566 gfx_rect_t dest; 567 568 rect.p0.x = 1; 569 rect.p0.y = 2; 570 rect.p1.x = 3; 571 rect.p1.y = 4; 572 573 gfx_rect_clip(&rect, NULL, &dest); 574 PCUT_ASSERT_INT_EQUALS(rect.p0.x, dest.p0.x); 575 PCUT_ASSERT_INT_EQUALS(rect.p0.y, dest.p0.y); 576 PCUT_ASSERT_INT_EQUALS(rect.p1.x, dest.p1.x); 577 PCUT_ASSERT_INT_EQUALS(rect.p1.y, dest.p1.y); 578 } 579 562 580 /** Sort span points that are already sorted should produde indentical points */ 563 581 PCUT_TEST(rect_points_sort_sorted) … … 638 656 } 639 657 640 /** gfx_rect_is_empty for st aright non-empty rectangle returns false */658 /** gfx_rect_is_empty for straight non-empty rectangle returns false */ 641 659 PCUT_TEST(rect_is_empty_neg) 642 660 { … … 662 680 } 663 681 682 /** gfx_rect_is_incident for neighboring rectangles returns false */ 683 PCUT_TEST(rect_is_incident_neighbor) 684 { 685 gfx_rect_t a; 686 gfx_rect_t b; 687 688 a.p0.x = 1; 689 a.p0.y = 2; 690 a.p1.x = 3; 691 a.p1.y = 4; 692 693 b.p0.x = 3; 694 b.p0.y = 2; 695 b.p1.x = 5; 696 b.p1.y = 6; 697 698 PCUT_ASSERT_FALSE(gfx_rect_is_incident(&a, &b)); 699 } 700 701 /** gfx_rect_is_incident for a inside b returns true */ 702 PCUT_TEST(rect_is_incident_a_inside_b) 703 { 704 gfx_rect_t a; 705 gfx_rect_t b; 706 707 a.p0.x = 2; 708 a.p0.y = 3; 709 a.p1.x = 4; 710 a.p1.y = 5; 711 712 b.p0.x = 1; 713 b.p0.y = 2; 714 b.p1.x = 5; 715 b.p1.y = 6; 716 717 PCUT_ASSERT_TRUE(gfx_rect_is_incident(&a, &b)); 718 } 719 720 /** gfx_rect_is_incident for b inside a returns true */ 721 PCUT_TEST(rect_is_incident_b_inside_a) 722 { 723 gfx_rect_t a; 724 gfx_rect_t b; 725 726 a.p0.x = 1; 727 a.p0.y = 2; 728 a.p1.x = 5; 729 a.p1.y = 6; 730 731 b.p0.x = 2; 732 b.p0.y = 3; 733 b.p1.x = 4; 734 b.p1.y = 5; 735 736 PCUT_ASSERT_TRUE(gfx_rect_is_incident(&a, &b)); 737 } 738 739 /** gfx_rect_is_incident for a and b sharing corner returns true */ 740 PCUT_TEST(rect_is_incident_corner) 741 { 742 gfx_rect_t a; 743 gfx_rect_t b; 744 745 a.p0.x = 1; 746 a.p0.y = 2; 747 a.p1.x = 3; 748 a.p1.y = 4; 749 750 b.p0.x = 2; 751 b.p0.y = 3; 752 b.p1.x = 4; 753 b.p1.y = 5; 754 755 PCUT_ASSERT_TRUE(gfx_rect_is_incident(&a, &b)); 756 } 757 758 /** gfx_rect_is_incident for a == b returns true */ 759 PCUT_TEST(rect_is_incident_same) 760 { 761 gfx_rect_t a; 762 gfx_rect_t b; 763 764 a.p0.x = 1; 765 a.p0.y = 2; 766 a.p1.x = 3; 767 a.p1.y = 4; 768 769 b.p0.x = 1; 770 b.p0.y = 2; 771 b.p1.x = 3; 772 b.p1.y = 4; 773 774 PCUT_ASSERT_TRUE(gfx_rect_is_incident(&a, &b)); 775 } 776 664 777 /** gfx_pix_inside_rect for */ 665 778 PCUT_TEST(pix_inside_rect)
Note:
See TracChangeset
for help on using the changeset viewer.