mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-16 13:48:14 +01:00
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
65 lines
1.9 KiB
C
65 lines
1.9 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (c) 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|
*
|
|
* Test continuation of log messages.
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <console.h>
|
|
#include <asm/global_data.h>
|
|
#include <test/log.h>
|
|
#include <test/test.h>
|
|
#include <test/suites.h>
|
|
#include <test/ut.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
static int log_test_cont(struct unit_test_state *uts)
|
|
{
|
|
int log_fmt;
|
|
int log_level;
|
|
|
|
log_fmt = gd->log_fmt;
|
|
log_level = gd->default_log_level;
|
|
|
|
/* Write two messages, the second continuing the first */
|
|
gd->log_fmt = (1 << LOGF_CAT) | (1 << LOGF_LEVEL) | (1 << LOGF_MSG);
|
|
gd->default_log_level = LOGL_INFO;
|
|
console_record_reset_enable();
|
|
log(LOGC_ARCH, LOGL_ERR, "ea%d\n", 1);
|
|
log(LOGC_CONT, LOGL_CONT, "cc%d\n", 2);
|
|
gd->default_log_level = log_level;
|
|
gd->log_fmt = log_fmt;
|
|
gd->flags &= ~GD_FLG_RECORD;
|
|
ut_assertok(ut_check_console_line(uts, "ERR.arch, ea1"));
|
|
ut_assertok(ut_check_console_line(uts, "ERR.arch, cc2"));
|
|
ut_assertok(ut_check_console_end(uts));
|
|
|
|
/* Write a third message which is not a continuation */
|
|
gd->log_fmt = (1 << LOGF_CAT) | (1 << LOGF_LEVEL) | (1 << LOGF_MSG);
|
|
gd->default_log_level = LOGL_INFO;
|
|
console_record_reset_enable();
|
|
log(LOGC_EFI, LOGL_INFO, "ie%d\n", 3);
|
|
gd->default_log_level = log_level;
|
|
gd->log_fmt = log_fmt;
|
|
gd->flags &= ~GD_FLG_RECORD;
|
|
ut_assertok(ut_check_console_line(uts, "INFO.efi, ie3"));
|
|
ut_assertok(ut_check_console_end(uts));
|
|
|
|
/* Write two messages without a newline between them */
|
|
gd->log_fmt = (1 << LOGF_CAT) | (1 << LOGF_LEVEL) | (1 << LOGF_MSG);
|
|
gd->default_log_level = LOGL_INFO;
|
|
console_record_reset_enable();
|
|
log(LOGC_ARCH, LOGL_ERR, "ea%d ", 1);
|
|
log(LOGC_CONT, LOGL_CONT, "cc%d\n", 2);
|
|
gd->default_log_level = log_level;
|
|
gd->log_fmt = log_fmt;
|
|
gd->flags &= ~GD_FLG_RECORD;
|
|
ut_assertok(ut_check_console_line(uts, "ERR.arch, ea1 cc2"));
|
|
ut_assertok(ut_check_console_end(uts));
|
|
|
|
return 0;
|
|
}
|
|
LOG_TEST(log_test_cont);
|