summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2020-10-07 11:36:58 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-12 13:38:29 +0000
commit68e42911998b23d244f281990b7040fefd12995e (patch)
tree93b17bc1c793bda732e100c1d45595a71210f6e5
parent9b010ef3f07ba0539f78696bde2a0842b766cfea (diff)
downloadvboot-68e42911998b23d244f281990b7040fefd12995e.tar.gz
vboot/ui/tests: Fix struct compare error in unit tests
Use packed structures to avoid unexpected error about padding. BUG=b:156448738, b:170186754 BRANCH=none TEST=CC=x86_64-pc-linux-gnu-clang; 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: Ibdcffe81d92db2880c53282a313ffa678af7d43d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2454911 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
-rw-r--r--tests/vb2_ui_action_tests.c2
-rw-r--r--tests/vb2_ui_tests.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/vb2_ui_action_tests.c b/tests/vb2_ui_action_tests.c
index 79f82caa..e439d919 100644
--- a/tests/vb2_ui_action_tests.c
+++ b/tests/vb2_ui_action_tests.c
@@ -33,7 +33,7 @@ struct display_call {
uint32_t locale_id;
uint32_t selected_item;
uint32_t disabled_item_mask;
-};
+} __attribute__((packed));
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c
index 5dc1a2e7..004836a0 100644
--- a/tests/vb2_ui_tests.c
+++ b/tests/vb2_ui_tests.c
@@ -29,7 +29,7 @@ struct display_call {
uint32_t disabled_item_mask;
/* TODO(b/156448738): Add more params and their tests */
uint32_t current_page;
-};
+} __attribute__((packed));
struct beep_call {
uint32_t msec;