summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2014-02-27 22:01:28 -0700
committerTom Rini <trini@ti.com>2014-03-07 10:59:06 -0500
commiteebd1b58d05aa3719aa23be3e4a5c1424b26ff11 (patch)
tree344d1af17dfe23815b4b65c7e7313ea24af8c1d5 /test
parent9a04a858ebb711767f368c5a752928ffc36ed4de (diff)
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 <swarren@wwwdotorg.org> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/command_ut.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/command_ut.c b/test/command_ut.c
index 620a297d45a..4f420569a2d 100644
--- a/test/command_ut.c
+++ b/test/command_ut.c
@@ -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);