From 802e46f8ea36c344f112d7e1dd8d64d17a4cc939 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:59:37 +0200 Subject: Run clang-format again --- lib/tests/test_cmd.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'lib/tests/test_cmd.c') diff --git a/lib/tests/test_cmd.c b/lib/tests/test_cmd.c index c8867dfb..ade0da90 100644 --- a/lib/tests/test_cmd.c +++ b/lib/tests/test_cmd.c @@ -67,7 +67,8 @@ int main(int argc, char **argv) { result = cmd_run_array(command_line, &chld_out, &chld_err, 0); ok(chld_out.lines == 1, "(array) Check for expected number of stdout lines"); ok(chld_err.lines == 0, "(array) Check for expected number of stderr lines"); - ok(strcmp(chld_out.line[0], "this is test one") == 0, "(array) Check for expected stdout output"); + ok(strcmp(chld_out.line[0], "this is test one") == 0, + "(array) Check for expected stdout output"); ok(result == 0, "(array) Checking exit code"); /* ensure everything is empty again */ @@ -82,7 +83,8 @@ int main(int argc, char **argv) { ok(chld_out.lines == 1, "(string) Check for expected number of stdout lines"); ok(chld_err.lines == 0, "(string) Check for expected number of stderr lines"); - ok(strcmp(chld_out.line[0], "this is test one") == 0, "(string) Check for expected stdout output"); + ok(strcmp(chld_out.line[0], "this is test one") == 0, + "(string) Check for expected stdout output"); ok(result == 0, "(string) Checking exit code"); diag("Running plain echo command, set two"); @@ -104,7 +106,8 @@ int main(int argc, char **argv) { result = cmd_run_array(command_line, &chld_out, &chld_err, 0); ok(chld_out.lines == 1, "(array) Check for expected number of stdout lines"); ok(chld_err.lines == 0, "(array) Check for expected number of stderr lines"); - ok(strcmp(chld_out.line[0], "this is test two") == 0, "(array) Check for expected stdout output"); + ok(strcmp(chld_out.line[0], "this is test two") == 0, + "(array) Check for expected stdout output"); ok(result == 0, "(array) Checking exit code"); /* ensure everything is empty again */ @@ -119,7 +122,8 @@ int main(int argc, char **argv) { ok(chld_out.lines == 1, "(string) Check for expected number of stdout lines"); ok(chld_err.lines == 0, "(string) Check for expected number of stderr lines"); - ok(strcmp(chld_out.line[0], "this is test one") == 0, "(string) Check for expected stdout output"); + ok(strcmp(chld_out.line[0], "this is test one") == 0, + "(string) Check for expected stdout output"); ok(result == 0, "(string) Checking exit code"); /* ensure everything is empty again */ @@ -130,7 +134,8 @@ int main(int argc, char **argv) { ok(chld_err.lines == 0, "(initialised) Checking stderr is reset"); ok(result == UNSET, "(initialised) Checking exit code is reset"); - /* Pass linefeeds via parameters through - those should be evaluated by echo to give multi line output */ + /* Pass linefeeds via parameters through - those should be evaluated by echo to give multi line + * output */ command_line[0] = strdup("/bin/echo"); command_line[1] = strdup("this is a test via echo\nline two\nit's line 3"); command_line[2] = strdup("and (note space between '3' and 'and') $$ will not get evaluated"); @@ -138,9 +143,12 @@ int main(int argc, char **argv) { result = cmd_run_array(command_line, &chld_out, &chld_err, 0); ok(chld_out.lines == 3, "(array) Check for expected number of stdout lines"); ok(chld_err.lines == 0, "(array) Check for expected number of stderr lines"); - ok(strcmp(chld_out.line[0], "this is a test via echo") == 0, "(array) Check line 1 for expected stdout output"); - ok(strcmp(chld_out.line[1], "line two") == 0, "(array) Check line 2 for expected stdout output"); - ok(strcmp(chld_out.line[2], "it's line 3 and (note space between '3' and 'and') $$ will not get evaluated") == 0, + ok(strcmp(chld_out.line[0], "this is a test via echo") == 0, + "(array) Check line 1 for expected stdout output"); + ok(strcmp(chld_out.line[1], "line two") == 0, + "(array) Check line 2 for expected stdout output"); + ok(strcmp(chld_out.line[2], + "it's line 3 and (note space between '3' and 'and') $$ will not get evaluated") == 0, "(array) Check line 3 for expected stdout output"); ok(result == 0, "(array) Checking exit code"); @@ -171,7 +179,8 @@ int main(int argc, char **argv) { ok(chld_out.lines == 0, "/bin/sh returns no stdout when file is missing..."); ok(chld_err.lines == 1, "...but does give an error line"); - ok(strstr(chld_err.line[0], "non-existent-file") != NULL, "And missing filename is in error message"); + ok(strstr(chld_err.line[0], "non-existent-file") != NULL, + "And missing filename is in error message"); ok(result != 0, "Get non-zero return code from /bin/sh"); /* ensure everything is empty again */ -- cgit v1.2.3-74-g34f1