Changeset 68d68e9 in mainline for uspace/app/taskbar/test/wndlist.c


Ignore:
Timestamp:
2022-11-23T12:50:27Z (17 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c4a53280
Parents:
6e91475
Message:

Vary window button size to fit

If they get too narrow, we stop adding more buttons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/test/wndlist.c

    r6e91475 r68d68e9  
    407407}
    408408
     409/** Test wndlist_count() */
     410PCUT_TEST(count)
     411{
     412        errno_t rc;
     413        ui_t *ui = NULL;
     414        ui_wnd_params_t params;
     415        ui_window_t *window = NULL;
     416        ui_fixed_t *fixed = NULL;
     417        wndlist_t *wndlist;
     418        size_t count;
     419
     420        rc = ui_create_disp(NULL, &ui);
     421        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     422
     423        ui_wnd_params_init(&params);
     424        params.caption = "Hello";
     425
     426        rc = ui_window_create(ui, &params, &window);
     427        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     428        PCUT_ASSERT_NOT_NULL(window);
     429
     430        rc = ui_fixed_create(&fixed);
     431        ui_window_add(window, ui_fixed_ctl(fixed));
     432
     433        rc = wndlist_create(window, fixed, &wndlist);
     434        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     435
     436        count = wndlist_count(wndlist);
     437        PCUT_ASSERT_INT_EQUALS(0, count);
     438
     439        rc = wndlist_append(wndlist, 1, "Foo", true);
     440        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     441
     442        count = wndlist_count(wndlist);
     443        PCUT_ASSERT_INT_EQUALS(1, count);
     444
     445        rc = wndlist_append(wndlist, 2, "Bar", true);
     446        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     447
     448        count = wndlist_count(wndlist);
     449        PCUT_ASSERT_INT_EQUALS(2, count);
     450
     451        wndlist_destroy(wndlist);
     452
     453        ui_window_destroy(window);
     454        ui_destroy(ui);
     455}
     456
    409457/** Test repainting window list */
    410458PCUT_TEST(repaint)
Note: See TracChangeset for help on using the changeset viewer.