tests: lib: cbprintf_package: Add CBPRINTF_MUST_RUNTIME_PACKAGE test

Extended test to cover CBPRINTF_MUST_RUNTIME_PACKAGE macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-05-07 11:30:26 +02:00 committed by Kumar Gala
commit 0bc3bee738

View file

@ -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; \