diff options
Diffstat (limited to '')
-rw-r--r-- | tests/run-export.c | 18 | ||||
-rw-r--r-- | tests/run-import.c | 18 | ||||
-rw-r--r-- | tests/run-keylist.c | 20 | ||||
-rw-r--r-- | tests/run-sign.c | 22 | ||||
-rw-r--r-- | tests/run-support.h | 10 | ||||
-rw-r--r-- | tests/run-verify.c | 22 | ||||
-rw-r--r-- | tests/t-data.c | 6 | ||||
-rw-r--r-- | tests/t-engine-info.c | 8 | ||||
-rw-r--r-- | tests/t-version.c | 6 |
9 files changed, 65 insertions, 65 deletions
diff --git a/tests/run-export.c b/tests/run-export.c index b70ed91c..43332087 100644 --- a/tests/run-export.c +++ b/tests/run-export.c @@ -2,17 +2,17 @@ Copyright (C) 2008, 2009 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -48,7 +48,7 @@ show_usage (int ex) exit (ex); } -int +int main (int argc, char **argv) { int last_argc = -1; @@ -86,9 +86,9 @@ main (int argc, char **argv) } else if (!strncmp (*argv, "--", 2)) show_usage (1); - - } - + + } + if (!argc) show_usage (1); @@ -101,7 +101,7 @@ main (int argc, char **argv) /* Lookup the keys. */ err = gpgme_op_keylist_ext_start (ctx, (const char**)argv, 0, 0); fail_if_err (err); - + while (!(err = gpgme_op_keylist_next (ctx, &key))) { printf ("keyid: %s (fpr: %s)\n", @@ -138,7 +138,7 @@ main (int argc, char **argv) fail_if_err (err); gpgme_set_armor (ctx, 1); - err = gpgme_op_export_keys (ctx, keyarray, mode, + err = gpgme_op_export_keys (ctx, keyarray, mode, (mode & GPGME_KEYLIST_MODE_EXTERN)? NULL:out); fail_if_err (err); diff --git a/tests/run-import.c b/tests/run-import.c index cd101b01..9225f610 100644 --- a/tests/run-import.c +++ b/tests/run-import.c @@ -2,17 +2,17 @@ Copyright (C) 2008, 2009 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -49,7 +49,7 @@ show_usage (int ex) exit (ex); } -int +int main (int argc, char **argv) { int last_argc = -1; @@ -89,9 +89,9 @@ main (int argc, char **argv) } else if (!strncmp (*argv, "--", 2)) show_usage (1); - - } - + + } + if (!argc) show_usage (1); @@ -110,7 +110,7 @@ main (int argc, char **argv) if (url_mode) gpgme_data_set_encoding (data, (nul_mode? GPGME_DATA_ENCODING_URL0 : GPGME_DATA_ENCODING_URL)); - + err = gpgme_op_import (ctx, data); fail_if_err (err); impres = gpgme_op_import_result (ctx); @@ -120,7 +120,7 @@ main (int argc, char **argv) exit (1); } print_import_result (impres); - + gpgme_data_release (data); } diff --git a/tests/run-keylist.c b/tests/run-keylist.c index 0f2154a8..c0c72022 100644 --- a/tests/run-keylist.c +++ b/tests/run-keylist.c @@ -2,17 +2,17 @@ Copyright (C) 2008, 2009 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -57,7 +57,7 @@ show_usage (int ex) } -int +int main (int argc, char **argv) { int last_argc = -1; @@ -136,9 +136,9 @@ main (int argc, char **argv) } else if (!strncmp (*argv, "--", 2)) show_usage (1); - - } - + + } + if (argc > 1) show_usage (1); @@ -152,12 +152,12 @@ main (int argc, char **argv) err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, 0); fail_if_err (err); - + while (!(err = gpgme_op_keylist_next (ctx, &key))) { gpgme_user_id_t uid; int nuids; - + printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?"); printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?"); @@ -176,7 +176,7 @@ main (int argc, char **argv) for (nuids=0, uid=key->uids; uid; uid = uid->next, nuids++) { printf ("userid %d: %s\n", nuids, nonnull(uid->uid)); - printf ("valid %d: %s\n", nuids, + printf ("valid %d: %s\n", nuids, uid->validity == GPGME_VALIDITY_UNKNOWN? "unknown": uid->validity == GPGME_VALIDITY_UNDEFINED? "undefined": uid->validity == GPGME_VALIDITY_NEVER? "never": diff --git a/tests/run-sign.c b/tests/run-sign.c index b16b9ef5..e1498ea8 100644 --- a/tests/run-sign.c +++ b/tests/run-sign.c @@ -2,17 +2,17 @@ Copyright (C) 2009 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -44,10 +44,10 @@ print_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) gpgme_new_signature_t sig; for (invkey = result->invalid_signers; invkey; invkey = invkey->next) - printf ("Signing key `%s' not used: %s <%s>\n", - nonnull (invkey->fpr), + printf ("Signing key `%s' not used: %s <%s>\n", + nonnull (invkey->fpr), gpg_strerror (invkey->reason), gpg_strsource (invkey->reason)); - + for (sig = result->signatures; sig; sig = sig->next) { printf ("Key fingerprint: %s\n", nonnull (sig->fpr)); @@ -76,7 +76,7 @@ show_usage (int ex) } -int +int main (int argc, char **argv) { int last_argc = -1; @@ -131,9 +131,9 @@ main (int argc, char **argv) } else if (!strncmp (*argv, "--", 2)) show_usage (1); - - } - + + } + if (argc != 1) show_usage (1); @@ -153,7 +153,7 @@ main (int argc, char **argv) if (key_string) { gpgme_key_t akey; - + err = gpgme_get_key (ctx, key_string, &akey, 1); if (err) { diff --git a/tests/run-support.h b/tests/run-support.h index db7b7d5a..b1aea4be 100644 --- a/tests/run-support.h +++ b/tests/run-support.h @@ -3,17 +3,17 @@ Copyright (C) 2001, 2002, 2003, 2004, 2009 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -60,7 +60,7 @@ print_data (gpgme_data_t dh) #define BUF_SIZE 512 char buf[BUF_SIZE + 1]; int ret; - + ret = gpgme_data_seek (dh, 0, SEEK_SET); if (ret) fail_if_err (gpgme_err_code_from_errno (errno)); @@ -108,7 +108,7 @@ make_filename (const char *fname) if (!srcdir) srcdir = "."; buf = malloc (strlen(srcdir) + strlen(fname) + 2); - if (!buf) + if (!buf) exit (8); strcpy (buf, srcdir); strcat (buf, "/"); diff --git a/tests/run-verify.c b/tests/run-verify.c index 4837d9c7..b49ea2ab 100644 --- a/tests/run-verify.c +++ b/tests/run-verify.c @@ -2,17 +2,17 @@ Copyright (C) 2009 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -63,7 +63,7 @@ print_summary (gpgme_sigsum_t summary) fputs (" sys-error", stdout); } -static void +static void print_validity (gpgme_validity_t val) { const char *s = NULL; @@ -133,7 +133,7 @@ show_usage (int ex) } -int +int main (int argc, char **argv) { int last_argc = -1; @@ -176,17 +176,17 @@ main (int argc, char **argv) } else if (!strncmp (*argv, "--", 2)) show_usage (1); - - } - + + } + if (argc < 1 || argc > 2) show_usage (1); - + fp_sig = fopen (argv[0], "rb"); if (!fp_sig) { err = gpgme_error_from_syserror (); - fprintf (stderr, PGM ": can't open `%s': %s\n", + fprintf (stderr, PGM ": can't open `%s': %s\n", argv[0], gpgme_strerror (err)); exit (1); } @@ -196,7 +196,7 @@ main (int argc, char **argv) if (!fp_msg) { err = gpgme_error_from_syserror (); - fprintf (stderr, PGM ": can't open `%s': %s\n", + fprintf (stderr, PGM ": can't open `%s': %s\n", argv[1], gpgme_strerror (err)); exit (1); } diff --git a/tests/t-data.c b/tests/t-data.c index a319484f..888475fd 100644 --- a/tests/t-data.c +++ b/tests/t-data.c @@ -7,12 +7,12 @@ under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -190,7 +190,7 @@ write_test (round_t round, gpgme_data_t data) } } -int +int main (int argc, char **argv) { round_t round = TEST_INITIALIZER; diff --git a/tests/t-engine-info.c b/tests/t-engine-info.c index 3864fe5f..beb49923 100644 --- a/tests/t-engine-info.c +++ b/tests/t-engine-info.c @@ -2,17 +2,17 @@ Copyright (C) 2003, 2004, 2007 g10 Code GmbH This file is part of GPGME. - + GPGME is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -67,7 +67,7 @@ check_engine_info (gpgme_engine_info_t info, gpgme_protocol_t protocol, } -int +int main (int argc, char **argv ) { gpgme_engine_info_t info; diff --git a/tests/t-version.c b/tests/t-version.c index 06bff60a..97d55a9f 100644 --- a/tests/t-version.c +++ b/tests/t-version.c @@ -7,12 +7,12 @@ under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + GPGME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -26,7 +26,7 @@ #include <gpgme.h> -int +int main (int argc, char **argv) { const char *null_result; |