test: Add some tests for setexpr

This command currently has no tests. Add some for basic assignment and the
integer operations.

Note that the default size for setexpr is ulong, which varies depending on
the build machine. So for sandbox on a 64-bit host, this means that the
default size is 64 bits.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-11-01 14:15:35 -07:00
committed by Tom Rini
parent 4532bf411e
commit 90a9901764
4 changed files with 168 additions and 0 deletions

View File

@@ -75,6 +75,8 @@ static struct cmd_tbl cmd_ut_sub[] = {
U_BOOT_CMD_MKENT(log, CONFIG_SYS_MAXARGS, 1, do_ut_log, "", ""),
#endif
U_BOOT_CMD_MKENT(mem, CONFIG_SYS_MAXARGS, 1, do_ut_mem, "", ""),
U_BOOT_CMD_MKENT(setexpr, CONFIG_SYS_MAXARGS, 1, do_ut_setexpr, "",
""),
#ifdef CONFIG_UT_TIME
U_BOOT_CMD_MKENT(time, CONFIG_SYS_MAXARGS, 1, do_ut_time, "", ""),
#endif
@@ -153,6 +155,7 @@ static char ut_help_text[] =
#ifdef CONFIG_UT_OVERLAY
"ut overlay [test-name]\n"
#endif
"ut setexpr [test-name] - test setexpr command\n"
#ifdef CONFIG_SANDBOX
"ut str - Basic test of string functions\n"
#endif