Changes in uspace/lib/ui/test/msgdialog.c [9a07ee3:de227aba] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/test/msgdialog.c
r9a07ee3 rde227aba 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2021 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;95 94 test_cb_resp_t resp; 96 95 … … 101 100 params.caption = "Message"; 102 101 params.text = "Hello"; 103 params.choice = umdc_ok_cancel;104 102 105 103 rc = ui_msg_dialog_create(ui, ¶ms, &dialog); … … 108 106 109 107 /* Button callback with no callbacks set */ 110 ui_pbutton_clicked(dialog->b tn[0]);108 ui_pbutton_clicked(dialog->bok); 111 109 112 /* Button callback with callback not implemented */110 /* Button callback with unfocus callback not implemented */ 113 111 ui_msg_dialog_set_cb(dialog, &dummy_msg_dialog_cb, NULL); 114 ui_pbutton_clicked(dialog->b tn[0]);112 ui_pbutton_clicked(dialog->bok); 115 113 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 } 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); 125 121 126 122 ui_msg_dialog_destroy(dialog);
Note:
See TracChangeset
for help on using the changeset viewer.