Changes in uspace/lib/ui/test/fixed.c [46a47c0:b71c0fc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/fixed.c
r46a47c0 rb71c0fc 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2020 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 41 41 static errno_t test_ctl_paint(void *); 42 42 static ui_evclaim_t test_ctl_pos_event(void *, pos_event_t *); 43 static void test_ctl_unfocus(void *, unsigned);44 43 45 44 static ui_control_ops_t test_ctl_ops = { 46 45 .destroy = test_ctl_destroy, 47 46 .paint = test_ctl_paint, 48 .pos_event = test_ctl_pos_event, 49 .unfocus = test_ctl_unfocus 47 .pos_event = test_ctl_pos_event 50 48 }; 51 49 … … 64 62 /** Position event that was sent */ 65 63 pos_event_t pevent; 66 /** @c true iff unfocus was called */67 bool unfocus;68 /** Number of remaining foci */69 unsigned unfocus_nfocus;70 64 } test_resp_t; 71 65 … … 236 230 } 237 231 238 /** ui_fixed_unfocus() delivers unfocus notification to control */239 PCUT_TEST(unfocus)240 {241 ui_fixed_t *fixed = NULL;242 ui_control_t *control;243 test_resp_t resp;244 errno_t rc;245 246 rc = ui_fixed_create(&fixed);247 PCUT_ASSERT_ERRNO_VAL(EOK, rc);248 249 rc = ui_control_new(&test_ctl_ops, (void *) &resp, &control);250 PCUT_ASSERT_ERRNO_VAL(EOK, rc);251 252 rc = ui_fixed_add(fixed, control);253 PCUT_ASSERT_ERRNO_VAL(EOK, rc);254 255 resp.unfocus = false;256 257 ui_fixed_unfocus(fixed, 42);258 PCUT_ASSERT_TRUE(resp.unfocus);259 PCUT_ASSERT_INT_EQUALS(42, resp.unfocus_nfocus);260 261 ui_fixed_destroy(fixed);262 }263 264 232 static void test_ctl_destroy(void *arg) 265 233 { … … 287 255 } 288 256 289 static void test_ctl_unfocus(void *arg, unsigned nfocus)290 {291 test_resp_t *resp = (test_resp_t *) arg;292 293 resp->unfocus = true;294 resp->unfocus_nfocus = nfocus;295 }296 297 257 PCUT_EXPORT(fixed);
Note:
See TracChangeset
for help on using the changeset viewer.