Mercurial > dovecot > core-2.2
changeset 15586:051affd69699
lib-index: Fixed failing transaction log test.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 08 Jan 2013 03:39:34 +0200 |
parents | 6a19df272459 |
children | cf361d83bea6 |
files | src/lib-index/test-mail-transaction-log-append.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/test-mail-transaction-log-append.c Tue Jan 08 03:31:36 2013 +0200 +++ b/src/lib-index/test-mail-transaction-log-append.c Tue Jan 08 03:39:34 2013 +0200 @@ -44,6 +44,7 @@ struct mail_transaction_log_append_ctx *ctx; const struct mail_transaction_header *hdr; const unsigned int *bufp; + const struct mail_transaction_boundary *bound; test_assert(mail_transaction_log_append_begin(log->index, MAIL_TRANSACTION_EXTERNAL, &ctx) == 0); mail_transaction_log_append_add(ctx, MAIL_TRANSACTION_APPEND, @@ -58,6 +59,13 @@ test_assert(file->sync_offset == file->buffer_offset + file->buffer->used); hdr = file->buffer->data; + test_assert(hdr->type == (MAIL_TRANSACTION_BOUNDARY | + MAIL_TRANSACTION_EXTERNAL)); + test_assert(mail_index_offset_to_uint32(hdr->size) == sizeof(*hdr) + sizeof(*bound)); + bound = (const void *)(hdr + 1); + test_assert(bound->size == file->buffer->used); + hdr = (const void *)(bound + 1); + test_assert(hdr->type == (MAIL_TRANSACTION_APPEND | MAIL_TRANSACTION_EXTERNAL)); test_assert(mail_index_offset_to_uint32(hdr->size) == sizeof(*hdr) + sizeof(buf[0]));