summaryrefslogtreecommitdiff
path: root/test/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'test/cmd')
-rw-r--r--test/cmd/mbr.c6
-rw-r--r--test/cmd/setexpr.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c
index 46b78e706ca..235b363290e 100644
--- a/test/cmd/mbr.c
+++ b/test/cmd/mbr.c
@@ -240,7 +240,11 @@ static int mbr_test_run(struct unit_test_state *uts)
ut_assert(ofnode_valid(node));
ut_assertok(lists_bind_fdt(gd->dm_root, node, &dev, NULL, false));
- mbr_parts_max = sizeof('\0') + 2 +
+ /*
+ * 1 byte for null character
+ * 2 reserved bytes
+ */
+ mbr_parts_max = 1 + 2 +
strlen(mbr_parts_header) +
strlen(mbr_parts_p1) +
strlen(mbr_parts_p2) +
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 312593e1e32..ee329e94b85 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -179,6 +179,16 @@ static int setexpr_test_regex(struct unit_test_state *uts)
val = env_get("mary");
ut_asserteq_str("this is a test", val);
+ /* No match */
+ ut_assertok(run_command("setenv fred 'this is a test'", 0));
+ ut_assertok(run_command("setenv mary ''", 0));
+ ut_assertok(run_command("setexpr fred gsub us is \"${fred}\"", 0));
+ ut_assertok(run_command("setexpr mary gsub us is \"${fred}\"", 0));
+ val = env_get("fred");
+ ut_asserteq_str("this is a test", val);
+ val = env_get("mary");
+ ut_asserteq_str("this is a test", val);
+
unmap_sysmem(buf);
return 0;