diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 8 | ||||
-rw-r--r-- | tests/gpg/Makefile.am | 16 | ||||
-rw-r--r-- | tests/gpg/t-support.h | 10 | ||||
-rw-r--r-- | tests/gpg/t-wait.c | 6 | ||||
-rw-r--r-- | tests/t-engine-info.c | 6 |
5 files changed, 37 insertions, 9 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 9e115e49..f57a4476 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2007-09-27 Marcus Brinkmann <[email protected]> + + * t-engine-info.c (check_engine_info): Fix debug output. + * gpg/Makefile.am (tests_unix): New variable. + (TESTS): Use it. + * gpg/t-support.h (passphrase_cb) [HAVE_W32_SYSTEM]: Use WriteFile instead of write. + * gpg/t-wait.c [HAVE_W32_SYSTEM]: Define sleep as _sleep. + 2007-09-14 Marcus Brinkmann <[email protected]> * gpgsm/t-verify.c (main): Release TEXT and SIG. diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index 023d2aaa..e5d9de9b 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -25,11 +25,17 @@ TESTS_ENVIRONMENT = GNUPGHOME=. GPG_AGENT_INFO= # The keylist tests must come after the import and the edit test. noinst_HEADERS = t-support.h -TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \ - t-decrypt t-verify t-decrypt-verify t-sig-notation \ - t-export t-import t-trustlist t-eventloop t-edit \ - t-keylist t-keylist-sig t-thread1 t-wait t-encrypt-large \ - t-file-name + +if HAVE_W32_SYSTEM +tests_unix = +else +tests_unix = t-eventloop t-thread1 +endif + +TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \ + t-decrypt t-verify t-decrypt-verify t-sig-notation t-export \ + t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait \ + t-encrypt-large t-file-name $(tests_unix) CLEANFILES = secring.gpg pubring.gpg trustdb.gpg DISTCLEANFILES = pubring.gpg~ random_seed gpg.conf diff --git a/tests/gpg/t-support.h b/tests/gpg/t-support.h index 0ed1ac84..362b857a 100644 --- a/tests/gpg/t-support.h +++ b/tests/gpg/t-support.h @@ -24,6 +24,10 @@ #include <stdlib.h> #include <locale.h> +#ifdef HAVE_W32_SYSTEM +#include <windows.h> +#endif + #include <gpgme.h> #ifndef DIM @@ -65,7 +69,13 @@ gpgme_error_t passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, int last_was_bad, int fd) { +#ifdef HAVE_W32_SYSTEM + DWORD written; + WriteFile ((HANDLE) fd, "abc\n", 4, &written, 0); +#else write (fd, "abc\n", 4); +#endif + return 0; } diff --git a/tests/gpg/t-wait.c b/tests/gpg/t-wait.c index c12835d7..eec4d96d 100644 --- a/tests/gpg/t-wait.c +++ b/tests/gpg/t-wait.c @@ -1,6 +1,6 @@ /* t-wait.c - Regression test. Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH This file is part of GPGME. @@ -29,6 +29,10 @@ #include <stdio.h> #include <string.h> +#ifdef HAVE_W32_SYSTEM +#define sleep _sleep +#endif + #include <gpgme.h> #include "t-support.h" diff --git a/tests/t-engine-info.c b/tests/t-engine-info.c index 4af2d4a3..3864fe5f 100644 --- a/tests/t-engine-info.c +++ b/tests/t-engine-info.c @@ -1,5 +1,5 @@ /* t-engine-info.c - Regression test for gpgme_get_engine_info. - Copyright (C) 2003, 2004 g10 Code GmbH + Copyright (C) 2003, 2004, 2007 g10 Code GmbH This file is part of GPGME. @@ -54,13 +54,13 @@ check_engine_info (gpgme_engine_info_t info, gpgme_protocol_t protocol, } if (strcmp (info->file_name, file_name)) { - fprintf (stderr, "Unexpected file name to executable %s (expected %s instead)", + fprintf (stderr, "Unexpected file name to executable %s (expected %s instead)\n", info->file_name, file_name); exit (1); } if (strcmp (info->req_version, req_version)) { - fprintf (stderr, "Unexpected required version %s (expected %s instead)", + fprintf (stderr, "Unexpected required version %s (expected %s instead)\n", info->req_version, req_version); exit (1); } |