aboutsummaryrefslogtreecommitdiffstats
path: root/camel/tests/lib/folders.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/tests/lib/folders.c')
-rw-r--r--camel/tests/lib/folders.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c
index e93d8caf2e..5104da6c12 100644
--- a/camel/tests/lib/folders.c
+++ b/camel/tests/lib/folders.c
@@ -12,13 +12,15 @@ test_folder_counts(CamelFolder *folder, int total, int unread)
{
GPtrArray *s;
int i, myunread;
+ int gettotal, getunread;
CamelMessageInfo *info;
push("test folder counts %d total %d unread", total, unread);
/* first, use the standard functions */
- check(camel_folder_get_message_count(folder) == total);
- check(camel_folder_get_unread_message_count(folder) == total);
+ camel_object_get(folder, NULL, CAMEL_FOLDER_TOTAL, &gettotal, CAMEL_FOLDER_UNREAD, &getunread, 0);
+ check(gettotal == total);
+ check(getunread == unread);
/* next, use the summary */
s = camel_folder_get_summary(folder);
@@ -27,7 +29,7 @@ test_folder_counts(CamelFolder *folder, int total, int unread)
myunread = s->len;
for (i=0;i<s->len;i++) {
info = s->pdata[i];
- if (info->flags & CAMEL_MESSAGE_SEEN)
+ if (camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN)
myunread--;
}
check(unread == myunread);
@@ -40,7 +42,7 @@ test_folder_counts(CamelFolder *folder, int total, int unread)
myunread = s->len;
for (i=0;i<s->len;i++) {
info = camel_folder_get_message_info(folder, s->pdata[i]);
- if (info->flags & CAMEL_MESSAGE_SEEN)
+ if (camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN)
myunread--;
camel_folder_free_message_info(folder, info);
}
@@ -70,7 +72,7 @@ test_message_info(CamelMimeMessage *msg, const CamelMessageInfo *info)
/* FIXME: testing from/cc/to, etc is more tricky */
- check(info->date_sent == camel_mime_message_get_date(msg, NULL));
+ check(camel_message_info_date_sent(info) == camel_mime_message_get_date(msg, NULL));
/* date received isn't set for messages that haven't been sent anywhere ... */
/*check(info->date_received == camel_mime_message_get_date_received(msg, NULL));*/
@@ -469,7 +471,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
push("deleting first message & expunging");
camel_folder_delete_message(folder, uids->pdata[0]);
- test_folder_counts(folder, 10, 10);
+ test_folder_counts(folder, 10, 9);
camel_folder_expunge(folder, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
test_folder_not_message(folder, uids->pdata[0]);
@@ -498,7 +500,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
push("deleting last message & expunging");
camel_folder_delete_message(folder, uids->pdata[8]);
/* sync? */
- test_folder_counts(folder, 9, 9);
+ test_folder_counts(folder, 9, 8);
camel_folder_expunge(folder, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
test_folder_not_message(folder, uids->pdata[8]);
@@ -529,7 +531,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons
camel_folder_delete_message(folder, uids->pdata[j]);
}
/* sync? */
- test_folder_counts(folder, 8, 8);
+ test_folder_counts(folder, 8, 0);
camel_folder_expunge(folder, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
for (j=0;j<8;j++) {