tests: logging: log_api: Fix test cases setup

Execute log_setup even when test is skipped. This is especially
vital when test infrastructure is using logging (e.g. LOG_PRINT
is enabled).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-02-28 08:19:38 +01:00 committed by Anas Nashif
commit 92fb1af09a

View file

@ -357,6 +357,8 @@ static void test_log_overflow(void)
{
log_timestamp_t exp_timestamp = TIMESTAMP_INIT_VAL;
log_setup(false);
if (IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE)) {
ztest_test_skip();
}
@ -369,8 +371,6 @@ static void test_log_overflow(void)
data[i] = i;
}
log_setup(false);
uint32_t hexdump_len = get_long_hexdump();
/* expect first message to be dropped */
@ -591,6 +591,8 @@ static void log_n_messages(uint32_t n_msg, uint32_t exp_dropped)
*/
static void test_log_msg_dropped_notification(void)
{
log_setup(false);
if (IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE)) {
ztest_test_skip();
}