summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-12-18 17:01:42 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-12-18 19:26:21 -0500
commit30bcc05295944cfc2f3ed9159592130c003e19f5 (patch)
treef88a7f18a510f24474a2151727dc5940ec5206ec /src
parent447021aafdf4bd0c0f70a3078d35a8f00ada4504 (diff)
test-strv: use STRV_MAKE
Diffstat (limited to 'src')
-rw-r--r--src/test/test-strv.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/test-strv.c b/src/test/test-strv.c
index e09b4fb782..0b78086ea9 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -175,7 +175,7 @@ static void test_strv_quote_unquote(const char* const *split, const char *quoted
}
}
-static void test_strv_unquote(const char *quoted, const char **list) {
+static void test_strv_unquote(const char *quoted, char **list) {
_cleanup_strv_free_ char **s;
_cleanup_free_ char *j;
unsigned i = 0;
@@ -507,18 +507,18 @@ int main(int argc, char *argv[]) {
test_strv_quote_unquote(input_table_quotes, QUOTES_STRING);
test_strv_quote_unquote(input_table_spaces, SPACES_STRING);
- test_strv_unquote(" foo=bar \"waldo\" zzz ", (const char*[]) { "foo=bar", "waldo", "zzz", NULL });
- test_strv_unquote("", (const char*[]) { NULL });
- test_strv_unquote(" ", (const char*[]) { NULL });
- test_strv_unquote(" ", (const char*[]) { NULL });
- test_strv_unquote(" x", (const char*[]) { "x", NULL });
- test_strv_unquote("x ", (const char*[]) { "x", NULL });
- test_strv_unquote(" x ", (const char*[]) { "x", NULL });
- test_strv_unquote(" \"x\" ", (const char*[]) { "x", NULL });
- test_strv_unquote(" 'x' ", (const char*[]) { "x", NULL });
- test_strv_unquote(" 'x\"' ", (const char*[]) { "x\"", NULL });
- test_strv_unquote(" \"x'\" ", (const char*[]) { "x'", NULL });
- test_strv_unquote("a '--b=c \"d e\"'", (const char*[]) { "a", "--b=c \"d e\"", NULL });
+ test_strv_unquote(" foo=bar \"waldo\" zzz ", STRV_MAKE("foo=bar", "waldo", "zzz"));
+ test_strv_unquote("", STRV_MAKE_EMPTY);
+ test_strv_unquote(" ", STRV_MAKE_EMPTY);
+ test_strv_unquote(" ", STRV_MAKE_EMPTY);
+ test_strv_unquote(" x", STRV_MAKE("x"));
+ test_strv_unquote("x ", STRV_MAKE("x"));
+ test_strv_unquote(" x ", STRV_MAKE("x"));
+ test_strv_unquote(" \"x\" ", STRV_MAKE("x"));
+ test_strv_unquote(" 'x' ", STRV_MAKE("x"));
+ test_strv_unquote(" 'x\"' ", STRV_MAKE("x\""));
+ test_strv_unquote(" \"x'\" ", STRV_MAKE("x'"));
+ test_strv_unquote("a '--b=c \"d e\"'", STRV_MAKE("a", "--b=c \"d e\""));
test_invalid_unquote("a --b='c \"d e\"''");
test_invalid_unquote("a --b='c \"d e\" '\"");