Changeset 6186f9f in mainline for uspace/lib/ui/test/menuentry.c
- Timestamp:
- 2021-04-13T17:20:20Z (4 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f3a7b0d
- Parents:
- b8b64a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/menuentry.c
rb8b64a8 r6186f9f 51 51 static void test_entry_cb(ui_menu_entry_t *, void *); 52 52 53 /** Create and destroy menu bar*/53 /** Create and destroy menu entry */ 54 54 PCUT_TEST(create_destroy) 55 55 { 56 ui_menu_bar_t *mbar = NULL; 57 errno_t rc; 58 59 rc = ui_menu_bar_create(NULL, &mbar); 60 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 61 PCUT_ASSERT_NOT_NULL(mbar); 62 63 ui_menu_bar_destroy(mbar); 56 dummy_gc_t *dgc; 57 gfx_context_t *gc; 58 ui_resource_t *resource = NULL; 59 ui_menu_bar_t *mbar = NULL; 60 ui_menu_t *menu = NULL; 61 ui_menu_entry_t *mentry = NULL; 62 errno_t rc; 63 64 rc = dummygc_create(&dgc); 65 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 66 67 gc = dummygc_get_ctx(dgc); 68 69 rc = ui_resource_create(gc, false, &resource); 70 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 71 PCUT_ASSERT_NOT_NULL(resource); 72 73 rc = ui_menu_bar_create(resource, &mbar); 74 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 75 PCUT_ASSERT_NOT_NULL(mbar); 76 77 rc = ui_menu_create(mbar, "Test", &menu); 78 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 79 PCUT_ASSERT_NOT_NULL(menu); 80 81 rc = ui_menu_entry_create(menu, "Foo", "F1", &mentry); 82 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 83 PCUT_ASSERT_NOT_NULL(mentry); 84 85 /* Just for sake of test. Menu entry is destroyed along with menu */ 86 ui_menu_entry_destroy(mentry); 87 88 ui_menu_bar_destroy(mbar); 89 dummygc_destroy(dgc); 90 } 91 92 /** Create and destroy separator menu entry */ 93 PCUT_TEST(create_sep_destroy) 94 { 95 dummy_gc_t *dgc; 96 gfx_context_t *gc; 97 ui_resource_t *resource = NULL; 98 ui_menu_bar_t *mbar = NULL; 99 ui_menu_t *menu = NULL; 100 ui_menu_entry_t *mentry = NULL; 101 errno_t rc; 102 103 rc = dummygc_create(&dgc); 104 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 105 106 gc = dummygc_get_ctx(dgc); 107 108 rc = ui_resource_create(gc, false, &resource); 109 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 110 PCUT_ASSERT_NOT_NULL(resource); 111 112 rc = ui_menu_bar_create(resource, &mbar); 113 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 114 PCUT_ASSERT_NOT_NULL(mbar); 115 116 rc = ui_menu_create(mbar, "Test", &menu); 117 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 118 PCUT_ASSERT_NOT_NULL(menu); 119 120 rc = ui_menu_entry_sep_create(menu, &mentry); 121 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 122 PCUT_ASSERT_NOT_NULL(mentry); 123 124 /* Just for sake of test. Menu entry is destroyed along with menu */ 125 ui_menu_entry_destroy(mentry); 126 127 ui_menu_bar_destroy(mbar); 128 dummygc_destroy(dgc); 64 129 } 65 130
Note:
See TracChangeset
for help on using the changeset viewer.