Mercurial > dovecot > core-2.2
changeset 12946:8101b70e4a27
test-index-fetch unit test fixed.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 12 Apr 2011 20:09:44 +0300 |
parents | bdd5a26ee180 |
children | 606faab2b896 |
files | src/lib-storage/index/test-index-fetch.c |
diffstat | 1 files changed, 15 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- 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(); }