Changeset 266ec54 in mainline for uspace/lib/gfx/test/coord.c


Ignore:
Timestamp:
2020-11-28T23:06:31Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
db3c6795
Parents:
554a5f1
git-author:
Jiri Svoboda <jiri@…> (2020-11-27 22:30:28)
git-committer:
Jiri Svoboda <jiri@…> (2020-11-28 23:06:31)
Message:

Viewer fullsreen mode

Fullscreen window placement is more of a stopgap. Proper
solution would probably be via maximizing the window.

File:
1 edited

Legend:

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

    r554a5f1 r266ec54  
    597597}
    598598
     599/** Center rectangle on rectangle */
     600PCUT_TEST(rect_ctr_on_rect)
     601{
     602        gfx_rect_t a;
     603        gfx_rect_t b;
     604        gfx_rect_t dest;
     605
     606        /* Dimensions: 20 x 20 */
     607        b.p0.x = 10;
     608        b.p0.y = 20;
     609        b.p1.x = 30;
     610        b.p1.y = 40;
     611
     612        /* Dimensions: 20 x 20 */
     613        a.p0.x = 100;
     614        a.p0.y = 200;
     615        a.p1.x = 120;
     616        a.p1.y = 220;
     617
     618        /* Centering rectangle of same size should give us the same rectangle */
     619        gfx_rect_ctr_on_rect(&a, &b, &dest);
     620        PCUT_ASSERT_INT_EQUALS(b.p0.x, dest.p0.x);
     621        PCUT_ASSERT_INT_EQUALS(b.p0.y, dest.p0.y);
     622        PCUT_ASSERT_INT_EQUALS(b.p1.x, dest.p1.x);
     623        PCUT_ASSERT_INT_EQUALS(b.p1.y, dest.p1.y);
     624
     625        /* Dimensions: 10 x 10 */
     626        a.p0.x = 100;
     627        a.p0.y = 200;
     628        a.p1.x = 110;
     629        a.p1.y = 210;
     630
     631        gfx_rect_ctr_on_rect(&a, &b, &dest);
     632        PCUT_ASSERT_INT_EQUALS(15, dest.p0.x);
     633        PCUT_ASSERT_INT_EQUALS(25, dest.p0.y);
     634        PCUT_ASSERT_INT_EQUALS(25, dest.p1.x);
     635        PCUT_ASSERT_INT_EQUALS(35, dest.p1.y);
     636}
     637
    599638/** Sort span points that are already sorted should produde indentical points */
    600639PCUT_TEST(rect_points_sort_sorted)
Note: See TracChangeset for help on using the changeset viewer.