summaryrefslogtreecommitdiff
path: root/test/str_ut.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-07-30 08:39:36 -0600
committerTom Rini <trini@konsulko.com>2024-08-07 08:49:10 -0600
commit947aafdebc9f64f12e8aa6ae7f60758f04bd1540 (patch)
tree96db92d2ce7d1cf42b431472cf92e525421af6e2 /test/str_ut.c
parent04894f5ad53cab0ee03eb3bc1cc1682e22f5dd1b (diff)
lib: Handle a special case with str_to_list()
The current implementation can return an extra result at the end when the string ends with a space. Fix this by adding a special case. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/str_ut.c')
-rw-r--r--test/str_ut.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/str_ut.c b/test/str_ut.c
index 389779859a3..96e048975d8 100644
--- a/test/str_ut.c
+++ b/test/str_ut.c
@@ -342,9 +342,7 @@ static int test_str_to_list(struct unit_test_state *uts)
ut_asserteq_str("space", ptr[3]);
ut_assertnonnull(ptr[4]);
ut_asserteq_str("", ptr[4]);
- ut_assertnonnull(ptr[5]);
- ut_asserteq_str("", ptr[5]);
- ut_assertnull(ptr[6]);
+ ut_assertnull(ptr[5]);
str_free_list(ptr);
ut_assertok(ut_check_delta(start));