Changeset 96c6a00 in mainline for uspace/lib/ui/test/menubar.c
- Timestamp:
- 2022-03-10T13:44:10Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c88d7f99
- Parents:
- ca2680d
- git-author:
- Jiri Svoboda <jiri@…> (2022-03-09 18:44:00)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-03-10 13:44:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/menubar.c
rca2680d r96c6a00 187 187 188 188 event.type = KEY_PRESS; 189 event.key = KC_ESCAPE; 189 event.key = KC_F10; 190 event.mods = 0; 190 191 claimed = ui_menu_bar_kbd_event(mbar, &event); 191 192 PCUT_ASSERT_ERRNO_VAL(EOK, rc); … … 249 250 } 250 251 251 /** Calling ui_menu_bar_select() with the same menu twice deselects it */252 PCUT_TEST(select_same)253 {254 ui_t *ui = NULL;255 ui_window_t *window = NULL;256 ui_wnd_params_t params;257 ui_menu_bar_t *mbar = NULL;258 ui_menu_t *menu = NULL;259 errno_t rc;260 261 rc = ui_create_disp(NULL, &ui);262 PCUT_ASSERT_ERRNO_VAL(EOK, rc);263 264 ui_wnd_params_init(¶ms);265 params.caption = "Hello";266 267 rc = ui_window_create(ui, ¶ms, &window);268 PCUT_ASSERT_ERRNO_VAL(EOK, rc);269 PCUT_ASSERT_NOT_NULL(window);270 271 rc = ui_menu_bar_create(ui, window, &mbar);272 PCUT_ASSERT_ERRNO_VAL(EOK, rc);273 PCUT_ASSERT_NOT_NULL(mbar);274 275 rc = ui_menu_create(mbar, "Test", &menu);276 PCUT_ASSERT_ERRNO_VAL(EOK, rc);277 PCUT_ASSERT_NOT_NULL(menu);278 279 ui_menu_bar_select(mbar, menu, true);280 PCUT_ASSERT_EQUALS(menu, mbar->selected);281 282 /* Selecting again should unselect the menu */283 ui_menu_bar_select(mbar, menu, true);284 PCUT_ASSERT_NULL(mbar->selected);285 286 ui_menu_bar_destroy(mbar);287 ui_window_destroy(window);288 ui_destroy(ui);289 }290 291 252 /** Calling ui_menu_bar_select() with another menu selects it */ 292 253 PCUT_TEST(select_different)
Note:
See TracChangeset
for help on using the changeset viewer.