Changeset 4d9c807 in mainline for uspace/lib/display/test/display.c
- Timestamp:
- 2019-12-13T19:02:10Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fdc8e40
- Parents:
- 4fbdc3d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/test/display.c
r4fbdc3d r4d9c807 49 49 static void test_kbd_event(void *, kbd_event_t *); 50 50 51 static errno_t test_window_create(void *, sysarg_t *);51 static errno_t test_window_create(void *, display_wnd_params_t *, sysarg_t *); 52 52 static errno_t test_window_destroy(void *, sysarg_t); 53 53 static errno_t test_get_event(void *, sysarg_t *, display_wnd_ev_t *); … … 79 79 int event_cnt; 80 80 bool window_create_called; 81 gfx_rect_t create_rect; 81 82 bool window_destroy_called; 82 83 bool get_event_called; … … 120 121 service_id_t sid; 121 122 display_t *disp = NULL; 123 display_wnd_params_t params; 122 124 display_window_t *wnd; 123 125 test_response_t resp; … … 139 141 resp.rc = ENOMEM; 140 142 resp.window_create_called = false; 141 rc = display_window_create(disp, &test_display_wnd_cb, NULL, &wnd); 143 display_wnd_params_init(¶ms); 144 params.rect.p0.x = 0; 145 params.rect.p0.y = 0; 146 params.rect.p0.x = 100; 147 params.rect.p0.y = 100; 148 149 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, 150 (void *) &resp, &wnd); 142 151 PCUT_ASSERT_TRUE(resp.window_create_called); 152 PCUT_ASSERT_EQUALS(params.rect.p0.x, resp.create_rect.p0.x); 153 PCUT_ASSERT_EQUALS(params.rect.p0.y, resp.create_rect.p0.y); 154 PCUT_ASSERT_EQUALS(params.rect.p1.x, resp.create_rect.p1.x); 155 PCUT_ASSERT_EQUALS(params.rect.p1.y, resp.create_rect.p1.y); 143 156 PCUT_ASSERT_ERRNO_VAL(resp.rc, rc); 144 157 PCUT_ASSERT_NULL(wnd); … … 158 171 service_id_t sid; 159 172 display_t *disp = NULL; 173 display_wnd_params_t params; 160 174 display_window_t *wnd; 161 175 test_response_t resp; … … 177 191 resp.rc = EOK; 178 192 resp.window_create_called = false; 179 rc = display_window_create(disp, &test_display_wnd_cb, NULL, &wnd); 193 display_wnd_params_init(¶ms); 194 params.rect.p0.x = 0; 195 params.rect.p0.y = 0; 196 params.rect.p0.x = 100; 197 params.rect.p0.y = 100; 198 199 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, 200 (void *) &resp, &wnd); 180 201 PCUT_ASSERT_TRUE(resp.window_create_called); 202 PCUT_ASSERT_EQUALS(params.rect.p0.x, resp.create_rect.p0.x); 203 PCUT_ASSERT_EQUALS(params.rect.p0.y, resp.create_rect.p0.y); 204 PCUT_ASSERT_EQUALS(params.rect.p1.x, resp.create_rect.p1.x); 205 PCUT_ASSERT_EQUALS(params.rect.p1.y, resp.create_rect.p1.y); 181 206 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 182 207 PCUT_ASSERT_NOT_NULL(wnd); … … 198 223 service_id_t sid; 199 224 display_t *disp = NULL; 225 display_wnd_params_t params; 200 226 display_window_t *wnd; 201 227 test_response_t resp; … … 216 242 resp.rc = EOK; 217 243 resp.window_create_called = false; 218 rc = display_window_create(disp, &test_display_wnd_cb, NULL, &wnd); 244 display_wnd_params_init(¶ms); 245 params.rect.p0.x = 0; 246 params.rect.p0.y = 0; 247 params.rect.p0.x = 100; 248 params.rect.p0.y = 100; 249 250 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, 251 (void *) &resp, &wnd); 219 252 PCUT_ASSERT_TRUE(resp.window_create_called); 253 PCUT_ASSERT_EQUALS(params.rect.p0.x, resp.create_rect.p0.x); 254 PCUT_ASSERT_EQUALS(params.rect.p0.y, resp.create_rect.p0.y); 255 PCUT_ASSERT_EQUALS(params.rect.p1.x, resp.create_rect.p1.x); 256 PCUT_ASSERT_EQUALS(params.rect.p1.y, resp.create_rect.p1.y); 220 257 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 221 258 PCUT_ASSERT_NOT_NULL(wnd); … … 238 275 service_id_t sid; 239 276 display_t *disp = NULL; 277 display_wnd_params_t params; 240 278 display_window_t *wnd; 241 279 test_response_t resp; … … 257 295 wnd = NULL; 258 296 resp.rc = EOK; 259 rc = display_window_create(disp, &test_display_wnd_cb, NULL, &wnd); 297 display_wnd_params_init(¶ms); 298 params.rect.p0.x = 0; 299 params.rect.p0.y = 0; 300 params.rect.p0.x = 100; 301 params.rect.p0.y = 100; 302 303 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, 304 (void *) &resp, &wnd); 260 305 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 261 306 PCUT_ASSERT_NOT_NULL(wnd); … … 283 328 service_id_t sid; 284 329 display_t *disp = NULL; 330 display_wnd_params_t params; 285 331 display_window_t *wnd; 286 332 test_response_t resp; … … 303 349 wnd = NULL; 304 350 resp.rc = EOK; 305 rc = display_window_create(disp, &test_display_wnd_cb, NULL, &wnd); 351 display_wnd_params_init(¶ms); 352 params.rect.p0.x = 0; 353 params.rect.p0.y = 0; 354 params.rect.p0.x = 100; 355 params.rect.p0.y = 100; 356 357 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, 358 (void *) &resp, &wnd); 306 359 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 307 360 PCUT_ASSERT_NOT_NULL(wnd); … … 336 389 service_id_t sid; 337 390 display_t *disp = NULL; 391 display_wnd_params_t params; 338 392 display_window_t *wnd; 339 393 test_response_t resp; … … 356 410 wnd = NULL; 357 411 resp.rc = EOK; 358 rc = display_window_create(disp, &test_display_wnd_cb, (void *) &resp, 359 &wnd); 412 display_wnd_params_init(¶ms); 413 params.rect.p0.x = 0; 414 params.rect.p0.y = 0; 415 params.rect.p0.x = 100; 416 params.rect.p0.y = 100; 417 418 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, 419 (void *) &resp, &wnd); 360 420 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 361 421 PCUT_ASSERT_NOT_NULL(wnd); … … 462 522 } 463 523 464 static errno_t test_window_create(void *arg, sysarg_t *rwnd_id) 524 static errno_t test_window_create(void *arg, display_wnd_params_t *params, 525 sysarg_t *rwnd_id) 465 526 { 466 527 test_response_t *resp = (test_response_t *) arg; 467 528 468 529 resp->window_create_called = true; 530 resp->create_rect = params->rect; 469 531 if (resp->rc == EOK) 470 532 *rwnd_id = resp->wnd_id;
Note:
See TracChangeset
for help on using the changeset viewer.