summaryrefslogtreecommitdiffstats
path: root/tests/stubs
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2021-07-22 08:52:46 +0200
committerJulius Werner <jwerner@chromium.org>2021-09-02 00:31:02 +0000
commit6f3fd6358f605c181f958ded9ef92803cec172fd (patch)
treec9c9a79bcf6d8c2837c686f8b966395eba5e8ef0 /tests/stubs
parent6813d561b2fcd89e0df23a3c41843433767edec3 (diff)
downloadcoreboot-6f3fd6358f605c181f958ded9ef92803cec172fd.tar.gz
coreboot-6f3fd6358f605c181f958ded9ef92803cec172fd.tar.bz2
coreboot-6f3fd6358f605c181f958ded9ef92803cec172fd.zip
tests: Add lib/cbfs-verification-test test case
This commit adds test case for lib/cbfs verification mechanisms. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I1d8cbb1c2d0a9db3236de065428b70a9c2a66330 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56601 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'tests/stubs')
-rw-r--r--tests/stubs/die.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/stubs/die.c b/tests/stubs/die.c
new file mode 100644
index 000000000000..84bb401ab03e
--- /dev/null
+++ b/tests/stubs/die.c
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <tests/test.h>
+
+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);
+}