dovecot-2.0: test-index-fetch unit test fixed.
dovecot at dovecot.org
dovecot at dovecot.org
Tue Apr 12 20:09:47 EEST 2011
details: http://hg.dovecot.org/dovecot-2.0/rev/8101b70e4a27
changeset: 12739:8101b70e4a27
user: Timo Sirainen <tss at iki.fi>
date: Tue Apr 12 20:09:44 2011 +0300
description:
test-index-fetch unit test fixed.
diffstat:
src/lib-storage/index/test-index-fetch.c | 36 +++++++++++++++---------------------
1 files changed, 15 insertions(+), 21 deletions(-)
diffs (54 lines):
diff -r bdd5a26ee180 -r 8101b70e4a27 src/lib-storage/index/test-index-fetch.c
--- a/src/lib-storage/index/test-index-fetch.c Tue Apr 12 18:41:15 2011 +0300
+++ b/src/lib-storage/index/test-index-fetch.c Tue Apr 12 20:09:44 2011 +0300
@@ -100,7 +100,7 @@
ARRAY_TYPE(seq_range) uids_filter;
ARRAY_TYPE(mailbox_expunge_rec) expunges;
const struct mailbox_expunge_rec *exp;
- unsigned int i, count;
+ unsigned int count;
uint64_t modseq;
box = t_new(struct mailbox, 1);
@@ -122,27 +122,21 @@
t_array_init(&expunges, 32);
modseq = 98ULL << 32;
- for (i = 0; i < 2; i++) {
- test_assert(index_storage_get_expunges(box, modseq, &uids_filter,
- NULL, &expunges) == i);
+ test_assert(index_storage_get_expunges(box, modseq, &uids_filter,
+ NULL, &expunges) == 0);
- exp = array_get(&expunges, &count);
- test_assert(count == 5);
- test_assert(exp[0].uid == 7);
- test_assert(memcmp(exp[0].guid_128, mail_guids[2], MAIL_GUID_128_SIZE) == 0);
- test_assert(exp[1].uid == 3);
- test_assert(memcmp(exp[1].guid_128, mail_guids[3], MAIL_GUID_128_SIZE) == 0);
- test_assert(exp[2].uid == 11);
- test_assert(memcmp(exp[2].guid_128, mail_guids[4], MAIL_GUID_128_SIZE) == 0);
- test_assert(exp[3].uid == 1);
- test_assert(memcmp(exp[3].guid_128, mail_guids[5], MAIL_GUID_128_SIZE) == 0);
- test_assert(exp[4].uid == 53);
- test_assert(memcmp(exp[4].guid_128, mail_guids[6], MAIL_GUID_128_SIZE) == 0);
-
- array_clear(&uids_filter);
- expunge_idx = 0;
- modseq = 100ULL << 32;
- }
+ exp = array_get(&expunges, &count);
+ test_assert(count == 5);
+ test_assert(exp[0].uid == 3);
+ test_assert(memcmp(exp[0].guid_128, mail_guids[3], MAIL_GUID_128_SIZE) == 0);
+ test_assert(exp[1].uid == 1);
+ test_assert(memcmp(exp[1].guid_128, mail_guids[5], MAIL_GUID_128_SIZE) == 0);
+ test_assert(exp[2].uid == 53);
+ test_assert(memcmp(exp[2].guid_128, mail_guids[6], MAIL_GUID_128_SIZE) == 0);
+ test_assert(exp[3].uid == 7);
+ test_assert(memcmp(exp[3].guid_128, mail_guids[2], MAIL_GUID_128_SIZE) == 0);
+ test_assert(exp[4].uid == 11);
+ test_assert(memcmp(exp[4].guid_128, mail_guids[4], MAIL_GUID_128_SIZE) == 0);
test_end();
}
More information about the dovecot-cvs
mailing list