summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-05-11 15:51:51 +0800
committerCommit Bot <commit-bot@chromium.org>2020-05-18 16:13:14 +0000
commit891fc6e942e5aa035e6fec4103880af91cff24c6 (patch)
tree0735233861ea6a0c29fc30f7ac9b9f34ad5d9bda /tests
parent23f819197799d56824ed5b8fc92a23625fe65348 (diff)
downloadvboot-891fc6e942e5aa035e6fec4103880af91cff24c6.tar.gz
vboot: move VbExGetLocalizationCount to vboot2
Rename VbExGetLocalizationCount to vb2ex_get_locale_count. Change signature to return by value instead of by parameter. BUG=b:146399181, b:156070974 TEST=make clean && make runtests BRANCH=none Change-Id: I4e3986007034724f01c9d42a382398ddacd59f33 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:2190612 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2193151 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/vboot_display_tests.c10
-rw-r--r--tests/vboot_legacy_menu_tests.c5
2 files changed, 5 insertions, 10 deletions
diff --git a/tests/vboot_display_tests.c b/tests/vboot_display_tests.c
index b57915fb..c902614a 100644
--- a/tests/vboot_display_tests.c
+++ b/tests/vboot_display_tests.c
@@ -45,13 +45,9 @@ static void ResetMocks(void)
}
/* Mocks */
-vb2_error_t VbExGetLocalizationCount(uint32_t *count) {
+uint32_t vb2ex_get_locale_count(void) {
- if (mock_localization_count == 0xffffffff)
- return VB2_ERROR_UNKNOWN;
-
- *count = mock_localization_count;
- return VB2_SUCCESS;
+ return mock_localization_count;
}
uint32_t VbExGetAltFwIdxMask() {
@@ -113,7 +109,7 @@ static void DisplayKeyTest(void)
/* Reset localization if localization count is invalid */
ResetMocks();
vb2_nv_set(ctx, VB2_NV_LOCALIZATION_INDEX, 1);
- mock_localization_count = 0xffffffff;
+ mock_localization_count = 0;
VbCheckDisplayKey(ctx, VB_KEY_UP, NULL);
TEST_EQ(vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX), 0,
"DisplayKey invalid");
diff --git a/tests/vboot_legacy_menu_tests.c b/tests/vboot_legacy_menu_tests.c
index 80325f85..4a0dfaa0 100644
--- a/tests/vboot_legacy_menu_tests.c
+++ b/tests/vboot_legacy_menu_tests.c
@@ -118,9 +118,8 @@ struct vb2_gbb_header *vb2_get_gbb(struct vb2_context *c)
return &gbb;
}
-vb2_error_t VbExGetLocalizationCount(uint32_t *count) {
- *count = 1;
- return VB2_SUCCESS;
+uint32_t vb2ex_get_locale_count(void) {
+ return 1;
}
uint32_t VbExGetAltFwIdxMask() {