| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright 2021 Google LLC |
| * Logging function tests for CONFIG_LOG=n without #define DEBUG |
| #include <asm/global_data.h> |
| static int log_test_log_disabled_ndebug(struct unit_test_state *uts) |
| memset(buf, 0, BUFFSIZE); |
| console_record_reset_enable(); |
| /* Output a log record at every level */ |
| for (i = LOGL_EMERG; i < LOGL_COUNT; i++) |
| log(LOGC_NONE, i, "testing level %i\n", i); |
| gd->flags &= ~GD_FLG_RECORD; |
| /* Since DEBUG is not defined, we expect to not get debug output */ |
| for (i = LOGL_EMERG; i < LOGL_DEBUG; i++) |
| ut_assertok(ut_check_console_line(uts, "testing level %d", i)); |
| ut_assertok(ut_check_console_end(uts)); |
| LOG_TEST(log_test_log_disabled_ndebug); |