Changeset 0e6e77f in mainline for uspace/lib/gfx/test/coord.c


Ignore:
Timestamp:
2020-02-28T15:44:55Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a8eed5f
Parents:
2a515dcd
git-author:
Jiri Svoboda <jiri@…> (2020-02-26 18:26:13)
git-committer:
Jiri Svoboda <jiri@…> (2020-02-28 15:44:55)
Message:

Window resize by client request

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfx/test/coord.c

    r2a515dcd r0e6e77f  
    239239
    240240/** Sorting span with hight start and lower end point results in transposed span. */
    241 PCUT_TEST(span_points_sort_decs)
     241PCUT_TEST(span_points_sort_desc)
    242242{
    243243        gfx_coord_t a, b;
     
    580580}
    581581
     582/** Rectangle dimensions for straight rectangle are computed correctly */
     583PCUT_TEST(rect_dims_straight)
     584{
     585        gfx_rect_t rect;
     586        gfx_coord2_t dims;
     587
     588        rect.p0.x = 1;
     589        rect.p0.y = 10;
     590        rect.p1.x = 100;
     591        rect.p1.y = 1000;
     592
     593        gfx_rect_dims(&rect, &dims);
     594
     595        PCUT_ASSERT_INT_EQUALS(99, dims.x);
     596        PCUT_ASSERT_INT_EQUALS(990, dims.y);
     597}
     598
     599/** Rectangle dimensions for reversed rectangle are computed correctly */
     600PCUT_TEST(rect_dims_straight)
     601{
     602        gfx_rect_t rect;
     603        gfx_coord2_t dims;
     604
     605        rect.p0.x = 1000;
     606        rect.p0.y = 100;
     607        rect.p1.x = 10;
     608        rect.p1.y = 1;
     609
     610        gfx_rect_dims(&rect, &dims);
     611
     612        PCUT_ASSERT_INT_EQUALS(990, dims.x);
     613        PCUT_ASSERT_INT_EQUALS(99, dims.y);
     614}
     615
    582616/** gfx_rect_is_empty for straight rectangle with zero columns returns true */
    583617PCUT_TEST(rect_is_empty_pos_x)
Note: See TracChangeset for help on using the changeset viewer.