Changeset dcac756 in mainline
- Timestamp:
- 2019-11-10T16:36:53Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6427f083
- Parents:
- 38e4f42
- git-author:
- Jiri Svoboda <jiri@…> (2019-11-10 16:32:14)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-11-10 16:36:53)
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/src/disp_srv.c
r38e4f42 rdcac756 109 109 110 110 rc = srv->ops->get_event(srv->arg, &wnd_id, &event); 111 if (rc != EOK) 111 if (rc != EOK) { 112 112 async_answer_0(icall, rc); 113 return; 114 } 113 115 114 116 /* Transfer event data */ -
uspace/lib/display/src/display.c
r38e4f42 rdcac756 189 189 async_exchange_end(exch); 190 190 191 list_remove(&window->lwindows); 191 192 free(window); 192 193 return rc; -
uspace/lib/display/test/display.c
r38e4f42 rdcac756 79 79 bool get_event_called; 80 80 bool set_color_called; 81 display_srv_t *srv; 81 82 } test_response_t; 82 83 … … 87 88 service_id_t sid; 88 89 display_t *disp = NULL; 89 90 async_set_fallback_port_handler(test_display_conn, disp); 90 test_response_t resp; 91 92 async_set_fallback_port_handler(test_display_conn, &resp); 91 93 92 94 // FIXME This causes this test to be non-reentrant! … … 322 324 } 323 325 326 /** Keyboard event can be delivered from server to client callback function */ 327 #include <stdio.h> 328 PCUT_TEST(kbd_event_deliver) 329 { 330 errno_t rc; 331 service_id_t sid; 332 display_t *disp = NULL; 333 display_window_t *wnd; 334 test_response_t resp; 335 gfx_context_t *gc; 336 337 async_set_fallback_port_handler(test_display_conn, &resp); 338 339 // FIXME This causes this test to be non-reentrant! 340 rc = loc_server_register(test_display_server); 341 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 342 343 rc = loc_service_register(test_display_svc, &sid); 344 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 345 346 rc = display_open(test_display_svc, &disp); 347 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 348 PCUT_ASSERT_NOT_NULL(disp); 349 PCUT_ASSERT_NOT_NULL(resp.srv); 350 351 wnd = NULL; 352 resp.rc = EOK; 353 rc = display_window_create(disp, &test_display_wnd_cb, NULL, &wnd); 354 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 355 PCUT_ASSERT_NOT_NULL(wnd); 356 357 printf(" ** call display_window_get_gc\n"); 358 gc = NULL; 359 rc = display_window_get_gc(wnd, &gc); 360 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 361 PCUT_ASSERT_NOT_NULL(gc); 362 363 printf(" ** call display_srv_ev_pending\n"); 364 display_srv_ev_pending(resp.srv); 365 366 printf(" ** call display_window_destroy\n"); 367 rc = display_window_destroy(wnd); 368 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 369 370 printf(" ** call display_close\n"); 371 display_close(disp); 372 printf(" ** call loc_service_unregister\n"); 373 rc = loc_service_unregister(sid); 374 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 375 } 376 324 377 /** Test display service connection. 325 378 * … … 344 397 srv.ops = &test_display_srv_ops; 345 398 srv.arg = arg; 399 resp->srv = &srv; 346 400 347 401 /* Handle connection */ 348 402 display_conn(icall, &srv); 403 404 resp->srv = NULL; 349 405 } else { 350 406 (void) wnd_id; -
uspace/srv/hid/display/client.c
r38e4f42 rdcac756 177 177 if (link == NULL) 178 178 return ENOENT; 179 179 180 wevent = list_get_instance(link, ds_window_ev_t, levents); 181 list_remove(link); 180 182 181 183 *ewindow = wevent->window; -
uspace/srv/hid/display/test/client.c
r38e4f42 rdcac756 195 195 PCUT_ASSERT_EQUALS(event.c, revent.kbd_event.c); 196 196 197 rc = ds_client_get_event(client, &rwindow, &revent); 198 PCUT_ASSERT_ERRNO_VAL(ENOENT, rc); 199 197 200 ds_window_destroy(wnd); 198 201 ds_client_destroy(client);
Note:
See TracChangeset
for help on using the changeset viewer.