From 27b0370222bbeea6443ace8557a4d8779cc9cdbd Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Mon, 23 Sep 2024 09:25:35 +0000 Subject: [PATCH] test_proc_args: Print arguments separated with newlines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1920853 13f79535-47bb-0310-9956-ffa450edef68 --- test/echoargs.c | 3 +-- test/testproc.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/test/echoargs.c b/test/echoargs.c index 38ce5fa0fba..f61df450a19 100644 --- a/test/echoargs.c +++ b/test/echoargs.c @@ -37,8 +37,7 @@ int main(int argc, const char * const *argv, const char* const* env) apr_file_open_stdout(&file, pool); for (i = 1; i < argc; i++) { - if (i > 1) apr_file_puts(",", file); - apr_file_puts(argv[i], file); + apr_file_printf(file, "%d: [%s]\n", i, argv[i]); } apr_terminate(); diff --git a/test/testproc.c b/test/testproc.c index 50ea8e751a2..80f71954684 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -217,14 +217,16 @@ static void test_proc_args(abts_case* tc, void* data) actual = apr_pstrcat(p, actual, buf, NULL); } - expected = "1" "," - "" "," - "\"te st" "," - " a\\b" "," - " a\\\\b" "," - " \\" "," - "new\nline" "," - " \\\\"; + expected = + "1: [1]" "\n" + "2: []" "\n" + "3: [\"te st]" "\n" + "4: [ a\\b]" "\n" + "5: [ a\\\\b]" "\n" + "6: [ \\]" "\n" + "7: [new\nline]" "\n" + "8: [ \\\\]" "\n"; + ABTS_STR_EQUAL(tc, expected, actual); }