test-imap-utf7.c revision 68828bda5cfbfc38a95829923b08b6b919d87143
/* Copyright (c) 2008-2014 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "unichar.h"
#include "imap-utf7.h"
#include "test-common.h"
static void test_imap_utf7(void)
{
static struct test {
const char *utf8;
const char *mutf7;
} tests[] = {
{ "&&x&&", "&-&-x&-&-" },
{ "tietäjä", "tiet&AOQ-j&AOQ-" },
{ "p\xe4\xe4", NULL },
{ NULL, "&" },
{ NULL, "&Jjo" },
{ NULL, "&Jjo!" },
{ NULL, "&U,BTFw-&ZeVnLIqe-" }
};
const char *orig_src;
unsigned int i, j;
test_begin("imap mutf7");
for (i = 0; i < N_ELEMENTS(tests); i++) {
str_truncate(dest, 0);
else
}
str_truncate(dest, 0);
else
}
}
for (i = 1; i <= 10; i++) {
str_truncate(src, 0);
str_truncate(dest, 0);
for (j = 0; j < i; j++) {
if (j % 3 == 0)
if (j % 5 == 0)
}
str_truncate(src, 0);
}
}
test_end();
}
int main(void)
{
static void (*test_functions[])(void) = {
};
return test_run(test_functions);
}