test-message-address.c revision cca4ba2a504d70a9fe9fee37f8433997359de52c
#include "lib.h"
#include "str.h"
#include "message-address.h"
#include "test-common.h"
const struct message_address *a2)
{
}
static void test_message_address(void)
{
static const char *input[] = {
"user@domain", NULL,
"<user@domain>", "user@domain",
"foo bar <user@domain>", NULL,
"\"foo bar\" <user@domain>", "foo bar <user@domain>",
"<@route:user@domain>", NULL,
"<@route@route2:user@domain>", "<@route,@route2:user@domain>",
"hello <@route ,@route2:user@domain>", "hello <@route,@route2:user@domain>",
"user (hello)", NULL,
"hello <user>", NULL,
"@domain", NULL
};
static struct message_address group_prefix = {
};
static struct message_address group_suffix = {
};
static struct message_address output[] = {
};
struct message_address *addr;
const char *wanted_string;
unsigned int i;
test_begin("message address parsing");
for (i = 0; i < N_ELEMENTS(output); i++) {
(const unsigned char *)input[i*2],
if (!output[i].invalid_syntax) {
str_truncate(str, 0);
if (i != 0) {
if ((i % 2) == 0)
else
}
}
}
test_end();
test_begin("message address parsing with groups");
if (output[i].invalid_syntax)
continue;
}
test_end();
test_begin("message address parsing with empty group");
str_truncate(group, 0);
test_end();
}
int main(void)
{
static void (*test_functions[])(void) = {
};
return test_run(test_functions);
}