Changeset c6f00b40 in mainline for uspace/lib/ui/test/control.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/control.c
r4df6607 rc6f00b40 21 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INT ERRUPTION) HOWEVER CAUSED AND ON ANY23 * DATA, OR PROFITS; OR BUSINESS INTvvhhzccgggrERRUPTION) HOWEVER CAUSED AND ON ANY 24 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF … … 39 39 PCUT_TEST_SUITE(control); 40 40 41 static void test_ctl_destroy(void *); 41 42 static errno_t test_ctl_paint(void *); 42 43 static ui_evclaim_t test_ctl_pos_event(void *, pos_event_t *); 43 44 44 45 static ui_control_ops_t test_ctl_ops = { 46 .destroy = test_ctl_destroy, 45 47 .paint = test_ctl_paint, 46 48 .pos_event = test_ctl_pos_event … … 53 55 /** Result code to return */ 54 56 errno_t rc; 57 58 /** @c true iff destroy was called */ 59 bool destroy; 55 60 56 61 /** @c true iff paint was called */ … … 80 85 { 81 86 ui_control_delete(NULL); 87 } 88 89 /** Test sending destroy request to control */ 90 PCUT_TEST(destroy) 91 { 92 ui_control_t *control = NULL; 93 test_resp_t resp; 94 errno_t rc; 95 96 rc = ui_control_new(&test_ctl_ops, &resp, &control); 97 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 98 PCUT_ASSERT_NOT_NULL(control); 99 100 resp.rc = EOK; 101 resp.destroy = false; 102 103 ui_control_destroy(control); 104 PCUT_ASSERT_TRUE(resp.destroy); 82 105 } 83 106 … … 143 166 } 144 167 168 static void test_ctl_destroy(void *arg) 169 { 170 test_resp_t *resp = (test_resp_t *) arg; 171 172 resp->destroy = true; 173 } 174 145 175 static errno_t test_ctl_paint(void *arg) 146 176 {
Note:
See TracChangeset
for help on using the changeset viewer.