tests: logging: log_core_additional: Add panic handler for test backend

Backend implemented in the test did not implemented panic
function and test crashed when log_panic was used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-01-20 10:09:56 +01:00 committed by Carles Cufí
commit 07e0a5f08a

View file

@ -160,6 +160,11 @@ static void sync_hexdump(const struct log_backend *const backend,
cb->sync++;
}
static void panic(const struct log_backend *const backend)
{
ARG_UNUSED(backend);
}
const struct log_backend_api log_backend_test_api = {
.process = IS_ENABLED(CONFIG_LOG2) ? process : NULL,
.put = IS_ENABLED(CONFIG_LOG1_DEFERRED) ? put : NULL,
@ -167,6 +172,7 @@ const struct log_backend_api log_backend_test_api = {
sync_string : NULL,
.put_sync_hexdump = IS_ENABLED(CONFIG_LOG1_IMMEDIATE) ?
sync_hexdump : NULL,
.panic = panic,
};
LOG_BACKEND_DEFINE(backend1, log_backend_test_api, false);