Skip to content

Commit

Permalink
unit-test: clean up evironment after Hush tests
Browse files Browse the repository at this point in the history
Delete the temporary variables that are used to save unit-test results
from the environment after running the test. This prevents polluting
the environment, or growing it too much.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Simon Glass <sjg@chromium.org>
  • Loading branch information
swarren authored and trini committed Mar 7, 2014
1 parent 9a04a85 commit eebd1b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/command_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
run_command("if test " expr " ; then " \
"setenv " #name "_" #expected_result " y; else " \
"setenv " #name "_" #expected_result " n; fi", 0); \
assert(!strcmp(#expected_result, getenv(#name "_" #expected_result)));
assert(!strcmp(#expected_result, getenv(#name "_" #expected_result))); \
setenv(#name "_" #expected_result, NULL);

/* Basic operators */
HUSH_TEST(streq, "aaa = aaa", y);
Expand Down

0 comments on commit eebd1b5

Please sign in to comment.