mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
test: cmd: add test for memsize
Add a test for memsize command in same way as meminfo. Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
This commit is contained in:
committed by
Tom Rini
parent
e202eca183
commit
8acc8a6546
@@ -942,6 +942,7 @@ config CMD_MEMINFO_MAP
|
||||
|
||||
config CMD_MEMSIZE
|
||||
bool "memsize"
|
||||
default y if SANDBOX
|
||||
depends on CMD_MEMINFO
|
||||
help
|
||||
Get RAM via command for use in scripts. Print or assign decimal value
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <dm/test.h>
|
||||
#include <env.h>
|
||||
#include <test/cmd.h>
|
||||
#include <test/ut.h>
|
||||
|
||||
@@ -39,4 +40,23 @@ static int cmd_test_meminfo(struct unit_test_state *uts)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CMD_TEST(cmd_test_meminfo, UTF_CONSOLE);
|
||||
|
||||
/* Test 'memsize' command */
|
||||
#ifdef CONFIG_CMD_MEMSIZE
|
||||
static int cmd_test_memsize(struct unit_test_state *uts)
|
||||
{
|
||||
ut_assertok(run_command("memsize", 0));
|
||||
ut_assert_nextline("256 MiB");
|
||||
ut_assert_console_end();
|
||||
|
||||
ut_assertok(run_command("memsize memsz", 0));
|
||||
ut_asserteq_str("256", env_get("memsz"));
|
||||
ut_assert_console_end();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CMD_TEST(cmd_test_memsize, UTF_CONSOLE);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user