Changeset f7a90df in mainline


Ignore:
Timestamp:
2020-10-25T19:20:57Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d284ce9
Parents:
5a43bd0
Message:

Prototype UI and window classes

It is difficult to do any useful testing on ui_window without a real
display_t. Without display, there is no window, without window no GC,
without GC no UI resource.

As a compromise, in case of unit test, create UI with display == NULL,
in which case create window with NULL dwindow and a dummy GC
(so we have valid UI resource).

Location:
uspace/lib
Files:
12 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/display/src/display.c

    r5a43bd0 rf7a90df  
    198198/** Destroy display window.
    199199 *
    200  * @param window Window
     200 * @param window Window or @c NULL
    201201 * @return EOK on success or an error code. In both cases @a window must
    202202 *         not be accessed anymore
     
    206206        async_exch_t *exch;
    207207        errno_t rc;
     208
     209        if (window == NULL)
     210                return EOK;
    208211
    209212        exch = async_exchange_begin(window->display->sess);
  • uspace/lib/display/test/display.c

    r5a43bd0 rf7a90df  
    331331}
    332332
     333/** display_window_destroy() can handle NULL argument */
     334PCUT_TEST(window_destroy_null)
     335{
     336        display_window_destroy(NULL);
     337}
     338
    333339/** display_window_move_req() with server returning error response works. */
    334340PCUT_TEST(window_move_req_failure)
  • uspace/lib/ui/meson.build

    r5a43bd0 rf7a90df  
    2727#
    2828
    29 deps = [ 'gfx', 'gfxfont' ]
     29deps = [ 'gfx', 'gfxfont', 'display' ]
    3030src = files(
     31        'src/dummygc.c',
    3132        'src/label.c',
    3233        'src/paint.c',
    3334        'src/pbutton.c',
    3435        'src/resource.c',
    35         'src/wdecor.c'
     36        'src/ui.c',
     37        'src/wdecor.c',
     38        'src/window.c',
    3639)
    3740
     
    4245        'test/pbutton.c',
    4346        'test/resource.c',
     47        'test/ui.c',
    4448        'test/wdecor.c',
     49        'test/window.c',
    4550)
  • uspace/lib/ui/test/main.c

    r5a43bd0 rf7a90df  
    3535PCUT_IMPORT(pbutton);
    3636PCUT_IMPORT(resource);
     37PCUT_IMPORT(ui);
    3738PCUT_IMPORT(wdecor);
     39PCUT_IMPORT(window);
    3840
    3941PCUT_MAIN();
Note: See TracChangeset for help on using the changeset viewer.