Changeset b8b64a8 in mainline for uspace/lib/ui/test/menuentry.c
- Timestamp:
- 2021-04-12T15:52:12Z (4 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6186f9f
- Parents:
- d65accb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/menuentry.c
rd65accb rb8b64a8 99 99 PCUT_ASSERT_NOT_NULL(menu); 100 100 101 rc = ui_menu_entry_create(menu, "Foo", &mentry);101 rc = ui_menu_entry_create(menu, "Foo", "F1", &mentry); 102 102 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 103 103 PCUT_ASSERT_NOT_NULL(mentry); … … 144 144 PCUT_ASSERT_NOT_NULL(menu); 145 145 146 rc = ui_menu_entry_create(menu, "Foo", &entry1);146 rc = ui_menu_entry_create(menu, "Foo", "F1", &entry1); 147 147 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 148 148 PCUT_ASSERT_NOT_NULL(entry1); 149 149 150 rc = ui_menu_entry_create(menu, "Bar", &entry2);150 rc = ui_menu_entry_create(menu, "Bar", "F2", &entry2); 151 151 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 152 152 PCUT_ASSERT_NOT_NULL(entry2); … … 166 166 } 167 167 168 /** ui_menu_entry_width() / ui_menu_entry_height() */ 169 PCUT_TEST(width_height) 170 { 171 dummy_gc_t *dgc; 172 gfx_context_t *gc; 173 ui_resource_t *resource = NULL; 174 ui_menu_bar_t *mbar = NULL; 175 ui_menu_t *menu = NULL; 176 ui_menu_entry_t *mentry = NULL; 168 /** ui_menu_entry_widths() / ui_menu_entry_height() */ 169 PCUT_TEST(widths_height) 170 { 171 dummy_gc_t *dgc; 172 gfx_context_t *gc; 173 ui_resource_t *resource = NULL; 174 ui_menu_bar_t *mbar = NULL; 175 ui_menu_t *menu = NULL; 176 ui_menu_entry_t *mentry = NULL; 177 gfx_coord_t caption_w; 178 gfx_coord_t shortcut_w; 177 179 gfx_coord_t width; 178 180 gfx_coord_t height; … … 196 198 PCUT_ASSERT_NOT_NULL(menu); 197 199 198 rc = ui_menu_entry_create(menu, "X", &mentry); 199 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 200 PCUT_ASSERT_NOT_NULL(mentry); 201 202 width = ui_menu_entry_width(mentry); 203 PCUT_ASSERT_INT_EQUALS(11 + 8, width); 200 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 201 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 202 PCUT_ASSERT_NOT_NULL(mentry); 203 204 ui_menu_entry_column_widths(mentry, &caption_w, &shortcut_w); 205 PCUT_ASSERT_INT_EQUALS(11, caption_w); 206 PCUT_ASSERT_INT_EQUALS(10, shortcut_w); 207 208 width = ui_menu_entry_calc_width(menu, caption_w, shortcut_w); 209 PCUT_ASSERT_INT_EQUALS(4 + 11 + 8 + 10 + 4, width); 204 210 205 211 height = ui_menu_entry_height(mentry); … … 240 246 PCUT_ASSERT_NOT_NULL(menu); 241 247 242 rc = ui_menu_entry_create(menu, "Foo", &mentry);248 rc = ui_menu_entry_create(menu, "Foo", "F1", &mentry); 243 249 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 244 250 PCUT_ASSERT_NOT_NULL(mentry); … … 284 290 PCUT_ASSERT_NOT_NULL(menu); 285 291 286 rc = ui_menu_entry_create(menu, "X", &mentry);292 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 287 293 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 288 294 PCUT_ASSERT_NOT_NULL(mentry); … … 337 343 PCUT_ASSERT_NOT_NULL(menu); 338 344 339 rc = ui_menu_entry_create(menu, "X", &mentry);345 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 340 346 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 341 347 PCUT_ASSERT_NOT_NULL(mentry); … … 395 401 PCUT_ASSERT_NOT_NULL(menu); 396 402 397 rc = ui_menu_entry_create(menu, "X", &mentry);403 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 398 404 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 399 405 PCUT_ASSERT_NOT_NULL(mentry); … … 458 464 PCUT_ASSERT_NOT_NULL(menu); 459 465 460 rc = ui_menu_entry_create(menu, "X", &mentry);466 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 461 467 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 462 468 PCUT_ASSERT_NOT_NULL(mentry); … … 508 514 PCUT_ASSERT_NOT_NULL(menu); 509 515 510 rc = ui_menu_entry_create(menu, "X", &mentry);516 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 511 517 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 512 518 PCUT_ASSERT_NOT_NULL(mentry); … … 516 522 517 523 event.type = POS_PRESS; 518 event.hpos = 20;524 event.hpos = 40; 519 525 event.vpos = 20; 520 526 … … 558 564 PCUT_ASSERT_NOT_NULL(menu); 559 565 560 rc = ui_menu_entry_create(menu, "X", &mentry);566 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 561 567 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 562 568 PCUT_ASSERT_NOT_NULL(mentry); … … 569 575 570 576 event.type = POS_UPDATE; 571 event.hpos = 20;577 event.hpos = 40; 572 578 event.vpos = 20; 573 579 … … 611 617 PCUT_ASSERT_NOT_NULL(menu); 612 618 613 rc = ui_menu_entry_create(menu, "X", &mentry);619 rc = ui_menu_entry_create(menu, "X", "Y", &mentry); 614 620 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 615 621 PCUT_ASSERT_NOT_NULL(mentry);
Note:
See TracChangeset
for help on using the changeset viewer.