summaryrefslogtreecommitdiff
path: root/tests/vboot_api_kernel4_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vboot_api_kernel4_tests.c')
-rw-r--r--tests/vboot_api_kernel4_tests.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c
index ab9d557f..cb2179d5 100644
--- a/tests/vboot_api_kernel4_tests.c
+++ b/tests/vboot_api_kernel4_tests.c
@@ -25,6 +25,7 @@
#include "vboot_struct.h"
/* Mock data */
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
static struct vb2_context ctx;
static struct vb2_context ctx_nvram_backend;
static VbCommonParams cparams;
@@ -59,9 +60,11 @@ static void ResetMocks(void)
gbb.minor_version = GBB_MINOR_VER;
gbb.flags = 0;
- /* ctx.workbuf will be allocated and initialized by
- * VbSelectAndLoadKernel. */
+ /* ctx.workbuf will be initialized by VbSelectAndLoadKernel. */
memset(&ctx, 0, sizeof(ctx));
+ ctx.workbuf = workbuf;
+ ctx.workbuf_size = sizeof(workbuf);
+ vb2_init_context(&ctx);
/*
* ctx_nvram_backend is only used as an NVRAM backend (see