Changeset f0155e4 in mainline
- Timestamp:
- 2021-11-04T17:40:24Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0802ab6
- Parents:
- e3e64f6
- Location:
- uspace/lib/ui/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/entry.c
re3e64f6 rf0155e4 106 106 PCUT_TEST(set_halign) 107 107 { 108 ui_entry_t *entry; 109 errno_t rc; 110 111 rc = ui_entry_create(NULL, "Hello", &entry); 108 errno_t rc; 109 ui_t *ui = NULL; 110 ui_window_t *window = NULL; 111 ui_wnd_params_t params; 112 ui_entry_t *entry; 113 114 rc = ui_create_disp(NULL, &ui); 115 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 116 117 ui_wnd_params_init(¶ms); 118 params.caption = "Hello"; 119 120 rc = ui_window_create(ui, ¶ms, &window); 121 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 122 PCUT_ASSERT_NOT_NULL(window); 123 124 rc = ui_entry_create(window, "Hello", &entry); 112 125 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 113 126 … … 118 131 119 132 ui_entry_destroy(entry); 133 ui_window_destroy(window); 134 ui_destroy(ui); 120 135 } 121 136 -
uspace/lib/ui/test/popup.c
re3e64f6 rf0155e4 98 98 errno_t rc; 99 99 ui_t *ui = NULL; 100 ui_wnd_params_t wparams; 101 ui_window_t *window = NULL; 100 102 ui_popup_params_t params; 101 103 ui_popup_t *popup = NULL; … … 104 106 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 105 107 108 ui_wnd_params_init(&wparams); 109 wparams.caption = "Hello"; 110 111 rc = ui_window_create(ui, &wparams, &window); 112 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 113 PCUT_ASSERT_NOT_NULL(window); 114 106 115 ui_popup_params_init(¶ms); 107 116 108 rc = ui_popup_create(ui, NULL, ¶ms, &popup);117 rc = ui_popup_create(ui, window, ¶ms, &popup); 109 118 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 110 119 PCUT_ASSERT_NOT_NULL(popup); 111 120 112 121 ui_popup_destroy(popup); 122 ui_window_destroy(window); 113 123 ui_destroy(ui); 114 124 } … … 125 135 errno_t rc; 126 136 ui_t *ui = NULL; 137 ui_wnd_params_t wparams; 138 ui_window_t *window = NULL; 127 139 ui_popup_params_t params; 128 140 ui_popup_t *popup = NULL; … … 133 145 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 134 146 147 ui_wnd_params_init(&wparams); 148 wparams.caption = "Hello"; 149 150 rc = ui_window_create(ui, &wparams, &window); 151 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 152 PCUT_ASSERT_NOT_NULL(window); 153 135 154 ui_popup_params_init(¶ms); 136 155 137 rc = ui_popup_create(ui, NULL, ¶ms, &popup);156 rc = ui_popup_create(ui, window, ¶ms, &popup); 138 157 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 139 158 PCUT_ASSERT_NOT_NULL(popup); … … 171 190 172 191 ui_popup_destroy(popup); 192 ui_window_destroy(window); 173 193 ui_destroy(ui); 174 194 } … … 179 199 errno_t rc; 180 200 ui_t *ui = NULL; 181 ui_wnd_params_t params;201 ui_wnd_params_t wparams; 182 202 ui_window_t *window = NULL; 203 ui_popup_params_t params; 204 ui_popup_t *popup = NULL; 183 205 ui_resource_t *res; 184 206 gfx_context_t *gc; 185 gfx_rect_t rect;186 207 187 208 rc = ui_create_disp(NULL, &ui); 188 209 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 189 210 190 ui_wnd_params_init(& params);191 params.caption = "Hello";192 193 rc = ui_window_create(ui, & params, &window);211 ui_wnd_params_init(&wparams); 212 wparams.caption = "Hello"; 213 214 rc = ui_window_create(ui, &wparams, &window); 194 215 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 195 216 PCUT_ASSERT_NOT_NULL(window); 196 217 197 res = ui_window_get_res(window); 218 ui_popup_params_init(¶ms); 219 220 rc = ui_popup_create(ui, window, ¶ms, &popup); 221 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 222 PCUT_ASSERT_NOT_NULL(popup); 223 224 res = ui_popup_get_res(popup); 198 225 PCUT_ASSERT_NOT_NULL(res); 199 226 200 gc = ui_ window_get_gc(window);227 gc = ui_popup_get_gc(popup); 201 228 PCUT_ASSERT_NOT_NULL(gc); 202 229 203 ui_window_get_app_rect(window, &rect); 204 230 ui_popup_destroy(popup); 205 231 ui_window_destroy(window); 206 232 ui_destroy(ui); … … 212 238 errno_t rc; 213 239 ui_t *ui = NULL; 240 ui_wnd_params_t wparams; 241 ui_window_t *window = NULL; 214 242 ui_popup_params_t params; 215 243 ui_popup_t *popup = NULL; … … 220 248 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 221 249 250 ui_wnd_params_init(&wparams); 251 wparams.caption = "Hello"; 252 253 rc = ui_window_create(ui, &wparams, &window); 254 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 255 PCUT_ASSERT_NOT_NULL(window); 256 222 257 ui_popup_params_init(¶ms); 223 258 224 rc = ui_popup_create(ui, NULL, ¶ms, &popup);259 rc = ui_popup_create(ui, window, ¶ms, &popup); 225 260 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 226 261 PCUT_ASSERT_NOT_NULL(popup); … … 251 286 252 287 ui_popup_destroy(popup); 288 ui_window_destroy(window); 253 289 ui_destroy(ui); 254 290 }
Note:
See TracChangeset
for help on using the changeset viewer.