Changeset 9a07ee3 in mainline for uspace/lib/ui/test/msgdialog.c
- Timestamp:
- 2024-11-12T09:56:19Z (6 weeks ago)
- Branches:
- master
- Children:
- 12dd36c
- Parents:
- 0d00e53
- git-author:
- Jiri Svoboda <jiri@…> (2024-11-11 19:56:06)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-11-12 09:56:19)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/msgdialog.c
r0d00e53 r9a07ee3 1 1 /* 2 * Copyright (c) 202 1Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 92 92 ui_msg_dialog_params_t params; 93 93 ui_msg_dialog_t *dialog = NULL; 94 unsigned i; 94 95 test_cb_resp_t resp; 95 96 … … 100 101 params.caption = "Message"; 101 102 params.text = "Hello"; 103 params.choice = umdc_ok_cancel; 102 104 103 105 rc = ui_msg_dialog_create(ui, ¶ms, &dialog); … … 106 108 107 109 /* Button callback with no callbacks set */ 108 ui_pbutton_clicked(dialog->b ok);110 ui_pbutton_clicked(dialog->btn[0]); 109 111 110 112 /* Button callback with callback not implemented */ 111 113 ui_msg_dialog_set_cb(dialog, &dummy_msg_dialog_cb, NULL); 112 ui_pbutton_clicked(dialog->b ok);114 ui_pbutton_clicked(dialog->btn[0]); 113 115 114 /* Button callback with real callback set */ 115 resp.button = false; 116 resp.bnum = 123; 117 ui_msg_dialog_set_cb(dialog, &test_msg_dialog_cb, &resp); 118 ui_pbutton_clicked(dialog->bok); 119 PCUT_ASSERT_TRUE(resp.button); 120 PCUT_ASSERT_INT_EQUALS(0, resp.bnum); 116 for (i = 0; i < 2; i++) { 117 /* Button callback with real callback set */ 118 resp.button = false; 119 resp.bnum = 123; 120 ui_msg_dialog_set_cb(dialog, &test_msg_dialog_cb, &resp); 121 ui_pbutton_clicked(dialog->btn[i]); 122 PCUT_ASSERT_TRUE(resp.button); 123 PCUT_ASSERT_INT_EQUALS(i, resp.bnum); 124 } 121 125 122 126 ui_msg_dialog_destroy(dialog);
Note:
See TracChangeset
for help on using the changeset viewer.