From 9280b909399c8fb12a601272e0cba88fe4435e99 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Fri, 7 May 2021 08:56:55 +0200 Subject: [PATCH] tests: logging: log_msg2: Fix test on qemu_cortex_a53 Test was failing because of uninitialized variable and wrong pointer being used (pointer to char). Signed-off-by: Krzysztof Chruscinski --- tests/subsys/logging/log_msg2/src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/subsys/logging/log_msg2/src/main.c b/tests/subsys/logging/log_msg2/src/main.c index 8028666c112..ed43b7c137f 100644 --- a/tests/subsys/logging/log_msg2/src/main.c +++ b/tests/subsys/logging/log_msg2/src/main.c @@ -308,7 +308,7 @@ void test_log_msg2_fp(void) static const uint8_t level = 2; const void *source = (const void *)123; int mode; - long long lli; + long long lli = 0x1122334455; float f = 1.234; double d = 11.3434; char str[256]; @@ -317,16 +317,16 @@ void test_log_msg2_fp(void) test_init(); Z_LOG_MSG2_CREATE2(1, mode, 0, domain, source, level, NULL, 0, - TEST_MSG, i, lli, f, str, d, source); + TEST_MSG, i, lli, f, &i, d, source); zassert_equal(mode, EXP_MODE(ZERO_COPY), NULL); Z_LOG_MSG2_CREATE2(0, mode, 0, domain, source, level, NULL, 0, - TEST_MSG, i, lli, f, str, d, source); + TEST_MSG, i, lli, f, &i, d, source); zassert_equal(mode, EXP_MODE(FROM_STACK), NULL); z_log_msg2_runtime_create(domain, (void *)source, level, NULL, 0, - TEST_MSG, i, lli, f, str, d, source); - snprintfcb(str, sizeof(str), TEST_MSG, i, lli, f, str, d, source); + TEST_MSG, i, lli, f, &i, d, source); + snprintfcb(str, sizeof(str), TEST_MSG, i, lli, f, &i, d, source); validate_base_message_set(source, domain, level, TEST_TIMESTAMP_INIT_VALUE,