aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpg/t-support.h
diff options
context:
space:
mode:
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);
+}