Include "t-support.h".
authorMarcus Brinkmann <mb@g10code.com>
Sun, 14 Sep 2003 01:05:06 +0000 (01:05 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Sun, 14 Sep 2003 01:05:06 +0000 (01:05 +0000)
tests/gpgsm/t-import.c
tests/gpgsm/t-keylist.c
tests/gpgsm/t-verify.c

index c9c31ff..4338156 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)
-
-
-static char *
-make_filename (const char *fname)
-{
-  const char *srcdir = getenv ("srcdir");
-  char *buf;
-
-  if (!srcdir)
-    srcdir = ".";
-  buf = malloc (strlen(srcdir) + strlen(fname) + 2);
-  if (!buf)
-    {
-      fprintf (stderr, "%s:%d: could not allocate string: %s\n",
-              __FILE__, __LINE__, strerror (errno));
-      exit (1);
-    }
-  strcpy (buf, srcdir);
-  strcat (buf, "/");
-  strcat (buf, fname);
-  return buf;
-}
+#include "t-support.h"
 
 
 void
index b0249d1..cf4073f 100644 (file)
 
 #include <gpgme.h>
 
-\f
-#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
 struct
 {
   char *fpr;
@@ -73,6 +62,7 @@ keys[] =
     { NULL }
   };
 
+
 int 
 main (int argc, char **argv)
 {
index c8913a9..304fc2c 100644 (file)
 
 #include <gpgme.h>
 
-\f
-#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
 static const char test_text1[] = "Hallo Leute!\n";