updated
authorJeffrey Stedfast <fejj@src.gnome.org>
Fri, 1 Aug 2003 19:30:50 +0000 (19:30 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Fri, 1 Aug 2003 19:30:50 +0000 (19:30 +0000)
camel/tests/smime/pgp-mime.c
camel/tests/smime/pgp.c

index 578baac..566ab66 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/wait.h>
 #include <camel/camel-gpg-context.h>
 #include <camel/camel-multipart-signed.h>
 #include <camel/camel-multipart-encrypted.h>
@@ -139,7 +140,11 @@ int main (int argc, char **argv)
        setenv ("GNUPGHOME", "/tmp/camel-test/.gnupg", 1);
        
        /* import the gpg keys */
-       system ("gpg > /dev/null 2>&1"); /* creates gpg directory and stuff */
+       if ((ret = system ("gpg > /dev/null 2>&1")) == -1)
+               return 77;
+       else if (WEXITSTATUS (ret) == 127)
+               return 127;
+       
        system ("gpg --import camel-test.gpg.pub > /dev/null 2>&1");
        system ("gpg --import camel-test.gpg.sec > /dev/null 2>&1");
        
index 98f708a..78d4039 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/wait.h>
 #include <camel/camel-gpg-context.h>
 #include <camel/camel-stream-mem.h>
 
@@ -122,6 +123,7 @@ int main (int argc, char **argv)
        GPtrArray *recipients;
        GByteArray *buf;
        char *before, *after;
+       int ret;
        
        camel_test_init (argc, argv);
        
@@ -131,7 +133,11 @@ int main (int argc, char **argv)
        setenv ("GNUPGHOME", "/tmp/camel-test/.gnupg", 1);
        
        /* import the gpg keys */
-       system ("gpg > /dev/null 2>&1"); /* creates gpg directory and stuff */
+       if ((ret = system ("gpgfoo > /dev/null 2>&1")) == -1)
+               return 77;
+       else if (WEXITSTATUS (ret) == 127)
+               return 77;
+       
        system ("gpg --import ../data/camel-test.gpg.pub > /dev/null 2>&1");
        system ("gpg --import ../data/camel-test.gpg.sec > /dev/null 2>&1");