aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test12.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2000-04-15 08:57:18 +0800
committerChris Toshok <toshok@src.gnome.org>2000-04-15 08:57:18 +0800
commit268f3e4fcbeed5c44f2a2f2ac1983b7a15bc9d94 (patch)
tree2f2b2bc17146c03a8ef56971c2f05bc494a97728 /tests/test12.c
parent566b5183cbc2a52960c4411a74037c5559844bc2 (diff)
downloadgsoc2013-evolution-268f3e4fcbeed5c44f2a2f2ac1983b7a15bc9d94.tar.gz
gsoc2013-evolution-268f3e4fcbeed5c44f2a2f2ac1983b7a15bc9d94.tar.zst
gsoc2013-evolution-268f3e4fcbeed5c44f2a2f2ac1983b7a15bc9d94.zip
add test12
* tests/.cvsignore: add test12 * tests/test12.c (main): add test for nntp stuff. * tests/Makefile.am (noinst_PROGRAMS): same. svn path=/trunk/; revision=2446
Diffstat (limited to 'tests/test12.c')
-rw-r--r--tests/test12.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/test12.c b/tests/test12.c
new file mode 100644
index 0000000000..223eb980a8
--- /dev/null
+++ b/tests/test12.c
@@ -0,0 +1,56 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+#include <stdio.h>
+
+#include "camel.h"
+#include "camel-nntp-store.h"
+#include "camel-session.h"
+#include "camel-exception.h"
+
+static char*
+authenticator (char *prompt, gboolean secret, CamelService *service, char *item,
+ CamelException *ex)
+{
+}
+
+static void
+print_name(gpointer data, gpointer foo)
+{
+ printf ("%s\n", (char*)data);
+}
+
+int
+main (int argc, char **argv)
+{
+ CamelSession *session;
+ CamelException *ex;
+ CamelStore *store;
+ CamelFolder *n_p_m_a;
+ GList *groups;
+ const gchar *news_url = "news://news.mozilla.org";
+
+ gtk_init (&argc, &argv);
+ camel_init ();
+ ex = camel_exception_new ();
+
+ g_assert (camel_provider_register_as_module ("/usr/local/lib/evolution/camel-providers/0.0.1/libcamelnntp.so"));
+
+ session = camel_session_new (authenticator);
+ store = camel_session_get_store (session, news_url, ex);
+
+ g_assert (store);
+
+ camel_nntp_store_subscribe_group (store, "netscape.public.mozilla.announce");
+
+ printf ("subscribed groups on %s\n", news_url);
+
+ groups = camel_nntp_store_list_subscribed_groups (store);
+
+ g_list_foreach(groups, print_name, NULL);
+
+ n_p_m_a = camel_store_get_folder (store, "netscape.public.mozilla.announce", ex);
+
+ camel_folder_open(n_p_m_a, FOLDER_OPEN_READ, ex);
+
+ camel_folder_close(n_p_m_a, FALSE, ex);
+}