From 38a0357afbd1a005efce142a2aacb77d485e55b7 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 14 Sep 2003 01:05:06 +0000 Subject: [PATCH] Include "t-support.h". --- tests/gpgsm/t-import.c | 35 +---------------------------------- tests/gpgsm/t-keylist.c | 16 +++------------- tests/gpgsm/t-verify.c | 13 +------------ 3 files changed, 5 insertions(+), 59 deletions(-) diff --git a/tests/gpgsm/t-import.c b/tests/gpgsm/t-import.c index c9c31ff..4338156 100644 --- a/tests/gpgsm/t-import.c +++ b/tests/gpgsm/t-import.c @@ -25,40 +25,7 @@ #include - -#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 diff --git a/tests/gpgsm/t-keylist.c b/tests/gpgsm/t-keylist.c index b0249d1..cf4073f 100644 --- a/tests/gpgsm/t-keylist.c +++ b/tests/gpgsm/t-keylist.c @@ -24,20 +24,9 @@ #include - -#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" + struct { char *fpr; @@ -73,6 +62,7 @@ keys[] = { NULL } }; + int main (int argc, char **argv) { diff --git a/tests/gpgsm/t-verify.c b/tests/gpgsm/t-verify.c index c8913a9..304fc2c 100644 --- a/tests/gpgsm/t-verify.c +++ b/tests/gpgsm/t-verify.c @@ -24,18 +24,7 @@ #include - -#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" static const char test_text1[] = "Hallo Leute!\n"; -- 2.26.2