From 268f3e4fcbeed5c44f2a2f2ac1983b7a15bc9d94 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 15 Apr 2000 00:57:18 +0000 Subject: 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 --- ChangeLog | 9 +++++++++ tests/.cvsignore | 1 + tests/Makefile.am | 11 ++++++++++- tests/test12.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 tests/test12.c diff --git a/ChangeLog b/ChangeLog index 1e79835e38..729adedab4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-04-14 Chris Toshok + + * tests/.cvsignore: add test12 + + * tests/test12.c (main): add test for nntp stuff. + + * tests/Makefile.am (noinst_PROGRAMS): same. + + 2000-04-14 Christopher James Lahey * addressbook/backend/ebook/e-card.c, diff --git a/tests/.cvsignore b/tests/.cvsignore index f038884486..4d8b909c05 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -9,6 +9,7 @@ test8 test9 test10 test11 +test12 Makefile.in Makefile .deps diff --git a/tests/Makefile.am b/tests/Makefile.am index 7f4e7044e8..934c9f37a1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,8 @@ INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir) -I$(top_srcdir)/camel \ -I$(includedir) -I$(top_srcdir)/camel/providers/pop3 \ - -I$(top_srcdir)/camel/providers/mbox + -I$(top_srcdir)/camel/providers/mbox -I$(top_srcdir)/camel/providers/nntp + LDADD = \ $(top_builddir)/camel/libcamel.la \ $(top_builddir)/libibex/libibex.la \ @@ -31,6 +32,13 @@ test9_LDADD = \ $(GNOME_LIBDIR) \ $(GNOMEUI_LIBS) $(INTLLIBS) $(EXTRA_GNOME_LIBS) +test12_LDADD = \ + $(top_builddir)/camel/libcamel.la \ + $(top_builddir)/camel/providers/nntp/libcamelnntp.la \ + $(top_builddir)/libibex/libibex.la \ + $(GNOME_LIBDIR) \ + $(GNOMEUI_LIBS) $(INTLLIBS) $(EXTRA_GNOME_LIBS) + test_movemail_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/camel/libcamel.la \ @@ -53,6 +61,7 @@ noinst_PROGRAMS = \ test9 \ test10 \ test11 \ + test12 \ test-movemail \ $(THREAD_RELATED_TESTS) 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 + +#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); +} -- cgit v1.2.3