diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-08-20 04:14:15 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-08-20 04:14:15 +0800 |
commit | 5fb3a28aba18266a1cfc3759e6fc271a86531cb8 (patch) | |
tree | e39511d1d99ab08b529ea61f43df690b1f3b0b2a /camel/tests/smime/pgp.c | |
parent | 520d7194c4837f288733b29fa69f9cdde524fe38 (diff) | |
download | gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.gz gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.zst gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.zip |
Updated to pass the needed arguments to camel_init() and to init gthreads
2002-08-19 Jeffrey Stedfast <fejj@ximian.com>
* tests/lib/camel-test.c (camel_test_init): Updated to pass the
needed arguments to camel_init() and to init gthreads before camel
(since camel expectes it to be initialised already).
* tests/lib/session.c: #include <config.h> needed for
ENABLE_THREADS so that sizeof (CamelSessionClass) gives the
correct size.
* tests/*: Updated to work with camel API changes.
svn path=/trunk/; revision=17805
Diffstat (limited to 'camel/tests/smime/pgp.c')
-rw-r--r-- | camel/tests/smime/pgp.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/camel/tests/smime/pgp.c b/camel/tests/smime/pgp.c index 2d5ff7228c..3b422d222b 100644 --- a/camel/tests/smime/pgp.c +++ b/camel/tests/smime/pgp.c @@ -3,7 +3,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <camel/camel-pgp-context.h> +#include <camel/camel-gpg-context.h> #include <camel/camel-stream-mem.h> #include "camel-test.h" @@ -89,7 +89,7 @@ camel_pgp_session_new (const char *path) int main (int argc, char **argv) { CamelSession *session; - CamelPgpContext *ctx; + CamelCipherContext *ctx; CamelException *ex; CamelCipherValidity *valid; CamelStream *stream1, *stream2, *stream3; @@ -106,7 +106,8 @@ int main (int argc, char **argv) session = camel_pgp_session_new ("/tmp/camel-test"); - ctx = camel_pgp_context_new (session, CAMEL_PGP_TYPE_GPG, "/usr/bin/gpg", FALSE); + ctx = camel_gpg_context_new (session, "/usr/bin/gpg"); + camel_gpg_context_set_always_trust (CAMEL_GPG_CONTEXT (ctx), TRUE); camel_test_start ("Test of PGP functions"); @@ -117,8 +118,8 @@ int main (int argc, char **argv) stream2 = camel_stream_mem_new (); camel_test_push ("PGP signing"); - camel_pgp_sign (ctx, "pgp-mime@xtorshun.org", CAMEL_CIPHER_HASH_SHA1, - stream1, stream2, ex); + camel_cipher_sign (ctx, "pgp-mime@xtorshun.org", CAMEL_CIPHER_HASH_SHA1, + stream1, stream2, ex); check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex)); camel_test_pull (); @@ -127,7 +128,7 @@ int main (int argc, char **argv) camel_test_push ("PGP verify"); camel_stream_reset (stream1); camel_stream_reset (stream2); - valid = camel_pgp_verify (ctx, stream1, stream2, ex); + valid = camel_cipher_verify (ctx, CAMEL_CIPHER_HASH_SHA1, stream1, stream2, ex); check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex)); check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid)); camel_cipher_validity_free (valid); @@ -148,8 +149,8 @@ int main (int argc, char **argv) camel_test_push ("PGP encrypt"); recipients = g_ptr_array_new (); g_ptr_array_add (recipients, "pgp-mime@xtorshun.org"); - camel_pgp_encrypt (ctx, FALSE, "pgp-mime@xtorshun.org", recipients, - stream1, stream2, ex); + camel_cipher_encrypt (ctx, FALSE, "pgp-mime@xtorshun.org", recipients, + stream1, stream2, ex); check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex)); g_ptr_array_free (recipients, TRUE); camel_test_pull (); @@ -158,7 +159,7 @@ int main (int argc, char **argv) camel_exception_clear (ex); camel_test_push ("PGP decrypt"); - camel_pgp_decrypt (ctx, stream2, stream3, ex); + camel_cipher_decrypt (ctx, stream2, stream3, ex); check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex)); buf = CAMEL_STREAM_MEM (stream1)->buffer; before = g_strndup (buf->data, buf->len); |