test-mail-transaction-log-view.c revision dc39158a24fd58b6612f98d94cd313b7ed9756b6
/* Copyright (c) 2009-2013 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "test-common.h"
#include "mail-index-private.h"
#include "mail-transaction-log-view-private.h"
static struct mail_transaction_log *log;
static struct mail_transaction_log_view *view;
const char *fmt ATTR_UNUSED, ...)
{
}
{
}
struct mail_transaction_log_file **file_r)
{
struct mail_transaction_log_file *file;
return 1;
}
}
return 0;
}
{
return 1;
}
{
*highest_modseq_r = 0;
return 0;
}
const void *data ATTR_UNUSED,
{
*cur_modseq += 1;
}
static void
{
struct mail_transaction_log_file **p, *file;
/* files must be sorted by file_seq */
break;
}
*p = file;
}
{
struct mail_transaction_log_file *const *files;
unsigned int i, count;
for (i = 0; i < count; i++) {
}
}
return ret;
}
static size_t
const struct mail_index_record *rec)
{
struct mail_transaction_header hdr;
return size;
}
static void test_mail_transaction_log_view(void)
{
const struct mail_transaction_header *hdr;
const struct mail_index_record *rec;
struct mail_index_record append_rec;
const void *data;
bool reset;
test_begin("init");
/* add an append record to the 3rd log file */
last_log_size = sizeof(struct mail_transaction_log_header) +
view_is_file_refed(3));
test_end();
/* we have files 1-3 opened */
test_begin("set all");
view_is_file_refed(3) &&
test_end();
test_begin("set first");
test_end();
test_begin("set end");
test_assert(mail_transaction_log_view_set(view, 3, last_log_size, (uint32_t)-1, (uoff_t)-1, &reset) == 1);
test_end();
test_begin("log clear");
view_is_file_refed(3));
test_end();
/* --- first file has been removed --- */
test_begin("set 2-3");
test_end();
test_begin("missing log handing");
test_end();
test_begin("closed log handling");
test_end();
}
int main(void)
{
static void (*test_functions[])(void) = {
};
return test_run(test_functions);
}