aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpg/t-support.h
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2003-09-14 00:30:53 +0000
committerMarcus Brinkmann <[email protected]>2003-09-14 00:30:53 +0000
commitf8867f27074b9371e5be8376360d75e97c2bbdd2 (patch)
tree7c6114486bff2460cf0f0f19d5133d882854e2d4 /tests/gpg/t-support.h
parent2003-09-14 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-f8867f27074b9371e5be8376360d75e97c2bbdd2.tar.gz
gpgme-f8867f27074b9371e5be8376360d75e97c2bbdd2.zip
2003-09-14 Marcus Brinkmann <[email protected]>
* gpg/t-import.c (main): Likewise. * gpg/t-keylist-sig.c (main): Likewise. * gpg/t-keylist.c (main): Likewise. * gpg/t-sign.c (main): Likewise. * gpg/t-signers.c (main): Likewise. * gpg/t-trustlist.c (main): Likewise. * gpgsm/t-support.h: Include <stdlib.h> and <locale.h>. (init_gpgme): New function. * gpg/t-support.h: Likewise. * gpgsm/t-verify.c (main): Call init_gpgme. * gpgsm/t-decrypt.c (main): Likewise. * gpgsm/t-encrypt.c (main): Likewise. * gpgsm/t-export.c (main): Likewise. * gpgsm/t-genkey.c (main): Likewise. * gpgsm/t-import.c (main): Likewise. * gpgsm/t-keylist.c (main): Likewise. * gpgsm/t-sign.c (main): Likewise. * gpg/t-verify.c (main): Call init_gpgme. * gpg/t-decrypt-verify.c (main): Likewise. * gpg/t-decrypt.c (main): Likewise. * gpg/t-edit.c (main): Likewise. * gpg/t-encrypt-sign.c (main): Likewise. * gpg/t-encrypt-sym.c (main): Likewise. * gpg/t-encrypt.c (main): Likewise. * gpg/t-eventloop.c (main): Likewise. * gpg/t-export.c (main): Likewise. * gpg/t-genkey.c (main): Likewise.
Diffstat (limited to 'tests/gpg/t-support.h')
-rw-r--r--tests/gpg/t-support.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/gpg/t-support.h b/tests/gpg/t-support.h
index e9ea283d..929a5d13 100644
--- a/tests/gpg/t-support.h
+++ b/tests/gpg/t-support.h
@@ -20,6 +20,8 @@
#include <unistd.h>
#include <errno.h>
+#include <stdlib.h>
+#include <locale.h>
#include <gpgme.h>
@@ -79,3 +81,18 @@ make_filename (const char *fname)
strcat (buf, fname);
return buf;
}
+
+
+void
+init_gpgme (gpgme_protocol_t proto)
+{
+ gpgme_error_t err;
+
+ gpgme_check_version (NULL);
+ setlocale (LC_ALL, "");
+ gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
+ gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
+
+ err = gpgme_engine_check_version (proto);
+ fail_if_err (err);
+}