/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "test-common.h"
#include "mail-index-private.h"
#include "mail-transaction-log-private.h"
const char *filepath ATTR_UNUSED,
const char *function ATTR_UNUSED)
{
}
const char *lock_reason ATTR_UNUSED)
{
return log_lock_failure ? -1 : 0;
}
const char *lock_reason ATTR_UNUSED) {}
const void *data ATTR_UNUSED,
unsigned int version ATTR_UNUSED)
{
*cur_modseq += 1;
}
{
return -1;
}
{
const unsigned int *bufp;
test_assert(file->buffer->used == (size_t)((const char *)(bufp+1) - (const char *)file->buffer->data));
file->buffer_offset = 0;
test_end();
}
{
const struct mail_transaction_header_update *u;
test_begin("transaction log append: append_sync_offset only");
u = (const void *)(hdr + 1);
offsetp = (const void *)(u+1);
test_end();
}
static void test_mail_transaction_log_append(void)
{
int fd;
if (fd == -1)
test_begin("transaction log append");
test_begin("transaction log append: lock failure");
test_end();
/* do this after head->buffer has already been initialized */
test_begin("transaction log append: garbage truncation");
test_end();
}
int main(void)
{
static void (*const test_functions[])(void) = {
};
return test_run(test_functions);
}