summaryrefslogtreecommitdiff
path: root/tests/vboot_api_devmode_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vboot_api_devmode_tests.c')
-rw-r--r--tests/vboot_api_devmode_tests.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
index ccd4c617..53373bda 100644
--- a/tests/vboot_api_devmode_tests.c
+++ b/tests/vboot_api_devmode_tests.c
@@ -95,6 +95,7 @@ test_case_t test[] = {
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
static struct vb2_context ctx;
static struct vb2_shared_data *sd;
+static struct vb2_gbb_header gbb;
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
static VbSharedDataHeader* shared = (VbSharedDataHeader*)shared_data;
static int current_time;
@@ -122,6 +123,8 @@ static void ResetMocks(void)
sd = vb2_get_sd(&ctx);
sd->vbsd = shared;
+ memset(&gbb, 0, sizeof(gbb));
+
memset(&shared_data, 0, sizeof(shared_data));
VbSharedDataInit(shared, sizeof(shared_data));
shared->fw_keyblock_flags = 0xABCDE0;
@@ -142,6 +145,10 @@ static void ResetMocks(void)
/****************************************************************************/
/* Mocked verification functions */
+struct vb2_gbb_header *vb2_get_gbb(struct vb2_context *c)
+{
+ return &gbb;
+}
VbError_t VbExNvStorageRead(uint8_t* buf)
{
@@ -271,7 +278,7 @@ static void VbBootDeveloperSoundTest(void)
for (i=0; i<num_tests; i++) {
VB2_DEBUG("STARTING %s ...\n", test[i].name);
ResetMocks();
- sd->gbb_flags = test[i].gbb_flags;
+ gbb.flags = test[i].gbb_flags;
beep_return = test[i].beep_return;
kbd_fire_key = test[i].keypress_key;
kbd_fire_at = test[i].keypress_at_count;