Changeset e1f2079 in mainline for uspace/lib/gfx/test/coord.c
- Timestamp:
- 2020-02-14T19:54:40Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b0a94854
- Parents:
- b252e87
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfx/test/coord.c
rb252e87 re1f2079 68 68 } 69 69 70 /** gfx_coord2_clip with point to lower-left of clipping rectangle */ 71 PCUT_TEST(coord2_clip_ll) 72 { 73 gfx_coord2_t p; 74 gfx_coord2_t cp; 75 gfx_rect_t rect; 76 77 p.x = 1; 78 p.y = 2; 79 80 rect.p0.x = 3; 81 rect.p0.y = 4; 82 rect.p1.x = 5; 83 rect.p1.y = 6; 84 85 gfx_coord2_clip(&p, &rect, &cp); 86 87 PCUT_ASSERT_INT_EQUALS(3, cp.x); 88 PCUT_ASSERT_INT_EQUALS(4, cp.y); 89 } 90 91 /** gfx_coord2_clip with point inside the clipping rectangle */ 92 PCUT_TEST(coord2_clip_mm) 93 { 94 gfx_coord2_t p; 95 gfx_coord2_t cp; 96 gfx_rect_t rect; 97 98 p.x = 2; 99 p.y = 3; 100 101 rect.p0.x = 1; 102 rect.p0.y = 2; 103 rect.p1.x = 3; 104 rect.p1.y = 4; 105 106 gfx_coord2_clip(&p, &rect, &cp); 107 108 PCUT_ASSERT_INT_EQUALS(2, cp.x); 109 PCUT_ASSERT_INT_EQUALS(3, cp.y); 110 } 111 112 /** gfx_coord2_clip with point to upper-right of clipping rectangle */ 113 PCUT_TEST(coord2_clip_hh) 114 { 115 gfx_coord2_t p; 116 gfx_coord2_t cp; 117 gfx_rect_t rect; 118 119 p.x = 5; 120 p.y = 6; 121 122 rect.p0.x = 1; 123 rect.p0.y = 2; 124 rect.p1.x = 3; 125 rect.p1.y = 4; 126 127 gfx_coord2_clip(&p, &rect, &cp); 128 129 PCUT_ASSERT_INT_EQUALS(2, cp.x); 130 PCUT_ASSERT_INT_EQUALS(3, cp.y); 131 } 132 70 133 /** gfx_rect_translate should translate rectangle */ 71 134 PCUT_TEST(rect_translate)
Note:
See TracChangeset
for help on using the changeset viewer.