Changeset 5e758e4 in mainline for uspace/lib/ui/test/list.c


Ignore:
Timestamp:
2023-11-19T12:22:11Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, topic/simplify-dev-export
Children:
69935a8
Parents:
e8a6279f
Message:

When start menu entry is edited, editor list needs updating

We need to update the entry caption in the UI list to reflect
any changes made while the entry was being edited.

File:
1 edited

Legend:

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

    re8a6279f r5e758e4  
    10391039}
    10401040
     1041/** ui_list_entry_set_caption() sets entry captino */
     1042PCUT_TEST(entry_set_caption)
     1043{
     1044        ui_t *ui;
     1045        ui_window_t *window;
     1046        ui_wnd_params_t params;
     1047        ui_list_t *list;
     1048        ui_list_entry_attr_t attr;
     1049        ui_list_entry_t *entry;
     1050        errno_t rc;
     1051
     1052        rc = ui_create_disp(NULL, &ui);
     1053        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1054
     1055        ui_wnd_params_init(&params);
     1056        params.caption = "Test";
     1057
     1058        rc = ui_window_create(ui, &params, &window);
     1059        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1060
     1061        rc = ui_list_create(window, true, &list);
     1062        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1063
     1064        ui_list_entry_attr_init(&attr);
     1065
     1066        /* Append entry and get pointer to it */
     1067        attr.caption = "a";
     1068        attr.arg = (void *)1;
     1069        entry = NULL;
     1070        rc = ui_list_entry_append(list, &attr, &entry);
     1071        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1072        PCUT_ASSERT_NOT_NULL(entry);
     1073
     1074        /* Change caption */
     1075        rc = ui_list_entry_set_caption(entry, "b");
     1076        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     1077        PCUT_ASSERT_STR_EQUALS("b", entry->caption);
     1078
     1079        ui_list_destroy(list);
     1080        ui_window_destroy(window);
     1081        ui_destroy(ui);
     1082}
     1083
    10411084/** ui_list_entries_cnt() returns the number of entries */
    10421085PCUT_TEST(entries_cnt)
Note: See TracChangeset for help on using the changeset viewer.