diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-07-18 11:12:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 11:12:47 +0200 |
commit | b6070695c8f94bf47ffca8557048bdd16a833a12 (patch) | |
tree | 08b806c2ea2ff89f55fdd49837832f11833327cd /src/test/test-strv.c | |
parent | d909beef0a97d931de92723746a4e3ae9c7f1194 (diff) | |
parent | b60df13b39c0237f9cb1114076464d2431e6bee5 (diff) |
Merge pull request #3745 from keszybz/fix-make-nulstr-confusion
Fix make nulstr confusion
Diffstat (limited to 'src/test/test-strv.c')
-rw-r--r-- | src/test/test-strv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-strv.c b/src/test/test-strv.c index f7a1217df7..841a36782f 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -647,7 +647,9 @@ static void test_strv_extend_n(void) { static void test_strv_make_nulstr_one(char **l) { _cleanup_free_ char *b = NULL, *c = NULL; _cleanup_strv_free_ char **q = NULL; + const char *s = NULL; size_t n, m; + unsigned i = 0; assert_se(strv_make_nulstr(l, &b, &n) >= 0); assert_se(q = strv_parse_nulstr(b, n)); @@ -656,6 +658,10 @@ static void test_strv_make_nulstr_one(char **l) { assert_se(strv_make_nulstr(q, &c, &m) >= 0); assert_se(m == n); assert_se(memcmp(b, c, m) == 0); + + NULSTR_FOREACH(s, b) + assert_se(streq(s, l[i++])); + assert_se(i == strv_length(l)); } static void test_strv_make_nulstr(void) { |