Changeset 0e6e77f in mainline for uspace/srv/hid/display/test
- Timestamp:
- 2020-02-28T15:44:55Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a8eed5f
- Parents:
- 2a515dcd
- git-author:
- Jiri Svoboda <jiri@…> (2020-02-26 18:26:13)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-02-28 15:44:55)
- Location:
- uspace/srv/hid/display/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/test/display.c
r2a515dcd r0e6e77f 53 53 printf("test_ds_ev_pending\n"); 54 54 *called_cb = true; 55 56 55 } 57 56 … … 265 264 event.c = L'\0'; 266 265 267 PCUT_ASSERT_FALSE(called_cb);266 called_cb = false; 268 267 269 268 rc = ds_display_post_kbd_event(disp, &event); … … 316 315 event.c = L'\0'; 317 316 318 PCUT_ASSERT_FALSE(called_cb);317 called_cb = false; 319 318 320 319 rc = ds_display_post_kbd_event(disp, &event); 321 320 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 322 PCUT_ASSERT_FALSE(called_cb); 321 322 /* Got gocus/unfocus events */ 323 PCUT_ASSERT_TRUE(called_cb); 323 324 324 325 /* Next window should be focused */ 325 326 PCUT_ASSERT_EQUALS(w1, seat->focus); 326 327 328 called_cb = false; 329 327 330 rc = ds_display_post_kbd_event(disp, &event); 328 331 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 329 PCUT_ASSERT_FALSE(called_cb); 332 333 /* Got gocus/unfocus events */ 334 PCUT_ASSERT_TRUE(called_cb); 330 335 331 336 /* Focus should be back to the first window */ … … 361 366 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 362 367 368 /* 369 * For PTD_MOVE to work we need to set display dimensions (as pointer 370 * move is clipped to the display rectangle. Here we do it directly 371 * instead of adding a display device. 372 */ 373 disp->rect.p0.x = 0; 374 disp->rect.p0.y = 0; 375 disp->rect.p1.x = 500; 376 disp->rect.p1.y = 500; 377 363 378 display_wnd_params_init(¶ms); 364 379 params.rect.p0.x = params.rect.p0.y = 0; -
uspace/srv/hid/display/test/window.c
r2a515dcd r0e6e77f 49 49 .fill_rect = dummy_fill_rect 50 50 }; 51 52 /** Test ds_window_resize(). */ 53 PCUT_TEST(window_resize) 54 { 55 ds_display_t *disp; 56 ds_client_t *client; 57 ds_window_t *wnd; 58 display_wnd_params_t params; 59 gfx_coord2_t offs; 60 gfx_rect_t nrect; 61 errno_t rc; 62 63 rc = ds_display_create(NULL, &disp); 64 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 65 66 rc = ds_client_create(disp, NULL, NULL, &client); 67 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 68 69 display_wnd_params_init(¶ms); 70 params.rect.p0.x = params.rect.p0.y = 0; 71 params.rect.p1.x = params.rect.p1.y = 10; 72 73 rc = ds_window_create(client, ¶ms, &wnd); 74 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 75 76 wnd->dpos.x = 100; 77 wnd->dpos.y = 100; 78 79 offs.x = -2; 80 offs.y = -3; 81 params.rect.p0.x = params.rect.p0.y = 0; 82 params.rect.p1.x = 12; 83 params.rect.p1.y = 13; 84 rc = ds_window_resize(wnd, &offs, &nrect); 85 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 86 87 PCUT_ASSERT_INT_EQUALS(98, wnd->dpos.x); 88 PCUT_ASSERT_INT_EQUALS(97, wnd->dpos.y); 89 90 ds_window_destroy(wnd); 91 ds_client_destroy(client); 92 ds_display_destroy(disp); 93 } 51 94 52 95 /** Test ds_window_get_ctx(). */
Note:
See TracChangeset
for help on using the changeset viewer.
