Changeset 35cffea in mainline for uspace/lib/ui/test/paint.c


Ignore:
Timestamp:
2022-05-19T08:02:31Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ad698f4
Parents:
fd05ea6
git-author:
Jiri Svoboda <jiri@…> (2022-05-18 17:02:12)
git-committer:
Jiri Svoboda <jiri@…> (2022-05-19 08:02:31)
Message:

Maximizing/unmaximizing a window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/test/paint.c

    rfd05ea6 r35cffea  
    354354}
    355355
     356/** Paint maximize icon */
     357PCUT_TEST(maxicon)
     358{
     359        errno_t rc;
     360        gfx_context_t *gc = NULL;
     361        ui_resource_t *resource = NULL;
     362        test_gc_t tgc;
     363        gfx_coord2_t center;
     364
     365        memset(&tgc, 0, sizeof(tgc));
     366        rc = gfx_context_new(&ops, &tgc, &gc);
     367        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     368
     369        rc = ui_resource_create(gc, false, &resource);
     370        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     371        PCUT_ASSERT_NOT_NULL(resource);
     372
     373        center.x = 0;
     374        center.y = 0;
     375
     376        rc = ui_paint_maxicon(resource, &center, 8, 6);
     377        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     378
     379        ui_resource_destroy(resource);
     380        rc = gfx_context_delete(gc);
     381        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     382}
     383
     384/** Paint unmaximize icon */
     385PCUT_TEST(unmaxicon)
     386{
     387        errno_t rc;
     388        gfx_context_t *gc = NULL;
     389        ui_resource_t *resource = NULL;
     390        test_gc_t tgc;
     391        gfx_coord2_t center;
     392
     393        memset(&tgc, 0, sizeof(tgc));
     394        rc = gfx_context_new(&ops, &tgc, &gc);
     395        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     396
     397        rc = ui_resource_create(gc, false, &resource);
     398        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     399        PCUT_ASSERT_NOT_NULL(resource);
     400
     401        center.x = 0;
     402        center.y = 0;
     403
     404        rc = ui_paint_unmaxicon(resource, &center, 8, 8, 3, 3);
     405        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     406
     407        ui_resource_destroy(resource);
     408        rc = gfx_context_delete(gc);
     409        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     410}
     411
    356412/** Paint text box */
    357413PCUT_TEST(text_box)
Note: See TracChangeset for help on using the changeset viewer.