1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 Copyright 2013 Thomas H.P. Andersen
8 #include "alloc-util.h"
10 #include "specifier.h"
11 #include "string-util.h"
15 static void test_specifier_printf(void) {
16 static const Specifier table
[] = {
17 { 'a', specifier_string
, (char*) "AAAA" },
18 { 'b', specifier_string
, (char*) "BBBB" },
19 { 'm', specifier_machine_id
, NULL
},
20 { 'B', specifier_boot_id
, NULL
},
21 { 'H', specifier_host_name
, NULL
},
22 { 'v', specifier_kernel_release
, NULL
},
26 _cleanup_free_
char *w
= NULL
;
29 r
= specifier_printf("xxx a=%a b=%b yyy", table
, NULL
, &w
);
34 assert_se(streq(w
, "xxx a=AAAA b=BBBB yyy"));
37 r
= specifier_printf("machine=%m, boot=%B, host=%H, version=%v", table
, NULL
, &w
);
43 static void test_str_in_set(void) {
44 assert_se(STR_IN_SET("x", "x", "y", "z"));
45 assert_se(!STR_IN_SET("X", "x", "y", "z"));
46 assert_se(!STR_IN_SET("", "x", "y", "z"));
47 assert_se(STR_IN_SET("x", "w", "x"));
50 static void test_strptr_in_set(void) {
51 assert_se(STRPTR_IN_SET("x", "x", "y", "z"));
52 assert_se(!STRPTR_IN_SET("X", "x", "y", "z"));
53 assert_se(!STRPTR_IN_SET("", "x", "y", "z"));
54 assert_se(STRPTR_IN_SET("x", "w", "x"));
56 assert_se(!STRPTR_IN_SET(NULL
, "x", "y", "z"));
57 assert_se(!STRPTR_IN_SET(NULL
, ""));
58 /* strv cannot contain a null, hence the result below */
59 assert_se(!STRPTR_IN_SET(NULL
, NULL
));
62 static const char* const input_table_multiple
[] = {
69 static const char* const input_table_one
[] = {
74 static const char* const input_table_none
[] = {
78 static const char* const input_table_two_empties
[] = {
84 static const char* const input_table_one_empty
[] = {
89 static void test_strv_find(void) {
90 assert_se(strv_find((char **)input_table_multiple
, "three"));
91 assert_se(!strv_find((char **)input_table_multiple
, "four"));
94 static void test_strv_find_prefix(void) {
95 assert_se(strv_find_prefix((char **)input_table_multiple
, "o"));
96 assert_se(strv_find_prefix((char **)input_table_multiple
, "one"));
97 assert_se(strv_find_prefix((char **)input_table_multiple
, ""));
98 assert_se(!strv_find_prefix((char **)input_table_multiple
, "xxx"));
99 assert_se(!strv_find_prefix((char **)input_table_multiple
, "onee"));
102 static void test_strv_find_startswith(void) {
105 r
= strv_find_startswith((char **)input_table_multiple
, "o");
106 assert_se(r
&& streq(r
, "ne"));
108 r
= strv_find_startswith((char **)input_table_multiple
, "one");
109 assert_se(r
&& streq(r
, ""));
111 r
= strv_find_startswith((char **)input_table_multiple
, "");
112 assert_se(r
&& streq(r
, "one"));
114 assert_se(!strv_find_startswith((char **)input_table_multiple
, "xxx"));
115 assert_se(!strv_find_startswith((char **)input_table_multiple
, "onee"));
118 static void test_strv_join(void) {
119 _cleanup_free_
char *p
= NULL
, *q
= NULL
, *r
= NULL
, *s
= NULL
, *t
= NULL
, *v
= NULL
, *w
= NULL
;
121 p
= strv_join((char **)input_table_multiple
, ", ");
123 assert_se(streq(p
, "one, two, three"));
125 q
= strv_join((char **)input_table_multiple
, ";");
127 assert_se(streq(q
, "one;two;three"));
129 r
= strv_join((char **)input_table_multiple
, NULL
);
131 assert_se(streq(r
, "one two three"));
133 s
= strv_join((char **)input_table_one
, ", ");
135 assert_se(streq(s
, "one"));
137 t
= strv_join((char **)input_table_none
, ", ");
139 assert_se(streq(t
, ""));
141 v
= strv_join((char **)input_table_two_empties
, ", ");
143 assert_se(streq(v
, ", "));
145 w
= strv_join((char **)input_table_one_empty
, ", ");
147 assert_se(streq(w
, ""));
150 static void test_strv_unquote(const char *quoted
, char **list
) {
151 _cleanup_strv_free_
char **s
;
152 _cleanup_free_
char *j
;
157 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
158 assert_se(r
== (int) strv_length(list
));
160 j
= strv_join(s
, " | ");
165 assert_se(streq(list
[i
++], *t
));
167 assert_se(list
[i
] == NULL
);
170 static void test_invalid_unquote(const char *quoted
) {
174 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
175 assert_se(s
== NULL
);
176 assert_se(r
== -EINVAL
);
179 static void test_strv_split(void) {
182 _cleanup_strv_free_
char **l
= NULL
;
183 const char str
[] = "one,two,three";
185 l
= strv_split(str
, ",");
190 assert_se(streq(*s
, input_table_multiple
[i
++]));
194 static void test_strv_split_extract(void) {
195 _cleanup_strv_free_
char **l
= NULL
;
196 const char *str
= ":foo\\:bar::waldo:";
199 r
= strv_split_extract(&l
, str
, ":", EXTRACT_DONT_COALESCE_SEPARATORS
);
200 assert_se(r
== (int) strv_length(l
));
201 assert_se(streq_ptr(l
[0], ""));
202 assert_se(streq_ptr(l
[1], "foo:bar"));
203 assert_se(streq_ptr(l
[2], ""));
204 assert_se(streq_ptr(l
[3], "waldo"));
205 assert_se(streq_ptr(l
[4], ""));
206 assert_se(streq_ptr(l
[5], NULL
));
209 static void test_strv_split_newlines(void) {
212 _cleanup_strv_free_
char **l
= NULL
;
213 const char str
[] = "one\ntwo\nthree";
215 l
= strv_split_newlines(str
);
220 assert_se(streq(*s
, input_table_multiple
[i
++]));
224 static void test_strv_split_nulstr(void) {
225 _cleanup_strv_free_
char **l
= NULL
;
226 const char nulstr
[] = "str0\0str1\0str2\0str3\0";
228 l
= strv_split_nulstr (nulstr
);
231 assert_se(streq(l
[0], "str0"));
232 assert_se(streq(l
[1], "str1"));
233 assert_se(streq(l
[2], "str2"));
234 assert_se(streq(l
[3], "str3"));
237 static void test_strv_parse_nulstr(void) {
238 _cleanup_strv_free_
char **l
= NULL
;
239 const char nulstr
[] = "fuck\0fuck2\0fuck3\0\0fuck5\0\0xxx";
241 l
= strv_parse_nulstr(nulstr
, sizeof(nulstr
)-1);
243 puts("Parse nulstr:");
246 assert_se(streq(l
[0], "fuck"));
247 assert_se(streq(l
[1], "fuck2"));
248 assert_se(streq(l
[2], "fuck3"));
249 assert_se(streq(l
[3], ""));
250 assert_se(streq(l
[4], "fuck5"));
251 assert_se(streq(l
[5], ""));
252 assert_se(streq(l
[6], "xxx"));
255 static void test_strv_overlap(void) {
256 const char * const input_table
[] = {
262 const char * const input_table_overlap
[] = {
266 const char * const input_table_unique
[] = {
273 assert_se(strv_overlap((char **)input_table
, (char**)input_table_overlap
));
274 assert_se(!strv_overlap((char **)input_table
, (char**)input_table_unique
));
277 static void test_strv_sort(void) {
278 const char* input_table
[] = {
282 "CAPITAL LETTERS FIRST",
287 strv_sort((char **)input_table
);
289 assert_se(streq(input_table
[0], "CAPITAL LETTERS FIRST"));
290 assert_se(streq(input_table
[1], "apple"));
291 assert_se(streq(input_table
[2], "banana"));
292 assert_se(streq(input_table
[3], "citrus"));
293 assert_se(streq(input_table
[4], "durian"));
296 static void test_strv_extend_strv_concat(void) {
297 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
299 a
= strv_new("without", "suffix", NULL
);
300 b
= strv_new("with", "suffix", NULL
);
304 assert_se(strv_extend_strv_concat(&a
, b
, "_suffix") >= 0);
306 assert_se(streq(a
[0], "without"));
307 assert_se(streq(a
[1], "suffix"));
308 assert_se(streq(a
[2], "with_suffix"));
309 assert_se(streq(a
[3], "suffix_suffix"));
312 static void test_strv_extend_strv(void) {
313 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **n
= NULL
;
315 a
= strv_new("abc", "def", "ghi", NULL
);
316 b
= strv_new("jkl", "mno", "abc", "pqr", NULL
);
320 assert_se(strv_extend_strv(&a
, b
, true) == 3);
322 assert_se(streq(a
[0], "abc"));
323 assert_se(streq(a
[1], "def"));
324 assert_se(streq(a
[2], "ghi"));
325 assert_se(streq(a
[3], "jkl"));
326 assert_se(streq(a
[4], "mno"));
327 assert_se(streq(a
[5], "pqr"));
328 assert_se(strv_length(a
) == 6);
330 assert_se(strv_extend_strv(&n
, b
, false) >= 0);
331 assert_se(streq(n
[0], "jkl"));
332 assert_se(streq(n
[1], "mno"));
333 assert_se(streq(n
[2], "abc"));
334 assert_se(streq(n
[3], "pqr"));
335 assert_se(strv_length(n
) == 4);
338 static void test_strv_extend(void) {
339 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
341 a
= strv_new("test", "test1", NULL
);
343 assert_se(strv_extend(&a
, "test2") >= 0);
344 assert_se(strv_extend(&b
, "test3") >= 0);
346 assert_se(streq(a
[0], "test"));
347 assert_se(streq(a
[1], "test1"));
348 assert_se(streq(a
[2], "test2"));
349 assert_se(streq(b
[0], "test3"));
352 static void test_strv_extendf(void) {
353 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
355 a
= strv_new("test", "test1", NULL
);
357 assert_se(strv_extendf(&a
, "test2 %s %d %s", "foo", 128, "bar") >= 0);
358 assert_se(strv_extendf(&b
, "test3 %s %s %d", "bar", "foo", 128) >= 0);
360 assert_se(streq(a
[0], "test"));
361 assert_se(streq(a
[1], "test1"));
362 assert_se(streq(a
[2], "test2 foo 128 bar"));
363 assert_se(streq(b
[0], "test3 bar foo 128"));
366 static void test_strv_foreach(void) {
367 _cleanup_strv_free_
char **a
;
371 a
= strv_new("one", "two", "three", NULL
);
375 STRV_FOREACH(check
, a
) {
376 assert_se(streq(*check
, input_table_multiple
[i
++]));
380 static void test_strv_foreach_backwards(void) {
381 _cleanup_strv_free_
char **a
;
385 a
= strv_new("one", "two", "three", NULL
);
389 STRV_FOREACH_BACKWARDS(check
, a
)
390 assert_se(streq_ptr(*check
, input_table_multiple
[i
--]));
392 STRV_FOREACH_BACKWARDS(check
, (char**) NULL
)
393 assert_not_reached("Let's see that we check empty strv right, too.");
395 STRV_FOREACH_BACKWARDS(check
, (char**) { NULL
})
396 assert_not_reached("Let's see that we check empty strv right, too.");
399 static void test_strv_foreach_pair(void) {
400 _cleanup_strv_free_
char **a
= NULL
;
403 a
= strv_new("pair_one", "pair_one",
404 "pair_two", "pair_two",
405 "pair_three", "pair_three",
408 STRV_FOREACH_PAIR(x
, y
, a
) {
409 assert_se(streq(*x
, *y
));
413 static void test_strv_from_stdarg_alloca_one(char **l
, const char *first
, ...) {
417 j
= strv_from_stdarg_alloca(first
);
420 assert_se(streq_ptr(l
[i
], j
[i
]));
427 static void test_strv_from_stdarg_alloca(void) {
428 test_strv_from_stdarg_alloca_one(STRV_MAKE("foo", "bar"), "foo", "bar", NULL
);
429 test_strv_from_stdarg_alloca_one(STRV_MAKE("foo"), "foo", NULL
);
430 test_strv_from_stdarg_alloca_one(STRV_MAKE_EMPTY
, NULL
);
433 static void test_strv_insert(void) {
434 _cleanup_strv_free_
char **a
= NULL
;
436 assert_se(strv_insert(&a
, 0, strdup("first")) == 0);
437 assert_se(streq(a
[0], "first"));
440 assert_se(strv_insert(&a
, 0, NULL
) == 0);
441 assert_se(streq(a
[0], "first"));
444 assert_se(strv_insert(&a
, 1, strdup("two")) == 0);
445 assert_se(streq(a
[0], "first"));
446 assert_se(streq(a
[1], "two"));
449 assert_se(strv_insert(&a
, 4, strdup("tri")) == 0);
450 assert_se(streq(a
[0], "first"));
451 assert_se(streq(a
[1], "two"));
452 assert_se(streq(a
[2], "tri"));
455 assert_se(strv_insert(&a
, 1, strdup("duo")) == 0);
456 assert_se(streq(a
[0], "first"));
457 assert_se(streq(a
[1], "duo"));
458 assert_se(streq(a
[2], "two"));
459 assert_se(streq(a
[3], "tri"));
463 static void test_strv_push_prepend(void) {
464 _cleanup_strv_free_
char **a
= NULL
;
466 a
= strv_new("foo", "bar", "three", NULL
);
468 assert_se(strv_push_prepend(&a
, strdup("first")) >= 0);
469 assert_se(streq(a
[0], "first"));
470 assert_se(streq(a
[1], "foo"));
471 assert_se(streq(a
[2], "bar"));
472 assert_se(streq(a
[3], "three"));
475 assert_se(strv_consume_prepend(&a
, strdup("first2")) >= 0);
476 assert_se(streq(a
[0], "first2"));
477 assert_se(streq(a
[1], "first"));
478 assert_se(streq(a
[2], "foo"));
479 assert_se(streq(a
[3], "bar"));
480 assert_se(streq(a
[4], "three"));
484 static void test_strv_push(void) {
485 _cleanup_strv_free_
char **a
= NULL
;
488 assert_se(i
= strdup("foo"));
489 assert_se(strv_push(&a
, i
) >= 0);
491 assert_se(i
= strdup("a"));
492 assert_se(j
= strdup("b"));
493 assert_se(strv_push_pair(&a
, i
, j
) >= 0);
495 assert_se(streq_ptr(a
[0], "foo"));
496 assert_se(streq_ptr(a
[1], "a"));
497 assert_se(streq_ptr(a
[2], "b"));
498 assert_se(streq_ptr(a
[3], NULL
));
501 static void test_strv_equal(void) {
502 _cleanup_strv_free_
char **a
= NULL
;
503 _cleanup_strv_free_
char **b
= NULL
;
504 _cleanup_strv_free_
char **c
= NULL
;
506 a
= strv_new("one", "two", "three", NULL
);
508 b
= strv_new("one", "two", "three", NULL
);
510 c
= strv_new("one", "two", "three", "four", NULL
);
513 assert_se(strv_equal(a
, a
));
514 assert_se(strv_equal(a
, b
));
515 assert_se(strv_equal(NULL
, NULL
));
517 assert_se(!strv_equal(a
, c
));
518 assert_se(!strv_equal(b
, c
));
519 assert_se(!strv_equal(b
, NULL
));
522 static void test_strv_is_uniq(void) {
523 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **c
= NULL
, **d
= NULL
;
525 a
= strv_new(NULL
, NULL
);
527 assert_se(strv_is_uniq(a
));
529 b
= strv_new("foo", NULL
);
531 assert_se(strv_is_uniq(b
));
533 c
= strv_new("foo", "bar", NULL
);
535 assert_se(strv_is_uniq(c
));
537 d
= strv_new("foo", "bar", "waldo", "bar", "piep", NULL
);
539 assert_se(!strv_is_uniq(d
));
542 static void test_strv_reverse(void) {
543 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **c
= NULL
, **d
= NULL
;
545 a
= strv_new(NULL
, NULL
);
549 assert_se(strv_isempty(a
));
551 b
= strv_new("foo", NULL
);
554 assert_se(streq_ptr(b
[0], "foo"));
555 assert_se(streq_ptr(b
[1], NULL
));
557 c
= strv_new("foo", "bar", NULL
);
560 assert_se(streq_ptr(c
[0], "bar"));
561 assert_se(streq_ptr(c
[1], "foo"));
562 assert_se(streq_ptr(c
[2], NULL
));
564 d
= strv_new("foo", "bar", "waldo", NULL
);
567 assert_se(streq_ptr(d
[0], "waldo"));
568 assert_se(streq_ptr(d
[1], "bar"));
569 assert_se(streq_ptr(d
[2], "foo"));
570 assert_se(streq_ptr(d
[3], NULL
));
573 static void test_strv_shell_escape(void) {
574 _cleanup_strv_free_
char **v
= NULL
;
576 v
= strv_new("foo:bar", "bar,baz", "wal\\do", NULL
);
578 assert_se(strv_shell_escape(v
, ",:"));
579 assert_se(streq_ptr(v
[0], "foo\\:bar"));
580 assert_se(streq_ptr(v
[1], "bar\\,baz"));
581 assert_se(streq_ptr(v
[2], "wal\\\\do"));
582 assert_se(streq_ptr(v
[3], NULL
));
585 static void test_strv_skip_one(char **a
, size_t n
, char **b
) {
587 assert_se(strv_equal(a
, b
));
590 static void test_strv_skip(void) {
591 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 0, STRV_MAKE("foo", "bar", "baz"));
592 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 1, STRV_MAKE("bar", "baz"));
593 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 2, STRV_MAKE("baz"));
594 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 3, STRV_MAKE(NULL
));
595 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 4, STRV_MAKE(NULL
));
596 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 55, STRV_MAKE(NULL
));
598 test_strv_skip_one(STRV_MAKE("quux"), 0, STRV_MAKE("quux"));
599 test_strv_skip_one(STRV_MAKE("quux"), 1, STRV_MAKE(NULL
));
600 test_strv_skip_one(STRV_MAKE("quux"), 55, STRV_MAKE(NULL
));
602 test_strv_skip_one(STRV_MAKE(NULL
), 0, STRV_MAKE(NULL
));
603 test_strv_skip_one(STRV_MAKE(NULL
), 1, STRV_MAKE(NULL
));
604 test_strv_skip_one(STRV_MAKE(NULL
), 55, STRV_MAKE(NULL
));
607 static void test_strv_extend_n(void) {
608 _cleanup_strv_free_
char **v
= NULL
;
610 v
= strv_new("foo", "bar", NULL
);
613 assert_se(strv_extend_n(&v
, "waldo", 3) >= 0);
614 assert_se(strv_extend_n(&v
, "piep", 2) >= 0);
616 assert_se(streq(v
[0], "foo"));
617 assert_se(streq(v
[1], "bar"));
618 assert_se(streq(v
[2], "waldo"));
619 assert_se(streq(v
[3], "waldo"));
620 assert_se(streq(v
[4], "waldo"));
621 assert_se(streq(v
[5], "piep"));
622 assert_se(streq(v
[6], "piep"));
623 assert_se(v
[7] == NULL
);
627 assert_se(strv_extend_n(&v
, "foo", 1) >= 0);
628 assert_se(strv_extend_n(&v
, "bar", 0) >= 0);
630 assert_se(streq(v
[0], "foo"));
631 assert_se(v
[1] == NULL
);
634 static void test_strv_make_nulstr_one(char **l
) {
635 _cleanup_free_
char *b
= NULL
, *c
= NULL
;
636 _cleanup_strv_free_
char **q
= NULL
;
637 const char *s
= NULL
;
641 assert_se(strv_make_nulstr(l
, &b
, &n
) >= 0);
642 assert_se(q
= strv_parse_nulstr(b
, n
));
643 assert_se(strv_equal(l
, q
));
645 assert_se(strv_make_nulstr(q
, &c
, &m
) >= 0);
647 assert_se(memcmp(b
, c
, m
) == 0);
650 assert_se(streq(s
, l
[i
++]));
651 assert_se(i
== strv_length(l
));
654 static void test_strv_make_nulstr(void) {
655 test_strv_make_nulstr_one(NULL
);
656 test_strv_make_nulstr_one(STRV_MAKE(NULL
));
657 test_strv_make_nulstr_one(STRV_MAKE("foo"));
658 test_strv_make_nulstr_one(STRV_MAKE("foo", "bar"));
659 test_strv_make_nulstr_one(STRV_MAKE("foo", "bar", "quuux"));
662 static void test_strv_free_free(void) {
665 assert_se(t
= new(char**, 3));
666 assert_se(t
[0] = strv_new("a", "b", NULL
));
667 assert_se(t
[1] = strv_new("c", "d", "e", NULL
));
670 t
= strv_free_free(t
);
673 static void test_foreach_string(void) {
674 const char * const t
[] = {
683 FOREACH_STRING(x
, "foo", "bar", "waldo")
684 assert_se(streq_ptr(t
[i
++], x
));
688 FOREACH_STRING(x
, "zzz")
689 assert_se(streq(x
, "zzz"));
692 static void test_strv_fnmatch(void) {
693 _cleanup_strv_free_
char **v
= NULL
;
695 assert_se(!strv_fnmatch(STRV_MAKE_EMPTY
, "a", 0));
697 v
= strv_new("*\\*", NULL
);
698 assert_se(!strv_fnmatch(v
, "\\", 0));
699 assert_se(strv_fnmatch(v
, "\\", FNM_NOESCAPE
));
702 int main(int argc
, char *argv
[]) {
703 test_specifier_printf();
705 test_strptr_in_set();
707 test_strv_foreach_backwards();
708 test_strv_foreach_pair();
710 test_strv_find_prefix();
711 test_strv_find_startswith();
714 test_strv_unquote(" foo=bar \"waldo\" zzz ", STRV_MAKE("foo=bar", "waldo", "zzz"));
715 test_strv_unquote("", STRV_MAKE_EMPTY
);
716 test_strv_unquote(" ", STRV_MAKE_EMPTY
);
717 test_strv_unquote(" ", STRV_MAKE_EMPTY
);
718 test_strv_unquote(" x", STRV_MAKE("x"));
719 test_strv_unquote("x ", STRV_MAKE("x"));
720 test_strv_unquote(" x ", STRV_MAKE("x"));
721 test_strv_unquote(" \"x\" ", STRV_MAKE("x"));
722 test_strv_unquote(" 'x' ", STRV_MAKE("x"));
723 test_strv_unquote(" 'x\"' ", STRV_MAKE("x\""));
724 test_strv_unquote(" \"x'\" ", STRV_MAKE("x'"));
725 test_strv_unquote("a '--b=c \"d e\"'", STRV_MAKE("a", "--b=c \"d e\""));
727 /* trailing backslashes */
728 test_strv_unquote(" x\\\\", STRV_MAKE("x\\"));
729 test_invalid_unquote(" x\\");
731 test_invalid_unquote("a --b='c \"d e\"''");
732 test_invalid_unquote("a --b='c \"d e\" '\"");
733 test_invalid_unquote("a --b='c \"d e\"garbage");
734 test_invalid_unquote("'");
735 test_invalid_unquote("\"");
736 test_invalid_unquote("'x'y'g");
739 test_strv_split_extract();
740 test_strv_split_newlines();
741 test_strv_split_nulstr();
742 test_strv_parse_nulstr();
745 test_strv_extend_strv();
746 test_strv_extend_strv_concat();
749 test_strv_from_stdarg_alloca();
751 test_strv_push_prepend();
756 test_strv_shell_escape();
758 test_strv_extend_n();
759 test_strv_make_nulstr();
760 test_strv_free_free();
762 test_foreach_string();