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 c9c31ffd0b7e4372c990f3515a3600f45e020b41..433815691185ea1f96767c262dbbf111407c863d 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 b0249d1232f07fb6105f6b53ad30eafcd63306a4..cf4073fccc88a8479569feca63a8769e8f5995a6 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 c8913a91ef6ade4da80336a295c9aef27420646e..304fc2c6cb1e9743d332d3741d5ba1379d729135 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";