summaryrefslogtreecommitdiff
path: root/test/cmd/setexpr.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2025-02-03 16:10:27 +0100
committerTom Rini <trini@konsulko.com>2025-02-07 13:35:23 -0600
commitb0716426367d992db8fb9a2235c0eb9c9fafe324 (patch)
tree5d2091ecd9ea26f2982cd4192dc50b09f907bc2e /test/cmd/setexpr.c
parent0395d75d6b867a3c109e5a71c3773f8415bf5121 (diff)
test: remove available memory check in setexpr_test_str()
env_set() frees the previous value after allocating the new value. As the free() may merge memory chunks the available memory is not expected to stay constant. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'test/cmd/setexpr.c')
-rw-r--r--test/cmd/setexpr.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index cc2003faab5..519912a8e22 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -297,31 +297,18 @@ SETEXPR_TEST(setexpr_test_backref, UTF_CONSOLE);
/* Test 'setexpr' command with setting strings */
static int setexpr_test_str(struct unit_test_state *uts)
{
- ulong start_mem;
char *buf;
buf = map_sysmem(0, BUF_SIZE);
memset(buf, '\xff', BUF_SIZE);
- /*
- * Set 'fred' to the same length as we expect to get below, to avoid a
- * new allocation in 'setexpr'. That way we can check for memory leaks.
- */
ut_assertok(env_set("fred", "x"));
- start_mem = ut_check_free();
ut_asserteq(1, run_command("setexpr.s fred 0", 0));
- ut_assertok(ut_check_delta(start_mem));
strcpy(buf, "hello");
ut_assertok(env_set("fred", "12345"));
- start_mem = ut_check_free();
ut_assertok(run_command("setexpr.s fred *0", 0));
ut_asserteq_str("hello", env_get("fred"));
- /*
- * This fails in CI at present.
- *
- * ut_assertok(ut_check_delta(start_mem));
- */
unmap_sysmem(buf);