/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "utc-offset.h"
#include "mbox-from.h"
#include "test-common.h"
#include <time.h>
struct test_mbox_from_parse_output {
int tz_offset;
const char *sender;
int ret;
};
static void test_mbox_from_parse(void)
{
static const char *input[] = {
"user@domain Thu Nov 29 23:33:09 1973 +0200",
"user@domain Thu Nov 29 19:33:09 1973 -0200",
"\"user name\"@domain Fri Jan 2 10:13:52 UTC 1970 +0000",
"user Fri Jan 2 10:14 1970 +0000",
"user Fri, 2 Jan 1970 10:14:00 +0000",
"user Fri, 2 Jan 1970 10:14 +0000",
" Fri Jan 2 10:14 1970 +0000",
"user Fri, 2 Foo 1970 10:14:00",
"Fri Jan 2 10:14 1970 +0000",
"user Fri Jan x 10:14 1970 +0000",
"user Fri Jan 2 0:14 1970 +0000",
"user Fri Jan 2 xx:14 1970 +0000",
"user Fri Jan 2 10: 1970 +0000",
"user Fri Jan 2 10:xx 1970 +0000",
"user Fri Jan 2 10:xx +0000",
};
{ 123456789, 2*60, "user@domain", 0 },
{ 123456789, -2*60, "user@domain", 0 },
{ 123232, 0, "\"user name\"@domain", 0 },
{ 123240, 0, "user", 0 },
{ 123240, 0, "user", 0 },
{ 123240, 0, "user", 0 },
{ 123240, 0, "", 0 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
{ 0, 0, NULL, -1 },
};
unsigned int i, j;
char *sender;
bool success;
time_t t;
for (j = 0; j < 2; j++) {
for (i = 0; i < N_ELEMENTS(input); i++) {
/* prepare for testing without timezone */
}
}
}
}
static void test_mbox_from_create(void)
{
time_t t = 1234567890;
int tz;
test_begin("mbox_from_create()");
"From user Fri Feb 13 23:31:30 2009\n") == 0);
test_end();
}
int main(void)
{
static void (*const test_functions[])(void) = {
};
return test_run(test_functions);
}