Changeset a2f173b in mainline for uspace/lib/ui/test/pbutton.c
- Timestamp:
- 2020-10-21T21:49:13Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 58a67050
- Parents:
- 172188a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/pbutton.c
r172188a ra2f173b 359 359 ui_resource_t *resource = NULL; 360 360 ui_pbutton_t *pbutton; 361 ui_evclaim_t claim; 361 362 pos_event_t event; 362 363 gfx_rect_t rect; … … 381 382 ui_pbutton_set_rect(pbutton, &rect); 382 383 383 /* Press outside does nothing */384 /* Press outside is not claimed and does nothing */ 384 385 event.type = POS_PRESS; 385 386 event.hpos = 9; 386 387 event.vpos = 20; 387 ui_pbutton_pos_event(pbutton, &event); 388 PCUT_ASSERT_FALSE(pbutton->held); 389 390 /* Press inside depresses button */ 388 claim = ui_pbutton_pos_event(pbutton, &event); 389 PCUT_ASSERT_FALSE(pbutton->held); 390 PCUT_ASSERT_EQUALS(ui_unclaimed, claim); 391 392 /* Press inside is claimed and depresses button */ 391 393 event.type = POS_PRESS; 392 394 event.hpos = 10; 393 395 event.vpos = 20; 394 ui_pbutton_pos_event(pbutton, &event); 395 PCUT_ASSERT_TRUE(pbutton->held); 396 397 /* Release outside (or anywhere) relases button */ 396 claim = ui_pbutton_pos_event(pbutton, &event); 397 PCUT_ASSERT_TRUE(pbutton->held); 398 PCUT_ASSERT_EQUALS(ui_claimed, claim); 399 400 /* Release outside (or anywhere) is claimed and relases button */ 398 401 event.type = POS_RELEASE; 399 402 event.hpos = 9; 400 403 event.vpos = 20; 401 ui_pbutton_pos_event(pbutton, &event); 402 PCUT_ASSERT_FALSE(pbutton->held); 404 claim = ui_pbutton_pos_event(pbutton, &event); 405 PCUT_ASSERT_FALSE(pbutton->held); 406 PCUT_ASSERT_EQUALS(ui_claimed, claim); 403 407 404 408 ui_pbutton_destroy(pbutton);
Note:
See TracChangeset
for help on using the changeset viewer.