summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-13 08:57:31 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-13 08:57:31 +0100
commitbff8f950ab15ef3beb9c363c0303fc6ed5c13c13 (patch)
tree56ef66b3d363bfdd5cc87bbaa14d16cb313d67b4 /src
parenta083b4875e8dec5ce5379d8bc437d750cd338c37 (diff)
downloadsystemd-bff8f950ab15ef3beb9c363c0303fc6ed5c13c13.tar.gz
test-strv: add a simple test for strv_free_free()
Diffstat (limited to 'src')
-rw-r--r--src/test/test-strv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test-strv.c b/src/test/test-strv.c
index 76cd551eeb..c6698f4396 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -676,6 +676,17 @@ static void test_strv_make_nulstr(void) {
test_strv_make_nulstr_one(STRV_MAKE("foo", "bar", "quuux"));
}
+static void test_strv_free_free(void) {
+ char ***t;
+
+ assert_se(t = new(char**, 3));
+ assert_se(t[0] = strv_new("a", "b", NULL));
+ assert_se(t[1] = strv_new("c", "d", "e", NULL));
+ t[2] = NULL;
+
+ t = strv_free_free(t);
+}
+
static void test_foreach_string(void) {
const char * const t[] = {
"foo",
@@ -763,6 +774,7 @@ int main(int argc, char *argv[]) {
test_strv_skip();
test_strv_extend_n();
test_strv_make_nulstr();
+ test_strv_free_free();
test_foreach_string();
test_strv_fnmatch();