summaryrefslogtreecommitdiff
path: root/test/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-03-04 10:13:01 -0500
committerTom Rini <[email protected]>2024-03-04 10:25:47 -0500
commitbd465ada0e1172910f64feac6035f2344449c381 (patch)
treee749428436685ab25dcfe109309adee6f45cdf39 /test/cmd
parentbdbbf1d7b55434973402c390a822490ce6e14994 (diff)
parent68c4d3098b9cf59a20c470df385eb5422fe32bbe (diff)
Merge branch '2024-03-02-assorted-updates' into next
- Assorted MediaTek, ASPEED, xenguest, s5p4418 and qemu-arm fixes - Assorted test fixes/updates/additions. - A few bootstd/related fixes. - Remove common.h from some files - Drop reiserfs - A few other assorted fixes throughout the tree.
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;