diff options
Diffstat (limited to 'test/env')
-rw-r--r-- | test/env/cmd_ut_env.c | 27 | ||||
-rw-r--r-- | test/env/hashtable.c | 2 |
2 files changed, 27 insertions, 2 deletions
diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c index 13e0998341e..4af05764fb8 100644 --- a/test/env/cmd_ut_env.c +++ b/test/env/cmd_ut_env.c @@ -9,6 +9,33 @@ #include <test/suites.h> #include <test/ut.h> +static int env_test_env_cmd(struct unit_test_state *uts) +{ + ut_assertok(run_command("setenv non_default_var1 1", 0)); + ut_assert_console_end(); + + ut_assertok(run_command("setenv non_default_var2 1", 0)); + ut_assert_console_end(); + + ut_assertok(run_command("env print non_default_var1", 0)); + ut_assert_nextline("non_default_var1=1"); + ut_assert_console_end(); + + ut_assertok(run_command("env default non_default_var1 non_default_var2", 0)); + ut_assert_nextline("WARNING: 'non_default_var1' not in imported env, deleting it!"); + ut_assert_nextline("WARNING: 'non_default_var2' not in imported env, deleting it!"); + ut_assert_console_end(); + + ut_asserteq(1, run_command("env exists non_default_var1", 0)); + ut_assert_console_end(); + + ut_asserteq(1, run_command("env exists non_default_var2", 0)); + ut_assert_console_end(); + + return 0; +} +ENV_TEST(env_test_env_cmd, UTF_CONSOLE); + int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = UNIT_TEST_SUITE_START(env_test); diff --git a/test/env/hashtable.c b/test/env/hashtable.c index ccdf0138c4b..16e49358888 100644 --- a/test/env/hashtable.c +++ b/test/env/hashtable.c @@ -101,7 +101,6 @@ static int env_test_htab_fill(struct unit_test_state *uts) hdestroy_r(&htab); return 0; } - ENV_TEST(env_test_htab_fill, 0); /* Fill the hashtable up halfway an repeateadly delete/create elements @@ -122,5 +121,4 @@ static int env_test_htab_deletes(struct unit_test_state *uts) hdestroy_r(&htab); return 0; } - ENV_TEST(env_test_htab_deletes, 0); |