Changeset c6f00b40 in mainline for uspace/lib/ui/test/fixed.c
- Timestamp:
- 2020-11-01T22:49:05Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4ac11ff
- Parents:
- 4df6607
- git-author:
- Jiri Svoboda <jiri@…> (2020-11-01 22:47:03)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-11-01 22:49:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/fixed.c
r4df6607 rc6f00b40 38 38 PCUT_TEST_SUITE(fixed); 39 39 40 static void test_ctl_destroy(void *); 40 41 static errno_t test_ctl_paint(void *); 41 42 static ui_evclaim_t test_ctl_pos_event(void *, pos_event_t *); 42 43 43 44 static ui_control_ops_t test_ctl_ops = { 45 .destroy = test_ctl_destroy, 44 46 .paint = test_ctl_paint, 45 47 .pos_event = test_ctl_pos_event … … 52 54 /** Result code to return */ 53 55 errno_t rc; 54 56 /** @c true iff destroy was called */ 57 bool destroy; 55 58 /** @c true iff paint was called */ 56 59 bool paint; 57 58 60 /** @c true iff pos_event was called */ 59 61 bool pos; … … 113 115 114 116 ui_fixed_destroy(fixed); 117 ui_control_delete(control); 118 } 119 120 /** ui_fixed_destroy() delivers destroy request to control */ 121 PCUT_TEST(destroy) 122 { 123 ui_fixed_t *fixed = NULL; 124 ui_control_t *control; 125 test_resp_t resp; 126 errno_t rc; 127 128 rc = ui_fixed_create(&fixed); 129 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 130 131 rc = ui_control_new(&test_ctl_ops, (void *) &resp, &control); 132 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 133 134 rc = ui_fixed_add(fixed, control); 135 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 136 137 resp.destroy = false; 138 139 ui_fixed_destroy(fixed); 140 PCUT_ASSERT_TRUE(resp.destroy); 115 141 } 116 142 … … 146 172 PCUT_ASSERT_TRUE(resp.paint); 147 173 148 ui_fixed_remove(fixed, control);149 174 ui_fixed_destroy(fixed); 150 175 } … … 186 211 PCUT_ASSERT_INT_EQUALS(resp.pevent.vpos, event.vpos); 187 212 188 ui_fixed_remove(fixed, control); 189 ui_fixed_destroy(fixed); 213 ui_fixed_destroy(fixed); 214 } 215 216 static void test_ctl_destroy(void *arg) 217 { 218 test_resp_t *resp = (test_resp_t *) arg; 219 220 resp->destroy = true; 190 221 } 191 222
Note:
See TracChangeset
for help on using the changeset viewer.