summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2016-09-05 10:55:51 -0700
committerRuss Allbery <eagle@eyrie.org>2016-09-05 11:00:25 -0700
commit33455f7c50776a74cd53bdf4ec18c86c4a34b80b (patch)
tree6f76a25641e152d7b08b2705618ad3c3b65fe4fb /tests
parent9b50f691d78e9dec9683bbaad83bdf27f483915c (diff)
Coding style fixes for summary fix
Clean up some long lines, trailing whitespace, and added blank lines, and clean up some comments.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/data/cmd-help2
-rw-r--r--tests/data/conf-simple.in6
-rw-r--r--tests/server/summary-t.c5
3 files changed, 8 insertions, 5 deletions
diff --git a/tests/data/cmd-help b/tests/data/cmd-help
index e3f9eae..6a4d691 100755
--- a/tests/data/cmd-help
+++ b/tests/data/cmd-help
@@ -5,7 +5,7 @@ help)
subhelp) echo "subhelp text" ;;
*) echo "help text" ;;
esac ;;
-summary)
+summary)
case "$2" in
subcommand) echo "subcommand summary" ;;
*) echo "summary text" ;;
diff --git a/tests/data/conf-simple.in b/tests/data/conf-simple.in
index 036998f..330b679 100644
--- a/tests/data/conf-simple.in
+++ b/tests/data/conf-simple.in
@@ -15,14 +15,14 @@ test sigpipe @abs_top_builddir@/tests/data/cmd-sigpipe ANYUSER
test-summary ALL @abs_top_srcdir@/tests/data/cmd-help \
summary=summary \
help=help ANYUSER
-test-summary-with-subcommand subcommand @abs_top_srcdir@/tests/data/cmd-help \
- summary=summary \
- help=help ANYUSER
+test-subcommand-summary subcommand @abs_top_srcdir@/tests/data/cmd-help \
+ summary=summary
empty EMPTY @abs_top_srcdir@/tests/data/cmd-argv ANYUSER
sudo foo /some/program stdin=3 sudo=testuser ANYUSER
all ALL @abs_top_srcdir@/tests/data/cmd-hello ANYUSER
ALL bar @abs_top_srcdir@/tests/data/cmd-hello ANYUSER
+# Copyright 2016 Russ Allbery <eagle@eyrie.org>
# Copyright 2016 Dropbox, Inc.
# Copyright 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
diff --git a/tests/server/summary-t.c b/tests/server/summary-t.c
index 05e8215..5a075a8 100644
--- a/tests/server/summary-t.c
+++ b/tests/server/summary-t.c
@@ -2,6 +2,7 @@
* Test suite for the server using the summary command.
*
* Written by Jon Robertson <jonrober@stanford.edu>
+ * Copyright 2016 Russ Allbery <eagle@eyrie.org>
* Copyright 2012, 2013, 2014
* The Board of Trustees of the Leland Stanford Junior University
*
@@ -25,6 +26,7 @@ main(void)
struct kerberos_config *config;
struct remctl_result *result;
struct process *remctld;
+ const char *expected;
const char *test[] = { "help", NULL };
/* Unless we have Kerberos available, we can't really do anything. */
@@ -44,7 +46,8 @@ main(void)
if (result->stdout_buf == NULL)
ok(0, "...and correct data");
else {
- ok(memcmp("summary text\nsubcommand summary\n", result->stdout_buf, 32) == 0,
+ expected = "summary text\nsubcommand summary\n";
+ ok(memcmp(expected, result->stdout_buf, 32) == 0,
"...and correct data");
}
is_string(NULL, result->error, "...and no error");