Changes in uspace/app/nav/test/panel.c [54ddb59:a29af37] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nav/test/panel.c
r54ddb59 ra29af37 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 55 55 PCUT_TEST(create_destroy) 56 56 { 57 panel_t *panel; 58 errno_t rc; 59 60 rc = panel_create(NULL, true, &panel); 61 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 62 63 panel_destroy(panel); 57 ui_t *ui; 58 ui_window_t *window; 59 ui_wnd_params_t params; 60 panel_t *panel; 61 errno_t rc; 62 63 rc = ui_create_disp(NULL, &ui); 64 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 65 66 ui_wnd_params_init(¶ms); 67 params.caption = "Test"; 68 69 rc = ui_window_create(ui, ¶ms, &window); 70 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 71 72 rc = panel_create(window, true, &panel); 73 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 74 75 panel_destroy(panel); 76 ui_window_destroy(window); 77 ui_destroy(ui); 64 78 } 65 79 … … 67 81 PCUT_TEST(set_cb) 68 82 { 83 ui_t *ui; 84 ui_window_t *window; 85 ui_wnd_params_t params; 69 86 panel_t *panel; 70 87 errno_t rc; 71 88 test_resp_t resp; 72 89 73 rc = panel_create(NULL, true, &panel); 90 rc = ui_create_disp(NULL, &ui); 91 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 92 93 ui_wnd_params_init(¶ms); 94 params.caption = "Test"; 95 96 rc = ui_window_create(ui, ¶ms, &window); 97 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 98 99 rc = panel_create(window, true, &panel); 74 100 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 75 101 … … 79 105 80 106 panel_destroy(panel); 107 ui_window_destroy(window); 108 ui_destroy(ui); 81 109 } 82 110 … … 113 141 PCUT_TEST(ctl) 114 142 { 143 ui_t *ui; 144 ui_window_t *window; 145 ui_wnd_params_t params; 115 146 panel_t *panel; 116 147 ui_control_t *control; 117 148 errno_t rc; 118 149 119 rc = panel_create(NULL, true, &panel); 150 rc = ui_create_disp(NULL, &ui); 151 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 152 153 ui_wnd_params_init(¶ms); 154 params.caption = "Test"; 155 156 rc = ui_window_create(ui, ¶ms, &window); 157 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 158 159 rc = panel_create(window, true, &panel); 120 160 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 121 161 … … 124 164 125 165 panel_destroy(panel); 166 ui_window_destroy(window); 167 ui_destroy(ui); 126 168 } 127 169 … … 129 171 PCUT_TEST(kbd_event) 130 172 { 173 ui_t *ui; 174 ui_window_t *window; 175 ui_wnd_params_t params; 131 176 panel_t *panel; 132 177 ui_evclaim_t claimed; … … 136 181 /* Active panel should claim events */ 137 182 138 rc = panel_create(NULL, true, &panel); 183 rc = ui_create_disp(NULL, &ui); 184 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 185 186 ui_wnd_params_init(¶ms); 187 params.caption = "Test"; 188 189 rc = ui_window_create(ui, ¶ms, &window); 190 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 191 192 rc = panel_create(window, true, &panel); 139 193 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 140 194 … … 151 205 /* Inactive panel should not claim events */ 152 206 153 rc = panel_create( NULL, false, &panel);207 rc = panel_create(window, false, &panel); 154 208 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 155 209 … … 163 217 164 218 panel_destroy(panel); 219 ui_window_destroy(window); 220 ui_destroy(ui); 165 221 } 166 222 … … 173 229 PCUT_TEST(set_rect) 174 230 { 231 ui_t *ui; 232 ui_window_t *window; 233 ui_wnd_params_t params; 175 234 panel_t *panel; 176 235 gfx_rect_t rect; 177 236 errno_t rc; 178 237 179 rc = panel_create(NULL, true, &panel); 238 rc = ui_create_disp(NULL, &ui); 239 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 240 241 ui_wnd_params_init(¶ms); 242 params.caption = "Test"; 243 244 rc = ui_window_create(ui, ¶ms, &window); 245 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 246 247 rc = panel_create(window, true, &panel); 180 248 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 181 249 … … 192 260 193 261 panel_destroy(panel); 262 ui_window_destroy(window); 263 ui_destroy(ui); 194 264 } 195 265 … … 197 267 PCUT_TEST(is_active) 198 268 { 199 panel_t *panel; 200 errno_t rc; 201 202 rc = panel_create(NULL, true, &panel); 269 ui_t *ui; 270 ui_window_t *window; 271 ui_wnd_params_t params; 272 panel_t *panel; 273 errno_t rc; 274 275 rc = ui_create_disp(NULL, &ui); 276 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 277 278 ui_wnd_params_init(¶ms); 279 params.caption = "Test"; 280 281 rc = ui_window_create(ui, ¶ms, &window); 282 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 283 284 rc = panel_create(window, true, &panel); 203 285 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 204 286 PCUT_ASSERT_TRUE(panel_is_active(panel)); 205 287 panel_destroy(panel); 206 288 207 rc = panel_create( NULL, false, &panel);289 rc = panel_create(window, false, &panel); 208 290 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 209 291 PCUT_ASSERT_FALSE(panel_is_active(panel)); 210 292 panel_destroy(panel); 293 ui_window_destroy(window); 294 ui_destroy(ui); 211 295 } 212 296 … … 275 359 PCUT_TEST(activate_req) 276 360 { 361 ui_t *ui; 362 ui_window_t *window; 363 ui_wnd_params_t params; 277 364 panel_t *panel; 278 365 errno_t rc; 279 366 test_resp_t resp; 280 367 281 rc = panel_create(NULL, true, &panel); 368 rc = ui_create_disp(NULL, &ui); 369 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 370 371 ui_wnd_params_init(¶ms); 372 params.caption = "Test"; 373 374 rc = ui_window_create(ui, ¶ms, &window); 375 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 376 377 rc = panel_create(window, true, &panel); 282 378 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 283 379 … … 292 388 293 389 panel_destroy(panel); 390 ui_window_destroy(window); 391 ui_destroy(ui); 294 392 } 295 393
Note:
See TracChangeset
for help on using the changeset viewer.