2003-09-14 Marcus Brinkmann <marcus@g10code.de>
[gpgme.git] / tests / gpg / t-genkey.c
index 40aa303..52bb99f 100644 (file)
 
 #include <gpgme.h>
 
-#define fail_if_err(err)                                       \
-  do                                                           \
-    {                                                          \
-      if (err)                                                 \
-        {                                                      \
-          fprintf (stderr, "%s:%d: gpgme_error_t %s\n",                \
-                   __FILE__, __LINE__, gpgme_strerror (err));   \
-          exit (1);                                            \
-        }                                                      \
-    }                                                          \
-  while (0)
+#include "t-support.h"
 
+\f
 /* True if progress function printed something on the screen.  */
-int progress_called;
+static int progress_called;
 
 static void
 progress (void *self, const char *what, int type, int current, int total)
@@ -77,6 +68,8 @@ main (int argc, char **argv)
     "</GnupgKeyParms>\n";
   gpgme_genkey_result_t result;
 
+  init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
   err = gpgme_new (&ctx);
   fail_if_err (err);