aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-03-28 06:48:24 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-03-28 06:48:24 +0800
commit767c63615d6229c42ea90503f3888aebf38519ae (patch)
treee911f4ecce4fd1b9e96451f6f640d90ea192bea0 /tests
parent3ec585e1b510620a718d672ac682f2b467fe43c2 (diff)
downloadgsoc2013-evolution-767c63615d6229c42ea90503f3888aebf38519ae.tar.gz
gsoc2013-evolution-767c63615d6229c42ea90503f3888aebf38519ae.tar.zst
gsoc2013-evolution-767c63615d6229c42ea90503f3888aebf38519ae.zip
This test is basically now invalid.
2000-03-27 NotZed <NotZed@HelixCode.com> * tests/test9.c (main): This test is basically now invalid. * tests/test11.c (main): Fix for async search api. Probably works. Removed camel-mbox-*.h headers, should be private. svn path=/trunk/; revision=2200
Diffstat (limited to 'tests')
-rw-r--r--tests/test11.c94
-rw-r--r--tests/test9.c4
2 files changed, 57 insertions, 41 deletions
diff --git a/tests/test11.c b/tests/test11.c
index 443f49e788..387c9a6904 100644
--- a/tests/test11.c
+++ b/tests/test11.c
@@ -6,10 +6,6 @@
#include "camel.h"
-#include "camel-mbox-folder.h"
-#include "camel-mbox-parser.h"
-#include "camel-mbox-utils.h"
-#include "camel-mbox-summary.h"
#include "camel-log.h"
#include "camel-exception.h"
#include "camel-folder-summary.h"
@@ -31,6 +27,45 @@ auth_callback(char *prompt, gboolean secret,
return NULL;
}
+struct search_data {
+ CamelFolder *folder;
+ CamelFolder *outbox;
+ CamelException *ex;
+};
+
+static void
+search_cb(CamelFolder *folder, int id, gboolean complete, GList *matches, struct search_data *sd)
+{
+ GList *n;
+ printf("search found matches:\n");
+ n = matches;
+ while (n) {
+ CamelMimeMessage *m;
+
+ printf("uid: %s\n", (char *) n->data);
+ m = camel_folder_get_message_by_uid(sd->folder, n->data, sd->ex);
+
+ if (camel_exception_get_id (sd->ex)) {
+ printf ("Cannot get message\n"
+ "Full description : %s\n", camel_exception_get_description (sd->ex));
+ }
+
+ camel_folder_append_message(sd->outbox, m, sd->ex);
+
+ if (camel_exception_get_id (sd->ex)) {
+ printf ("Cannot save message\n"
+ "Full description : %s\n", camel_exception_get_description (sd->ex));
+ }
+
+ n = g_list_next(n);
+ }
+
+ if (complete) {
+ camel_folder_close (sd->folder, FALSE, sd->ex);
+ gtk_exit(0);
+ }
+}
+
int
main (int argc, char**argv)
{
@@ -43,12 +78,16 @@ main (int argc, char**argv)
GList *uid_list;
int camel_debug_level = 10;
GList *matches;
+ struct search_data *sd;
gtk_init (&argc, &argv);
camel_init ();
ex = camel_exception_new ();
camel_provider_register_as_module ("../camel/providers/mbox/.libs/libcamelmbox.so.0");
-
+
+ sd = g_malloc0(sizeof(*sd));
+ sd->ex = ex;
+
session = camel_session_new (auth_callback);
store = camel_session_get_store (session, store_url, ex);
if (camel_exception_get_id (ex)) {
@@ -83,45 +122,18 @@ main (int argc, char**argv)
camel_folder_open (outbox, FOLDER_OPEN_WRITE, ex);
- printf("Search for messages\n");
-
-#warning "track api change here"
- matches = camel_folder_search_by_expression (folder,
- "(match-all (header-contains \"subject\" \"gnome\"))",
- /* func */ NULL,
- /* data */ NULL,
- ex);
-
- if (matches) {
- GList *n;
- printf("search found matches:\n");
- n = matches;
- while (n) {
- CamelMimeMessage *m;
+ sd->folder = folder;
+ sd->outbox = outbox;
- printf("uid: %s\n", (char *) n->data);
- m = camel_folder_get_message_by_uid(folder, n->data, ex);
-
- if (camel_exception_get_id (ex)) {
- printf ("Cannot get message\n"
- "Full description : %s\n", camel_exception_get_description (ex));
- }
-
- camel_folder_append_message(outbox, m, ex);
-
- if (camel_exception_get_id (ex)) {
- printf ("Cannot save message\n"
- "Full description : %s\n", camel_exception_get_description (ex));
- }
+ printf("Search for messages\n");
- n = g_list_next(n);
- }
-
- } else {
- printf("no matches?\n");
- }
+ camel_folder_search_by_expression (folder,
+ "(match-all (header-contains \"subject\" \"gnome\"))",
+ search_cb,
+ sd,
+ ex);
- camel_folder_close (folder, FALSE, ex);
+ gtk_main();
return 0;
}
diff --git a/tests/test9.c b/tests/test9.c
index cb4cd9de61..febf0fed78 100644
--- a/tests/test9.c
+++ b/tests/test9.c
@@ -47,7 +47,11 @@ main (int argc, char**argv)
ex);
close (test_file_fd);
+#warning This test is no longer valid.
+#if 0
+ /* needs a folder to work with (indexing) */
camel_mbox_write_xev (argv[1], message_info_array, &mbox_file_size, 1, ex);
+#endif
if (camel_exception_get_id (ex)) {
printf ("Exception caught in camel_mbox_write_xev : %s\n", camel_exception_get_description (ex));
}
b29b3c938'>- Unregister the old UID/GID and register the new one in thekrion2004-05-216-8/+14 * BROKEN: Uses unregistered, out-of-range uidkris2004-05-212-0/+4 * clean up after various repocopieseik2004-05-185-74/+0 * - Fix MASTER_SITESkrion2004-05-172-2/+2 * Move port to better category:vs2004-05-121-1/+0 * Oops. Forgot the language categories.lofi2004-05-079-9/+12 * - remove obsolte ports of gd1 and realativesdinoex2004-05-0510-29031/+0 * - disconnect obsolete ports gd1 and relativesdinoex2004-05-051-1/+0 * - Fix WWW:krion2004-05-041-1/+1 * Update to KDE 3.2.2lofi2004-04-204-40/+22 * - Change maintainer's emailkrion2004-04-162-2/+2 * - Fix MASTER_SITESkrion2004-04-141-2/+1 * Fix LATEST_LINK conflictsmaho2004-04-121-0/+1 * Tidy up whitespace.trevor2004-04-111-2/+2 * Cram into 80 columns by 24 rows.trevor2004-04-111-8/+4 * Chase the glib20 update, and bump all affected ports' PORTREVISIONs.marcus2004-04-051-1/+1 * Remove category pkg/COMMENT files in favour of a COMMENT variable in thekris2004-04-022-1/+2 * SIZEify (maintainer timeout)trevor2004-03-3112-0/+16 * - mark DEPRECATEDdinoex2004-03-301-0/+3 * - use INSTALLS_SHLIBdinoex2004-03-302-5/+1 * Add size data, approved by maintainers.trevor2004-03-214-0/+6 * SIZEifyerwin2004-03-202-0/+2 * - extend CONFLICTSdinoex2004-03-192-1/+11 * Add size data.trevor2004-03-191-0/+1 * E-mail to the maintainer bounced:trevor2004-03-181-1/+1 * bump PORTREVISION for the netmask fixeik2004-03-121-0/+1 * Unbreak slave port by updating to the version 27.3 of the encoding patch.kan2004-03-112-6/+4 * Update to KDE 3.2.1 / QT 3.3.1lofi2004-03-109-4/+59 * Add patch for netmask problems on 64bit machines.lev2004-03-091-0/+113 * Add patch for netmask problems on 64bit machineslev2004-03-092-0/+114 * - Unbreak on alpha, sparc64 and other non-i386 platforms.fjoe2004-03-067-124/+137 * BROKEN on sparc64 as wellkris2004-03-051-2/+2 * - Mark BROKEN, doesn't build with multimedia/xmms version 1.2.10"krion2004-02-241-0/+2 * BROKEN: inconsistent dependencies (linux_base 7.x and 8.x)kris2004-02-171-0/+2 * Use PLIST_FILES (bento-tested, marcus-reviewed).trevor2004-02-068-4/+4 * Use PLIST_FILES.trevor2004-02-064-2/+2 * Update to KDE 3.2.0lofi2004-02-0515-123/+776 * - Unbreak ru-xmms [1].fjoe2004-02-042-1/+5 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-042-0/+2 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-043-1/+3 * Add USE_GETTEXT and bump PORTREVISION.marcus2004-02-045-10/+10 * - Mark BROKEN, does not build with multimedia/xmms version 1.2.9krion2004-02-011-0/+1 * - Fix typo.krion2004-01-311-1/+1 * - Fix plist and bump PORTREVISIONkrion2004-01-312-0/+15 * - SIZEifykrion2004-01-302-0/+4 * The linux-atk port was repo-copied into the accessibility category.trevor2004-01-301-1/+1 * SIZEify.trevor2004-01-304-0/+4 * Now gettext 0.12.1 is gettext-old.trevor2004-01-245-5/+5 * - Maintainer gave maintainership to Alexander Pohoyda (alexander.pohoyda@gmx....clement2004-01-231-1/+1 * Use the SORT macro from bsd.port.mk.trevor2004-01-221-1/+1 * Add mueller-dic 1.2,krion2004-01-176-0/+91 * New port: libcyrillic.demon2004-01-076-0/+78 * Update to version 0.99f7demon2004-01-022-2/+2 * - Fix REINPLACE_CMDkrion2003-12-192-2/+2 * Add ircd-hybrid-ru 7.1,krion2003-12-1526-0/+978 * Add conflicts on xmms-[0-9]*fjoe2003-12-081-0/+2 * New port: ru-xmmsfjoe2003-12-082-0/+19 * - Add WITH_MOTIF knob to enable pixmaps in indicator iconsergei2003-12-062-6/+26 * Update to version 1.3.29+30.19+2.8.16lev2003-11-214-33/+10 * Update to latest version 30.19+1.3.29lev2003-11-214-31/+8 * new Russian-language, i386 Linux binary port of Firebird Web browser,trevor2003-11-204-0/+39 * USE_REINPLACE must be defined before REINPLACE_CMD may be used.trevor2003-11-171-0/+1 * Do not attempt to apply patches for OO 1.0.3 to version 1.1.kan2003-11-141-3/+0 * Use the FIND and XARGS macros introduced in bsd.port.mk 1.391.trevor2003-11-131-1/+1 * Bump PORTREVISION.fjoe2003-11-101-0/+1 * Obey CFLAGS.fjoe2003-11-091-2/+1 * OpenOffice -> OpenOffice.orgmaho2003-11-093-3/+3 * Add OpenOffice.org 1.1 for russian languagemaho2003-11-092-0/+23 * Forgot to change Makefile s..maho2003-11-081-1/+1 * rename openoffice* to openoffice-1.0* accodingly (repo copy).maho2003-11-081-1/+1 * rename openoffice to openoffice-1.0 after repocopymaho2003-11-082-23/+1 * Partial backout. I missed fjoe's commit from a few days ago thatlinimon2003-11-021-4/+0 * Per bento logs, mark broken on 5.x (gcc3.3) and alpha. The distfilelinimon2003-11-021-1/+11 * ports with possibly unreachable MAINTAINERsedwin2003-11-021-1/+1 * Clean up the patch.fjoe2003-10-281-1/+1 * Fix build with gcc 3.3.1.fjoe2003-10-282-3/+4 * Fix typo.lev2003-10-251-1/+1 * [1] Use bsd.port.(pre|post).mklev2003-10-244-720/+732 * utilize SITE_PERLijliao2003-10-246-22/+20 * Fix problem with zombies.lev2003-10-234-1/+52 * Update to version 0.99f6.demon2003-10-192-2/+2 * - Make tarballs fetchablekrion2003-10-181-3/+5 * Update the distribution sites and the maintainer's address.roam2003-10-102-5/+7 * Fix building of suexec with Russian and SLL patches.lev2003-10-092-3/+17 * Fix typo (mod_charest -> mod_charset).fjoe2003-10-082-2/+2 * New port: russian/muttprint (pretty print mail in russian)edwin2003-10-073-0/+160 * new port: russian/koi2koiedwin2003-10-078-0/+629 * Translation update: fix checksum.will2003-09-222-2/+2 * Upgrade to Qt 3.2.1 / KDE 3.1.4. See x11/kde3/Makefile rev 1.64 for details.will2003-09-182-2/+2 * Make portlint-compilant.osa2003-09-032-16/+16 * Fix build on -CURRENT (gcc-3.x)osa2003-09-031-0/+11 * Additional lib->share fixesache2003-08-202-6/+6 * spaces -> tab, += -> =ache2003-08-121-1/+1 * Unbroke (fix path)ache2003-08-121-3/+2 * BROKEN: Broken dependencykris2003-08-071-0/+2 * Update to 1.3.28+30.18+2.8.15lev2003-08-034-36/+28 * Update to 1.3.28+30.18lev2003-08-034-32/+24 * Update to version 0.99f5.demon2003-07-292-2/+2 * Update KDE to the latest official release, KDE 3.1.3lofi2003-07-296-4/+20 * Bump libmm shlib version after recent update of devel/mm.demon2003-07-251-1/+1 * Change my mail to @FreeBSD.orgkrion2003-07-221-1/+1 * Unbreak russian/xxkb by updating MASTER_SITES [1]osa2003-07-163-9/+9 * Fix plist.arved2003-07-082-2/+0 * Add CONFLICTS with other httpd ports: all apache variants and `www/publicfile'lev2003-06-252-0/+17 * Change MAINTAINER field of my ports to lev@FReeBSD.org, my brand-newlev2003-06-172-2/+2 * Fix pkg-plistarved2003-06-164-0/+10 * - Update to 1.10;sobomax2003-05-204-9/+8 * Update to KDE 3.1.2lioux2003-05-204-10/+8 * Bring back from Attic: localized messages and documentation for kofficelioux2003-05-2013-0/+415 * Remove bogus hypen dict.mbr2003-05-141-1/+0 * Add russian ooodict port.mbr2003-05-142-0/+21 * Re-add russian language patch.mbr2003-05-142-2/+2 * Remove Y2K conformance statement URLs.fenner2003-05-091-1/+0 * Update to 3.2arved2003-05-052-3/+3 * Add ksocrat, a KDE russian-english dictionary.arved2003-05-015-0/+55 * Fix breakage caused by old translating patches.mbr2003-04-252-2/+2 * [PATCH] russian/wmcyrx: fix MASTER_SITESedwin2003-04-071-3/+2 * Update to 1.3.27PL30.17+2.8.14.nork2003-04-062-2/+2 * Rejoice, for the long awaited upgrade to kde 3.1.1 is here!alane2003-04-064-26/+68 * Remove manpage directories on deinstallkris2003-04-051-0/+2 * Update Russian Apache + mod_ssl to patchlevel 30.17edwin2003-03-312-3/+3 * Update Russian Apache to patchlevel 30.17edwin2003-03-312-4/+3 * Clear moonlight beckons.ade2003-03-0722-11/+11 * Update MASTER_SITE for port russian/apache13 to lateset mirror listedwin2003-02-241-15/+1 * Update MASTER_SITE for port russian/apache13-modssl to lateset mirror listedwin2003-02-241-29/+10 * Update russian/rus-ispell to more recent version: 0.99f4edwin2003-02-242-11/+11 * Remove RESTRICTED tag for crypto stuff.nork2003-02-231-2/+0 * De-pkg-comment.knu2003-02-2120-10/+10 * De-pkg-comment.knu2003-02-212-1/+1 * De-pkg-comment.knu2003-02-218-4/+4 * update to fortuneru-0.4leeym2003-02-192-12/+7 * Update to 1.15.3.naddy2003-02-173-4/+4 * Upgrade to 0.3.naddy2003-02-155-16/+27 * Remove redundant category 'editors' in slave ports.mbr2003-02-132-2/+2 * Add correct encodings for the russian port.mbr2003-02-132-0/+8 * Upgrade kde-i18n to 3.1. Note that the following modules did not get awill2003-01-294-84/+692 * Add russian language distribution patch.mbr2003-01-222-0/+6 * Mark sites/distfiles with tags to minimize false hitsache2003-01-171-5/+5 * Master site changedache2003-01-172-2/+2 * Upgrade to 1.5ache2003-01-033-4/+6 * Upgrade to 0.99f3ache2003-01-023-6/+4 * Update to version 1.8.3.edwin2002-12-132-2/+9 * Fix maintainers email addressedwin2002-12-131-1/+1 * Typo in pkg-descredwin2002-12-111-1/+1 * spelling-typoedwin2002-12-111-1/+1 * Remove all netscape ports with a vulnerability of JRE.sada2002-11-176-45/+0 * - upgrade mod-ssl to 2.8.12 so that distfile could be fetchable again.sada2002-11-114-10/+107 * Add login classes support for suexecsada2002-11-113-9/+105 * o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-1112-12/+6 * Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-0712-6/+12 * PERL -> REINPLACEedwin2002-11-041-0/+1 * Fix categories to match dir containing port. bsd.port.mk (and portlint)alane2002-10-302-2/+4 * Vendor made minor code changes with no version bump. Label this askris2002-10-133-81/+82 * 1. Removed comments from pkg-plist files per will's request.alane2002-10-112-2/+2 * Update to apache 1.3.27 and 2.0.43. This fixes a security vulnerability.kris2002-10-056-14/+20 * add ru-mtc 1.3ijliao2002-09-186-0/+58 * texas chainsaw kde2 massacrealane2002-09-111-2/+0 * build aspell with dictionarydinoex2002-09-104-0/+22 * KDE2 is dead. The source is no longer available.alane2002-09-0920-660/+0 * Fix build in -current (build/link C++ code with ${CXX})kris2002-09-092-1/+27