~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to camel/tests/folder/test9.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "camel/camel-filter-driver.h"
19
19
#include "camel/camel-stream-fs.h"
20
20
 
21
 
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
22
 
 
23
21
static const gchar *local_drivers[] = { "local" };
24
22
 
25
23
struct {
81
79
{
82
80
        gint i;
83
81
 
84
 
        for (i=0;i<ARRAY_LEN(mailboxes);i++)
 
82
        for (i = 0; i < G_N_ELEMENTS (mailboxes); i++)
85
83
                if (!strcmp(mailboxes[i].name, uri)) {
86
84
                        camel_object_ref((CamelObject *)mailboxes[i].folder);
87
85
                        return mailboxes[i].folder;
122
120
        pull();
123
121
 
124
122
        push("Creating output folders");
125
 
        for (i=0;i<ARRAY_LEN(mailboxes);i++) {
 
123
        for (i = 0; i < G_N_ELEMENTS (mailboxes); i++) {
126
124
                push("creating %s", mailboxes[i].name);
127
125
                mailboxes[i].folder = folder = camel_store_get_folder(store, mailboxes[i].name, CAMEL_STORE_FOLDER_CREATE, ex);
128
126
                check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
171
169
        push("Building filters");
172
170
        driver = camel_filter_driver_new(session);
173
171
        camel_filter_driver_set_folder_func(driver, get_folder, NULL);
174
 
        for (i=0;i<ARRAY_LEN(rules);i++) {
 
172
        for (i = 0; i < G_N_ELEMENTS (rules); i++) {
175
173
                camel_filter_driver_add_rule(driver, rules[i].name, rules[i].match, rules[i].action);
176
174
        }
177
175
        pull();
188
186
 
189
187
        /* this tests that invalid rules are caught */
190
188
        push("Testing broken match rules");
191
 
        for (i=0;i<ARRAY_LEN(brokens);i++) {
 
189
        for (i = 0; i < G_N_ELEMENTS (brokens); i++) {
192
190
                push("rule %s", brokens[i].match);
193
191
                driver = camel_filter_driver_new(session);
194
192
                camel_filter_driver_set_folder_func(driver, get_folder, NULL);
202
200
        pull();
203
201
 
204
202
        push("Testing broken action rules");
205
 
        for (i=0;i<ARRAY_LEN(brokena);i++) {
 
203
        for (i = 0; i < G_N_ELEMENTS (brokena); i++) {
206
204
                push("rule %s", brokena[i].action);
207
205
                driver = camel_filter_driver_new(session);
208
206
                camel_filter_driver_set_folder_func(driver, get_folder, NULL);
215
213
        }
216
214
        pull();
217
215
 
218
 
        for (i=0;i<ARRAY_LEN(mailboxes);i++) {
 
216
        for (i = 0; i < G_N_ELEMENTS (mailboxes); i++) {
219
217
                check_unref(mailboxes[i].folder, 1);
220
218
        }
221
219