Skip to content

Commit eebd1b5

Browse files
swarrentrini
authored andcommitted
unit-test: clean up evironment after Hush tests
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 <[email protected]> Acked-by: Simon Glass <[email protected]>
1 parent 9a04a85 commit eebd1b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/command_ut.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
6565
run_command("if test " expr " ; then " \
6666
"setenv " #name "_" #expected_result " y; else " \
6767
"setenv " #name "_" #expected_result " n; fi", 0); \
68-
assert(!strcmp(#expected_result, getenv(#name "_" #expected_result)));
68+
assert(!strcmp(#expected_result, getenv(#name "_" #expected_result))); \
69+
setenv(#name "_" #expected_result, NULL);
6970

7071
/* Basic operators */
7172
HUSH_TEST(streq, "aaa = aaa", y);

0 commit comments

Comments
 (0)