Fix last changes.
authorMarcus Brinkmann <mb@g10code.com>
Tue, 27 May 2003 08:31:33 +0000 (08:31 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Tue, 27 May 2003 08:31:33 +0000 (08:31 +0000)
trunk/tests/ChangeLog
trunk/tests/gpg/Makefile.am
trunk/tests/gpg/t-edit.c
trunk/tests/gpg/t-import.c

index 98686fd481a3ae7d6757b39c4fe53e5d8b3f71e7..883ec7fa138b4c31b7614c6fbce779acbf408421 100644 (file)
@@ -2,8 +2,7 @@
 
        * gpg/Makefile.am (TESTS): Order t-keylist and t-keylist-sig after
        t-import.
-       * gpg/t-edit.c (edit_fnc): Work around gpg 1.2.2 bug by resetting
-       primary uid after setting expiration date.
+       * gpg/t-edit.c (edit_fnc): Fix primary UID for keylisting tests.
        * gpg/t-keylist.c: Change order of user IDs.
        * gpg/t-keylist-sig.c: Likewise.
        * gpg/t-import.c: Add support for gpg in CVS.
index 11ab0b03e2a9a841d33c29b14c555dbfc9b33e54..370778c358aa7ad2f9c6fafb6b6a36d1a1d164fd 100644 (file)
@@ -23,7 +23,7 @@ GPG = @GPG@
 
 TESTS_ENVIRONMENT = GNUPGHOME=. GPG_AGENT_INFO=
 
-# The keylist test must come after the import test.
+# The keylist tests must come after the import and the edit test.
 TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers        \
        t-decrypt t-verify t-decrypt-verify \
        t-export t-import t-trustlist t-eventloop t-edit \
index fb2f62feab6ee52aca588fdcbeac3cb459b2d74a..9238503eea8b0495ee595cb5cef5d49b155a07a4 100644 (file)
@@ -93,9 +93,8 @@ edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, int fd)
              result = "expire";
              break;
 
-             /* Work around a bug in GPG 1.2.2, which causes the
-                primary UID to change when setting the expiration
-                date.  */
+             /* This fixes the primary user ID so the keylisting
+                tests will have predictable output.  */
            case 2:
              result = "1";
              break;
index bea6a0d984f1bd99dc5865f9c380f3e0a8dd4d84..fd275080cf1ec28d1472d097a5ac092333c92ef1 100644 (file)
@@ -107,7 +107,7 @@ check_result (gpgme_import_result_t result, char *fpr, int secret)
     }
   if ((secret
        && ((result->secret_imported == 0 && result->new_signatures != 0)
-          || (result->secret_imported == 1 && result->new_signatures != 1)))
+          || (result->secret_imported == 1 && result->new_signatures > 1)))
       || (!secret && result->new_signatures != 0))
     {
       fprintf (stderr, "Unexpected number of new signatures %i\n",
@@ -199,8 +199,8 @@ check_result (gpgme_import_result_t result, char *fpr, int secret)
        {
          if (result->imports->status
              != (GPGME_IMPORT_SECRET | GPGME_IMPORT_NEW)
-             || !result->imports->next
-             || result->imports->next->status != GPGME_IMPORT_SIG)
+             || (result->imports->next
+                 && result->imports->next->status != GPGME_IMPORT_SIG))
            {
              fprintf (stderr, "Unexpected status %i\n",
                       result->imports->status);