Changeset 3d10a2f in mainline for uspace/lib/ui/test/window.c


Ignore:
Timestamp:
2021-10-04T12:25:43Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cd981f2a, e0e1b3d
Parents:
6d172f6
git-author:
Jiri Svoboda <jiri@…> (2021-10-03 17:25:36)
git-committer:
Jiri Svoboda <jiri@…> (2021-10-04 12:25:43)
Message:

Null display spec for the benefit of unit testing

When testing something that takes a display specification as argument,
it is useful to be able to be able to specify dummy output (so far,
only ui_create_disp() could create a UI with dummy output.

File:
1 edited

Legend:

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

    r6d172f6 r3d10a2f  
    258258}
    259259
     260/** ui_window_get_ui() returns containing UI */
     261PCUT_TEST(get_ui)
     262{
     263        errno_t rc;
     264        ui_t *ui = NULL;
     265        ui_t *rui;
     266        ui_wnd_params_t params;
     267        ui_window_t *window = NULL;
     268
     269        rc = ui_create_disp(NULL, &ui);
     270        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     271
     272        ui_wnd_params_init(&params);
     273        params.caption = "Hello";
     274
     275        rc = ui_window_create(ui, &params, &window);
     276        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     277        PCUT_ASSERT_NOT_NULL(window);
     278
     279        rui = ui_window_get_ui(window);
     280        PCUT_ASSERT_EQUALS(ui, rui);
     281
     282        ui_window_destroy(window);
     283        ui_destroy(ui);
     284}
     285
    260286/** ui_window_get_res/gc/rect() return valid objects */
    261287PCUT_TEST(get_res_gc_rect)
Note: See TracChangeset for help on using the changeset viewer.