blob: 72798b96edddc5ff5b5e47395d7661e8adf2b3ed [file] [log] [blame]
Bin Meng261fc062021-02-25 17:22:35 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Tests for addrmap command
4 *
5 * Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
6 */
7
Bin Meng261fc062021-02-25 17:22:35 +08008#include <console.h>
Bin Meng261fc062021-02-25 17:22:35 +08009#include <test/ut.h>
10
11/* Declare a new addrmap test */
Simon Glassb15512c2025-01-20 14:25:32 -070012#define ADDRMAP_TEST(_name, _flags) UNIT_TEST(_name, _flags, addrmap)
Bin Meng261fc062021-02-25 17:22:35 +080013
14/* Test 'addrmap' command output */
15static int addrmap_test_basic(struct unit_test_state *uts)
16{
Bin Meng261fc062021-02-25 17:22:35 +080017 ut_assertok(run_command("addrmap", 0));
18 ut_assert_nextline(" vaddr paddr size");
19 ut_assert_nextline("================ ================ ================");
20 /* There should be at least one entry */
21 ut_assertok(!ut_check_console_end(uts));
22
23 return 0;
24}
Simon Glass11fcfa32024-08-22 07:57:50 -060025ADDRMAP_TEST(addrmap_test_basic, UTF_CONSOLE);