From: Marcus Brinkmann Date: Sun, 14 Sep 2003 01:05:06 +0000 (+0000) Subject: Include "t-support.h". X-Git-Tag: gpgme-1.2.0@1385~535 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a0f8f0982825d46726d3e2656eabad68b51ccb9e;p=gpgme.git Include "t-support.h". --- diff --git a/trunk/tests/gpgsm/t-import.c b/trunk/tests/gpgsm/t-import.c index c9c31ff..4338156 100644 --- a/trunk/tests/gpgsm/t-import.c +++ b/trunk/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/trunk/tests/gpgsm/t-keylist.c b/trunk/tests/gpgsm/t-keylist.c index b0249d1..cf4073f 100644 --- a/trunk/tests/gpgsm/t-keylist.c +++ b/trunk/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/trunk/tests/gpgsm/t-verify.c b/trunk/tests/gpgsm/t-verify.c index c8913a9..304fc2c 100644 --- a/trunk/tests/gpgsm/t-verify.c +++ b/trunk/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";