Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
dovecot22
0002-lib-mail-test-message-address-Add-TEST_MES...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-lib-mail-test-message-address-Add-TEST_MESSAGE_ADDRE.patch of Package dovecot22
From 8d65e2345e1dbedb00b662ee0abd05be2e7e6b7e Mon Sep 17 00:00:00 2001 From: Timo Sirainen <timo.sirainen@dovecot.fi> Date: Fri, 22 Dec 2017 18:36:09 +0200 Subject: [PATCH 2/7] lib-mail: test-message-address - Add TEST_MESSAGE_ADDRESS_FLAG_SKIP_LIST flag This commit just adds the flag and sets it to 0 for all existing tests. --- src/lib-mail/test-message-address.c | 100 +++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/src/lib-mail/test-message-address.c b/src/lib-mail/test-message-address.c index de69d96..f6a8766 100644 --- a/src/lib-mail/test-message-address.c +++ b/src/lib-mail/test-message-address.c @@ -5,6 +5,10 @@ #include "message-address.h" #include "test-common.h" +enum test_message_address { + TEST_MESSAGE_ADDRESS_FLAG_SKIP_LIST = BIT(0), +}; + static bool cmp_addr(const struct message_address *a1, const struct message_address *a2) { @@ -38,161 +42,162 @@ static void test_message_address(void) const char *wanted_filled_output; struct message_address addr; struct message_address filled_addr; + enum test_message_address flags; } tests[] = { /* user@domain -> <user@domain> */ { "user@domain", "<user@domain>", NULL, { NULL, NULL, NULL, "user", "domain", FALSE }, - { NULL, NULL, NULL, "user", "domain", FALSE } }, + { NULL, NULL, NULL, "user", "domain", FALSE }, 0 }, { "\"user\"@domain", "<user@domain>", NULL, { NULL, NULL, NULL, "user", "domain", FALSE }, - { NULL, NULL, NULL, "user", "domain", FALSE } }, + { NULL, NULL, NULL, "user", "domain", FALSE }, 0 }, { "\"user name\"@domain", "<\"user name\"@domain>", NULL, { NULL, NULL, NULL, "user name", "domain", FALSE }, - { NULL, NULL, NULL, "user name", "domain", FALSE } }, + { NULL, NULL, NULL, "user name", "domain", FALSE }, 0 }, { "\"user@na\\\\me\"@domain", "<\"user@na\\\\me\"@domain>", NULL, { NULL, NULL, NULL, "user@na\\me", "domain", FALSE }, - { NULL, NULL, NULL, "user@na\\me", "domain", FALSE } }, + { NULL, NULL, NULL, "user@na\\me", "domain", FALSE }, 0 }, { "\"user\\\"name\"@domain", "<\"user\\\"name\"@domain>", NULL, { NULL, NULL, NULL, "user\"name", "domain", FALSE }, - { NULL, NULL, NULL, "user\"name", "domain", FALSE } }, + { NULL, NULL, NULL, "user\"name", "domain", FALSE }, 0 }, { "\"\"@domain", "<\"\"@domain>", NULL, { NULL, NULL, NULL, "", "domain", FALSE }, - { NULL, NULL, NULL, "", "domain", FALSE } }, + { NULL, NULL, NULL, "", "domain", FALSE }, 0 }, { "user", "<user>", "<user@MISSING_DOMAIN>", { NULL, NULL, NULL, "user", "", TRUE }, - { NULL, NULL, NULL, "user", "MISSING_DOMAIN", TRUE } }, + { NULL, NULL, NULL, "user", "MISSING_DOMAIN", TRUE }, 0 }, { "@domain", "<\"\"@domain>", "<MISSING_MAILBOX@domain>", { NULL, NULL, NULL, "", "domain", TRUE }, - { NULL, NULL, NULL, "MISSING_MAILBOX", "domain", TRUE } }, + { NULL, NULL, NULL, "MISSING_MAILBOX", "domain", TRUE }, 0 }, /* Display Name -> Display Name */ { "Display Name", "\"Display Name\"", "\"Display Name\" <MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, "Display Name", NULL, "", "", TRUE }, - { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, { "\"Display Name\"", "\"Display Name\"", "\"Display Name\" <MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, "Display Name", NULL, "", "", TRUE }, - { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, { "Display \"Name\"", "\"Display Name\"", "\"Display Name\" <MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, "Display Name", NULL, "", "", TRUE }, - { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, { "\"Display\" \"Name\"", "\"Display Name\"", "\"Display Name\" <MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, "Display Name", NULL, "", "", TRUE }, - { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, { "\"\"", "", "<MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, "", NULL, "", "", TRUE }, - { NULL, "", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, "", NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, /* <user@domain> -> <user@domain> */ { "<user@domain>", NULL, NULL, { NULL, NULL, NULL, "user", "domain", FALSE }, - { NULL, NULL, NULL, "user", "domain", FALSE } }, + { NULL, NULL, NULL, "user", "domain", FALSE }, 0 }, { "<\"user\"@domain>", "<user@domain>", NULL, { NULL, NULL, NULL, "user", "domain", FALSE }, - { NULL, NULL, NULL, "user", "domain", FALSE } }, + { NULL, NULL, NULL, "user", "domain", FALSE }, 0 }, { "<\"user name\"@domain>", NULL, NULL, { NULL, NULL, NULL, "user name", "domain", FALSE }, - { NULL, NULL, NULL, "user name", "domain", FALSE } }, + { NULL, NULL, NULL, "user name", "domain", FALSE }, 0 }, { "<\"user@na\\\\me\"@domain>", NULL, NULL, { NULL, NULL, NULL, "user@na\\me", "domain", FALSE }, - { NULL, NULL, NULL, "user@na\\me", "domain", FALSE } }, + { NULL, NULL, NULL, "user@na\\me", "domain", FALSE }, 0 }, { "<\"user\\\"name\"@domain>", NULL, NULL, { NULL, NULL, NULL, "user\"name", "domain", FALSE }, - { NULL, NULL, NULL, "user\"name", "domain", FALSE } }, + { NULL, NULL, NULL, "user\"name", "domain", FALSE }, 0 }, { "<\"\"@domain>", NULL, NULL, { NULL, NULL, NULL, "", "domain", FALSE }, - { NULL, NULL, NULL, "", "domain", FALSE } }, + { NULL, NULL, NULL, "", "domain", FALSE }, 0 }, { "<user>", NULL, "<user@MISSING_DOMAIN>", { NULL, NULL, NULL, "user", "", TRUE }, - { NULL, NULL, NULL, "user", "MISSING_DOMAIN", TRUE } }, + { NULL, NULL, NULL, "user", "MISSING_DOMAIN", TRUE }, 0 }, { "<@route>", "<@route:\"\">", "<INVALID_ROUTE:MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, NULL, "@route", "", "", TRUE }, - { NULL, NULL, "INVALID_ROUTE", "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, NULL, "INVALID_ROUTE", "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, /* user@domain (Display Name) -> "Display Name" <user@domain> */ { "user@domain (DisplayName)", "DisplayName <user@domain>", NULL, { NULL, "DisplayName", NULL, "user", "domain", FALSE }, - { NULL, "DisplayName", NULL, "user", "domain", FALSE } }, + { NULL, "DisplayName", NULL, "user", "domain", FALSE }, 0 }, { "user@domain (Display Name)", "\"Display Name\" <user@domain>", NULL, { NULL, "Display Name", NULL, "user", "domain", FALSE }, - { NULL, "Display Name", NULL, "user", "domain", FALSE } }, + { NULL, "Display Name", NULL, "user", "domain", FALSE }, 0 }, { "user@domain (Display\"Name)", "\"Display\\\"Name\" <user@domain>", NULL, { NULL, "Display\"Name", NULL, "user", "domain", FALSE }, - { NULL, "Display\"Name", NULL, "user", "domain", FALSE } }, + { NULL, "Display\"Name", NULL, "user", "domain", FALSE }, 0 }, { "user (Display Name)", "\"Display Name\" <user>", "\"Display Name\" <user@MISSING_DOMAIN>", { NULL, "Display Name", NULL, "user", "", TRUE }, - { NULL, "Display Name", NULL, "user", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", NULL, "user", "MISSING_DOMAIN", TRUE }, 0 }, { "@domain (Display Name)", "\"Display Name\" <\"\"@domain>", "\"Display Name\" <MISSING_MAILBOX@domain>", { NULL, "Display Name", NULL, "", "domain", TRUE }, - { NULL, "Display Name", NULL, "MISSING_MAILBOX", "domain", TRUE } }, + { NULL, "Display Name", NULL, "MISSING_MAILBOX", "domain", TRUE }, 0 }, { "user@domain ()", "<user@domain>", NULL, { NULL, NULL, NULL, "user", "domain", FALSE }, - { NULL, NULL, NULL, "user", "domain", FALSE } }, + { NULL, NULL, NULL, "user", "domain", FALSE }, 0 }, /* Display Name <user@domain> -> "Display Name" <user@domain> */ { "DisplayName <user@domain>", NULL, NULL, { NULL, "DisplayName", NULL, "user", "domain", FALSE }, - { NULL, "DisplayName", NULL, "user", "domain", FALSE } }, + { NULL, "DisplayName", NULL, "user", "domain", FALSE }, 0 }, { "Display Name <user@domain>", "\"Display Name\" <user@domain>", NULL, { NULL, "Display Name", NULL, "user", "domain", FALSE }, - { NULL, "Display Name", NULL, "user", "domain", FALSE } }, + { NULL, "Display Name", NULL, "user", "domain", FALSE }, 0 }, { "\"Display Name\" <user@domain>", NULL, NULL, { NULL, "Display Name", NULL, "user", "domain", FALSE }, - { NULL, "Display Name", NULL, "user", "domain", FALSE } }, + { NULL, "Display Name", NULL, "user", "domain", FALSE }, 0 }, { "\"Display\\\"Name\" <user@domain>", NULL, NULL, { NULL, "Display\"Name", NULL, "user", "domain", FALSE }, - { NULL, "Display\"Name", NULL, "user", "domain", FALSE } }, + { NULL, "Display\"Name", NULL, "user", "domain", FALSE }, 0 }, { "Display Name <user>", "\"Display Name\" <user>", "\"Display Name\" <user@MISSING_DOMAIN>", { NULL, "Display Name", NULL, "user", "", TRUE }, - { NULL, "Display Name", NULL, "user", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", NULL, "user", "MISSING_DOMAIN", TRUE }, 0 }, { "\"\" <user@domain>", "<user@domain>", NULL, { NULL, NULL, NULL, "user", "domain", FALSE }, - { NULL, NULL, NULL, "user", "domain", FALSE } }, + { NULL, NULL, NULL, "user", "domain", FALSE }, 0 }, /* <@route:user@domain> -> <@route:user@domain> */ { "<@route:user@domain>", NULL, NULL, { NULL, NULL, "@route", "user", "domain", FALSE }, - { NULL, NULL, "@route", "user", "domain", FALSE } }, + { NULL, NULL, "@route", "user", "domain", FALSE }, 0 }, { "<@route,@route2:user@domain>", NULL, NULL, { NULL, NULL, "@route,@route2", "user", "domain", FALSE }, - { NULL, NULL, "@route,@route2", "user", "domain", FALSE } }, + { NULL, NULL, "@route,@route2", "user", "domain", FALSE }, 0 }, { "<@route@route2:user@domain>", "<@route,@route2:user@domain>", NULL, { NULL, NULL, "@route,@route2", "user", "domain", FALSE }, - { NULL, NULL, "@route,@route2", "user", "domain", FALSE } }, + { NULL, NULL, "@route,@route2", "user", "domain", FALSE }, 0 }, { "<@route@route2:user>", "<@route,@route2:user>", "<@route,@route2:user@MISSING_DOMAIN>", { NULL, NULL, "@route,@route2", "user", "", TRUE }, - { NULL, NULL, "@route,@route2", "user", "MISSING_DOMAIN", TRUE } }, + { NULL, NULL, "@route,@route2", "user", "MISSING_DOMAIN", TRUE }, 0 }, { "<@route@route2:\"\"@domain>", "<@route,@route2:\"\"@domain>", NULL, { NULL, NULL, "@route,@route2", "", "domain", FALSE }, - { NULL, NULL, "@route,@route2", "", "domain", FALSE } }, + { NULL, NULL, "@route,@route2", "", "domain", FALSE }, 0 }, /* Display Name <@route:user@domain> -> "Display Name" <@route:user@domain> */ { "Display Name <@route:user@domain>", "\"Display Name\" <@route:user@domain>", NULL, { NULL, "Display Name", "@route", "user", "domain", FALSE }, - { NULL, "Display Name", "@route", "user", "domain", FALSE } }, + { NULL, "Display Name", "@route", "user", "domain", FALSE }, 0 }, { "Display Name <@route,@route2:user@domain>", "\"Display Name\" <@route,@route2:user@domain>", NULL, { NULL, "Display Name", "@route,@route2", "user", "domain", FALSE }, - { NULL, "Display Name", "@route,@route2", "user", "domain", FALSE } }, + { NULL, "Display Name", "@route,@route2", "user", "domain", FALSE }, 0 }, { "Display Name <@route@route2:user@domain>", "\"Display Name\" <@route,@route2:user@domain>", NULL, { NULL, "Display Name", "@route,@route2", "user", "domain", FALSE }, - { NULL, "Display Name", "@route,@route2", "user", "domain", FALSE } }, + { NULL, "Display Name", "@route,@route2", "user", "domain", FALSE }, 0 }, { "Display Name <@route@route2:user>", "\"Display Name\" <@route,@route2:user>", "\"Display Name\" <@route,@route2:user@MISSING_DOMAIN>", { NULL, "Display Name", "@route,@route2", "user", "", TRUE }, - { NULL, "Display Name", "@route,@route2", "user", "MISSING_DOMAIN", TRUE } }, + { NULL, "Display Name", "@route,@route2", "user", "MISSING_DOMAIN", TRUE }, 0 }, { "Display Name <@route@route2:\"\"@domain>", "\"Display Name\" <@route,@route2:\"\"@domain>", NULL, { NULL, "Display Name", "@route,@route2", "", "domain", FALSE }, - { NULL, "Display Name", "@route,@route2", "", "domain", FALSE } }, + { NULL, "Display Name", "@route,@route2", "", "domain", FALSE }, 0 }, /* other tests: */ { "\"foo: <a@b>;,\" <user@domain>", NULL, NULL, { NULL, "foo: <a@b>;,", NULL, "user", "domain", FALSE }, - { NULL, "foo: <a@b>;,", NULL, "user", "domain", FALSE } }, + { NULL, "foo: <a@b>;,", NULL, "user", "domain", FALSE }, 0 }, { "<>", "", "<MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, NULL, NULL, "", "", TRUE }, - { NULL, NULL, NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, NULL, NULL, "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, { "<@>", "", "<INVALID_ROUTE:MISSING_MAILBOX@MISSING_DOMAIN>", { NULL, NULL, NULL, "", "", TRUE }, - { NULL, NULL, "INVALID_ROUTE", "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE } }, + { NULL, NULL, "INVALID_ROUTE", "MISSING_MAILBOX", "MISSING_DOMAIN", TRUE }, 0 }, }; static struct message_address group_prefix = { NULL, NULL, NULL, "group", NULL, FALSE @@ -231,6 +236,9 @@ static void test_message_address(void) wanted_string = test->input; test_assert_idx(strcmp(str_c(str), wanted_string) == 0, i); + if ((test->flags & TEST_MESSAGE_ADDRESS_FLAG_SKIP_LIST) != 0) + continue; + /* test the address as a list of itself */ for (unsigned int list_length = 2; list_length <= 5; list_length++) { str_truncate(group, 0); -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor