[PATCH 13/26] cmd: Add a command to display the address map

Simon Glass sjg at chromium.org
Mon Feb 8 15:13:52 CET 2021


Hi Bin,

On Sun, 7 Feb 2021 at 22:12, Bin Meng <bmeng.cn at gmail.com> wrote:
>
> Hi Simon,
>
> On Mon, Feb 8, 2021 at 12:20 PM Simon Glass <sjg at chromium.org> wrote:
> >
> > On Sun, 7 Feb 2021 at 08:12, Bin Meng <bmeng.cn at gmail.com> wrote:
> > >
> > > This adds a new command 'addrmap' to display the address map for
> > > non-identity virtual-physical memory mappings.
> > >
> > > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> > > ---
> > >
> > >  cmd/Kconfig   |  7 +++++++
> > >  cmd/Makefile  |  1 +
> > >  cmd/addrmap.c | 35 +++++++++++++++++++++++++++++++++++
> > >  3 files changed, 43 insertions(+)
> > >  create mode 100644 cmd/addrmap.c
> >
> > This should have a test (e.g. see mem_search.c) and doc/usage file.
>
> I am not sure how that is useful to add a test for this command,
> because this command only prints some value from an array.

Right but then it will only be a short test:

console_record_reset();
ut_assertok(run_command("...", 0));
ut_assert_nextline()
..
ut_assert_console_end();

Then if someone expands it later they will feel obligated to add to the test.

I feel that a lot of things look too trivial to test when started, but
it is often that first trivial test that determines whether we have
tests ever. That is why we have the patman check about adding tests
for new commands.

Regards,
Simon


More information about the U-Boot mailing list