summaryrefslogtreecommitdiff
path: root/tests/vb2_ui_action_tests.c
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2020-10-05 15:44:25 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-12 13:38:30 +0000
commit4e93a487ff99c80777ee80f183193e07bc58c41d (patch)
tree987fe31e34cde02ee8947d247d1fdb0607f21674 /tests/vb2_ui_action_tests.c
parent68e42911998b23d244f281990b7040fefd12995e (diff)
downloadvboot-4e93a487ff99c80777ee80f183193e07bc58c41d.tar.gz
vboot/ui/tests: Fix ignoring vb2ex_display_ui calls in unit testsstabilize-13532.B
Save parameters `timer_disabled` and `error_code` in mocked vb2ex_displayed_ui calls to check whether the consecutive calls are duplicate or not. The unit tests of these parameters will be added in following CLs. BRANCH=none BUG=b:146399181, b:156448738 TEST=CC=x86_64-pc-linux-gnu-clang; make clean && make runtests TEST=CC=x86_64-pc-linux-gnu-clang; DETACHABLE=1; make clean && make runtests TEST=CC=x86_64-pc-linux-gnu-clang; PHYSICAL_PRESENCE_KEYBOARD=1; make clean && make runtests TEST=FEATURES=test PKGDIR=/build/puff/test-packages /mnt/host/source/chromite/bin/parallel_emerge --sysroot=/build/puff --jobs=32 vboot_reference Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I2b7c9b6b05d2427e938394ff9d0769fbde81f773 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2449310 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'tests/vb2_ui_action_tests.c')
-rw-r--r--tests/vb2_ui_action_tests.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/vb2_ui_action_tests.c b/tests/vb2_ui_action_tests.c
index e439d919..57b9700d 100644
--- a/tests/vb2_ui_action_tests.c
+++ b/tests/vb2_ui_action_tests.c
@@ -28,11 +28,15 @@
#define MOCK_SCREEN_ALL_ACTION 0xef32
/* Mock data */
+/* TODO(b/156448738): Add tests for timer_disabled and error_code */
struct display_call {
const struct vb2_screen_info *screen;
uint32_t locale_id;
uint32_t selected_item;
uint32_t disabled_item_mask;
+ int timer_disabled;
+ uint32_t current_page;
+ enum vb2_ui_error error_code;
} __attribute__((packed));
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
@@ -411,6 +415,9 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen,
.locale_id = locale_id,
.selected_item = selected_item,
.disabled_item_mask = disabled_item_mask,
+ .timer_disabled = timer_disabled,
+ .current_page = current_page,
+ .error_code = error_code,
};
/* Ignore repeated calls with same arguments */
@@ -419,10 +426,11 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen,
sizeof(struct display_call)))
return VB2_SUCCESS;
- VB2_DEBUG("displayed %d: screen = %#x, locale_id = %u, "
- "selected_item = %u, disabled_item_mask = %#x\n",
+ VB2_DEBUG("displayed %d: screen=%#x, locale_id=%u, selected_item=%u, "
+ "disabled_item_mask=%#x, timer_disabled=%d, current_page=%u, "
+ "error=%#x\n",
mock_displayed_count, screen, locale_id, selected_item,
- disabled_item_mask);
+ disabled_item_mask, timer_disabled, current_page, error_code);
if (mock_displayed_count >= ARRAY_SIZE(mock_displayed)) {
TEST_TRUE(0, " mock vb2ex_display_ui ran out of entries!");