Changeset 4c4d6142 in mainline
- Timestamp:
- 2020-05-19T13:04:32Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5480d5e
- Parents:
- 4912dd59
- git-author:
- Jiri Svoboda <jiri@…> (2020-05-18 19:03:11)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-05-19 13:04:32)
- Location:
- uspace/srv/hid/display/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/test/cursor.c
r4912dd59 r4c4d6142 55 55 }; 56 56 57 58 57 typedef struct { 59 58 bool render_called; … … 210 209 } 211 210 212 213 211 PCUT_EXPORT(cursor); -
uspace/srv/hid/display/test/main.c
r4912dd59 r4c4d6142 34 34 PCUT_IMPORT(cursor); 35 35 PCUT_IMPORT(display); 36 PCUT_IMPORT(seat); 36 37 PCUT_IMPORT(window); 37 38 -
uspace/srv/hid/display/test/seat.c
r4912dd59 r4c4d6142 53 53 printf("test_ds_ev_pending\n"); 54 54 *called_cb = true; 55 56 55 } 57 56 … … 64 63 ds_window_t *wnd; 65 64 display_wnd_params_t params; 66 errno_t rc; 67 68 rc = ds_display_create(NULL, &disp); 69 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 70 71 rc = ds_client_create(disp, &test_ds_client_cb, NULL, &client); 65 bool called_cb = false; 66 errno_t rc; 67 68 rc = ds_display_create(NULL, &disp); 69 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 70 71 rc = ds_client_create(disp, &test_ds_client_cb, &called_cb, &client); 72 72 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 73 73 … … 84 84 ds_seat_set_focus(seat, wnd); 85 85 PCUT_ASSERT_EQUALS(wnd, seat->focus); 86 PCUT_ASSERT_TRUE(called_cb); 86 87 87 88 ds_window_destroy(wnd); … … 100 101 ds_window_t *w1; 101 102 display_wnd_params_t params; 102 errno_t rc; 103 104 rc = ds_display_create(NULL, &disp); 105 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 106 107 rc = ds_client_create(disp, &test_ds_client_cb, NULL, &client); 103 bool called_cb = false; 104 errno_t rc; 105 106 rc = ds_display_create(NULL, &disp); 107 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 108 109 rc = ds_client_create(disp, &test_ds_client_cb, &called_cb, &client); 108 110 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 109 111 … … 123 125 ds_seat_set_focus(seat, w1); 124 126 PCUT_ASSERT_EQUALS(w1, seat->focus); 127 PCUT_ASSERT_TRUE(called_cb); 128 called_cb = false; 125 129 126 130 ds_seat_evac_focus(seat, w1); 127 131 PCUT_ASSERT_EQUALS(w0, seat->focus); 132 PCUT_ASSERT_TRUE(called_cb); 128 133 129 134 ds_window_destroy(w0); … … 143 148 ds_window_t *w1; 144 149 display_wnd_params_t params; 150 bool called_cb = false; 145 151 kbd_event_t event; 146 152 errno_t rc; … … 149 155 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 150 156 151 rc = ds_client_create(disp, &test_ds_client_cb, NULL, &client);157 rc = ds_client_create(disp, &test_ds_client_cb, &called_cb, &client); 152 158 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 153 159 … … 167 173 ds_seat_set_focus(seat, w1); 168 174 PCUT_ASSERT_EQUALS(w1, seat->focus); 175 PCUT_ASSERT_TRUE(called_cb); 176 called_cb = false; 169 177 170 178 event.type = KEY_PRESS; … … 174 182 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 175 183 PCUT_ASSERT_EQUALS(w0, seat->focus); 184 PCUT_ASSERT_TRUE(called_cb); 176 185 177 186 ds_window_destroy(w0); … … 193 202 ds_window_t *rwindow; 194 203 display_wnd_ev_t revent; 195 bool called_cb = NULL;204 bool called_cb = false; 196 205 errno_t rc; 197 206 … … 214 223 ds_seat_set_focus(seat, wnd); 215 224 PCUT_ASSERT_EQUALS(wnd, seat->focus); 225 226 PCUT_ASSERT_TRUE(called_cb); 227 rc = ds_client_get_event(client, &rwindow, &revent); 228 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 229 called_cb = false; 216 230 217 231 event.type = KEY_PRESS; … … 219 233 event.mods = 0; 220 234 event.c = L'\0'; 221 222 PCUT_ASSERT_FALSE(called_cb);223 235 224 236 rc = ds_client_get_event(client, &rwindow, &revent); … … 242 254 243 255 ds_window_destroy(wnd); 256 ds_seat_destroy(seat); 244 257 ds_client_destroy(client); 245 258 ds_display_destroy(disp); … … 267 280 rc = ds_client_create(disp, &test_ds_client_cb, &called_cb, &client); 268 281 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 282 283 /* Set up display size to allow the pointer a range of movement */ 284 disp->rect.p1.x = 500; 285 disp->rect.p1.y = 500; 269 286 270 287 display_wnd_params_init(¶ms); … … 293 310 rc = ds_seat_post_ptd_event(seat, &event); 294 311 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 295 PCUT_ASSERT_FALSE(called_cb); 312 313 PCUT_ASSERT_TRUE(called_cb); 314 called_cb = false; 296 315 297 316 event.type = PTD_PRESS; … … 299 318 rc = ds_seat_post_ptd_event(seat, &event); 300 319 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 301 PCUT_ASSERT_FALSE(called_cb); 320 PCUT_ASSERT_TRUE(called_cb); 321 called_cb = false; 302 322 303 323 PCUT_ASSERT_EQUALS(w1, seat->focus); … … 308 328 rc = ds_seat_post_ptd_event(seat, &event); 309 329 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 310 PCUT_ASSERT_FALSE(called_cb); 330 PCUT_ASSERT_TRUE(called_cb); 331 called_cb = false; 311 332 312 333 event.type = PTD_PRESS; … … 314 335 rc = ds_seat_post_ptd_event(seat, &event); 315 336 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 316 PCUT_ASSERT_FALSE(called_cb); 337 PCUT_ASSERT_TRUE(called_cb); 338 called_cb = false; 317 339 318 340 PCUT_ASSERT_EQUALS(w0, seat->focus);
Note:
See TracChangeset
for help on using the changeset viewer.