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 <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
fbabe70063
commit
9280b90939
1 changed files with 5 additions and 5 deletions
|
@ -308,7 +308,7 @@ void test_log_msg2_fp(void)
|
||||||
static const uint8_t level = 2;
|
static const uint8_t level = 2;
|
||||||
const void *source = (const void *)123;
|
const void *source = (const void *)123;
|
||||||
int mode;
|
int mode;
|
||||||
long long lli;
|
long long lli = 0x1122334455;
|
||||||
float f = 1.234;
|
float f = 1.234;
|
||||||
double d = 11.3434;
|
double d = 11.3434;
|
||||||
char str[256];
|
char str[256];
|
||||||
|
@ -317,16 +317,16 @@ void test_log_msg2_fp(void)
|
||||||
test_init();
|
test_init();
|
||||||
|
|
||||||
Z_LOG_MSG2_CREATE2(1, mode, 0, domain, source, level, NULL, 0,
|
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);
|
zassert_equal(mode, EXP_MODE(ZERO_COPY), NULL);
|
||||||
|
|
||||||
Z_LOG_MSG2_CREATE2(0, mode, 0, domain, source, level, NULL, 0,
|
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);
|
zassert_equal(mode, EXP_MODE(FROM_STACK), NULL);
|
||||||
|
|
||||||
z_log_msg2_runtime_create(domain, (void *)source, level, NULL, 0,
|
z_log_msg2_runtime_create(domain, (void *)source, level, NULL, 0,
|
||||||
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, str, d, source);
|
snprintfcb(str, sizeof(str), TEST_MSG, i, lli, f, &i, d, source);
|
||||||
|
|
||||||
validate_base_message_set(source, domain, level,
|
validate_base_message_set(source, domain, level,
|
||||||
TEST_TIMESTAMP_INIT_VALUE,
|
TEST_TIMESTAMP_INIT_VALUE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue