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


Ignore:
Timestamp:
2021-01-06T10:06:42Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7020d1f
Parents:
e037cf37
git-author:
Jiri Svoboda <jiri@…> (2021-01-05 18:06:37)
git-committer:
Jiri Svoboda <jiri@…> (2021-01-06 10:06:42)
Message:

Check box

File:
1 edited

Legend:

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

    re037cf37 rd70dc1c4  
    3333#include <stdbool.h>
    3434#include <ui/paint.h>
     35#include <ui/resource.h>
    3536
    3637PCUT_INIT;
     
    103104        gfx_color_delete(color2);
    104105        gfx_color_delete(color1);
     106        rc = gfx_context_delete(gc);
     107        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     108}
     109
     110/** Paint inset frame */
     111PCUT_TEST(inset_frame)
     112{
     113        errno_t rc;
     114        gfx_context_t *gc = NULL;
     115        ui_resource_t *resource = NULL;
     116        test_gc_t tgc;
     117        gfx_rect_t rect;
     118        gfx_rect_t inside;
     119
     120        memset(&tgc, 0, sizeof(tgc));
     121        rc = gfx_context_new(&ops, &tgc, &gc);
     122        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     123
     124        rc = ui_resource_create(gc, &resource);
     125        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     126        PCUT_ASSERT_NOT_NULL(resource);
     127
     128        /* Paint inset frame with NULL 'inside' output parameter */
     129        rc = ui_paint_inset_frame(resource, &rect, NULL);
     130        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     131
     132        /* Paint inset frame with valid 'inside' output parameter */
     133        rc = ui_paint_inset_frame(resource, &rect, &inside);
     134        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     135
    105136        rc = gfx_context_delete(gc);
    106137        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
Note: See TracChangeset for help on using the changeset viewer.