From 0bc3bee7382ab80c70dbf84678fe093f7f591dc6 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Fri, 7 May 2021 11:30:26 +0200 Subject: [PATCH] tests: lib: cbprintf_package: Add CBPRINTF_MUST_RUNTIME_PACKAGE test Extended test to cover CBPRINTF_MUST_RUNTIME_PACKAGE macro. Signed-off-by: Krzysztof Chruscinski --- tests/lib/cbprintf_package/src/test.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/lib/cbprintf_package/src/test.inc b/tests/lib/cbprintf_package/src/test.inc index c358498d442..a0247c2d21d 100644 --- a/tests/lib/cbprintf_package/src/test.inc +++ b/tests/lib/cbprintf_package/src/test.inc @@ -57,7 +57,9 @@ static void unpack(const char *desc, struct out_buffer *buf, } #define TEST_PACKAGING(fmt, ...) do { \ - snprintf(compare_buf, sizeof(compare_buf), fmt, __VA_ARGS__); \ + int must_runtime = CBPRINTF_MUST_RUNTIME_PACKAGE(0, fmt, __VA_ARGS__); \ + zassert_equal(must_runtime, !Z_C_GENERIC, NULL); \ + snprintfcb(compare_buf, sizeof(compare_buf), fmt, __VA_ARGS__); \ printk("-----------------------------------------\n"); \ printk("%s\n", compare_buf); \ uint8_t *pkg; \