From 6f3fd6358f605c181f958ded9ef92803cec172fd Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Thu, 22 Jul 2021 08:52:46 +0200 Subject: tests: Add lib/cbfs-verification-test test case This commit adds test case for lib/cbfs verification mechanisms. Signed-off-by: Jakub Czapiga Change-Id: I1d8cbb1c2d0a9db3236de065428b70a9c2a66330 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56601 Reviewed-by: Julius Werner Reviewed-by: Paul Fagerburg Tested-by: build bot (Jenkins) --- tests/stubs/die.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/stubs/die.c (limited to 'tests/stubs/die.c') diff --git a/tests/stubs/die.c b/tests/stubs/die.c new file mode 100644 index 0000000000..84bb401ab0 --- /dev/null +++ b/tests/stubs/die.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include + +void die(const char *msg, ...) +{ + /* die() can be called in middle a function, so we should not allow for it to return */ + static char msg_buf[256]; + va_list v; + va_start(v, msg); + vsnprintf(msg_buf, ARRAY_SIZE(msg_buf), msg, v); + va_end(v); + fail_msg("%s", msg_buf); +} -- cgit v1.2.3