Skip to content

Commit 9280b90

Browse files
nordic-krchgalak
authored andcommitted
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 <[email protected]>
1 parent fbabe70 commit 9280b90

File tree

1 file changed

+5
-5
lines changed
  • tests/subsys/logging/log_msg2/src

1 file changed

+5
-5
lines changed

tests/subsys/logging/log_msg2/src/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void test_log_msg2_fp(void)
308308
static const uint8_t level = 2;
309309
const void *source = (const void *)123;
310310
int mode;
311-
long long lli;
311+
long long lli = 0x1122334455;
312312
float f = 1.234;
313313
double d = 11.3434;
314314
char str[256];
@@ -317,16 +317,16 @@ void test_log_msg2_fp(void)
317317
test_init();
318318

319319
Z_LOG_MSG2_CREATE2(1, mode, 0, domain, source, level, NULL, 0,
320-
TEST_MSG, i, lli, f, str, d, source);
320+
TEST_MSG, i, lli, f, &i, d, source);
321321
zassert_equal(mode, EXP_MODE(ZERO_COPY), NULL);
322322

323323
Z_LOG_MSG2_CREATE2(0, mode, 0, domain, source, level, NULL, 0,
324-
TEST_MSG, i, lli, f, str, d, source);
324+
TEST_MSG, i, lli, f, &i, d, source);
325325
zassert_equal(mode, EXP_MODE(FROM_STACK), NULL);
326326

327327
z_log_msg2_runtime_create(domain, (void *)source, level, NULL, 0,
328-
TEST_MSG, i, lli, f, str, d, source);
329-
snprintfcb(str, sizeof(str), TEST_MSG, i, lli, f, str, d, source);
328+
TEST_MSG, i, lli, f, &i, d, source);
329+
snprintfcb(str, sizeof(str), TEST_MSG, i, lli, f, &i, d, source);
330330

331331
validate_base_message_set(source, domain, level,
332332
TEST_TIMESTAMP_INIT_VALUE,

0 commit comments

Comments
 (0)