// 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 <test/log.h>
#include <test/test.h>
#include <test/suites.h>
#include <test/ut.h>

DECLARE_GLOBAL_DATA_PTR;

#define BUFFSIZE 64

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 ", 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 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));

	return 0;
}
LOG_TEST(log_test_cont);
