test-imap-url.c revision 639bb36b12b9f9bb54c8bb1be50eac623622f8a0
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch/* Copyright (c) 2009-2011 Dovecot authors, see the included COPYING file */
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch const char *url;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch/* Valid IMAP URL tests */
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschstruct valid_imap_url_test valid_url_tests[] = {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://%68endri%6B;AUTH=GSS%41PI@%65%78%61%6d%70%6c%65.com",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://beelzebub@666.4example.com:999",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Trash/..",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Trash/../",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Trash/../..",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX%3BTrash",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX;UIDVALIDITY=1341",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/;UIDVALIDITY=23423",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=6567",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .mailbox = "INBOX/Drafts", .uidvalidity = 6567 }
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=788/;UID=16",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .mailbox = "INBOX/Drafts", .uidvalidity = 788,
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=788/;UID=16/..",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .mailbox = "INBOX/Drafts", .uidvalidity = 788,
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=788/;UID=16/../..",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Junk;UIDVALIDITY=27667/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";UID=434/;SECTION=HEADER",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .mailbox = "INBOX/Junk", .uidvalidity = 27667,
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Important/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";UID=437/;SECTION=1.2.MIME",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Important/;UID=56/;SECTION=AA/BB",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Important/;UID=56/;SECTION=AA/BB/..",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Important/;UID=56/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";SECTION=AA/BB/../..",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Important/;UID=234/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";SECTION=HEADER.FIELDS%20(%22To%22%20%22From%22)",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uid = 234, .section = "HEADER.FIELDS (\"To\" \"From\")" }
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/Important/;UID=234/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";PARTIAL=10.250",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uid = 234, .section = NULL, .partial_offset = 10, .partial_size = 250 }
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://hendrik@example.com/INBOX/Important/;UID=34534/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";SECTION=1.3.TEXT/;PARTIAL=0.34254",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://hendrik@example.com/INBOX/Sent"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";UIDVALIDITY=534?SUBJECT%20%22Frop?%22",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .mailbox = "INBOX/Accounts/user@example.com" }
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "../../%23news;UIDVALIDITY=546/;UID=456",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .have_partial = TRUE, .partial_offset = 0, .partial_size = 1024 },
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .have_partial = TRUE, .partial_offset = 1024, .partial_size = 1024 }
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .have_partial = TRUE, .partial_offset = 1024, .partial_size = 1024 },
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .have_partial = TRUE, .partial_offset = 0, .partial_size = 512 }
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/;UID=377;URLAUTH=anonymous",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uauth_rumpurl = "imap://user@example.com/INBOX/;UID=377"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/;UID=377"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous:internal:4142434445464748494A4B4C4D4E4F5051525354",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uauth_rumpurl = "imap://user@example.com/INBOX/;UID=377"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uauth_token = (const unsigned char *)"ABCDEFGHIJKLMNOPQRST",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/;UID=377"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";EXPIRE=2011-02-12T12:45:14+01:00"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=user+frop:internal:4142434445464748494A4B4C4D4E4F5051525354",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uauth_rumpurl = "imap://user@example.com/INBOX/;UID=377"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";EXPIRE=2011-02-12T12:45:14+01:00;URLAUTH=user+frop",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .uauth_token = (const unsigned char *)"ABCDEFGHIJKLMNOPQRST",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschunsigned int valid_url_test_count = N_ELEMENTS(valid_url_tests);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschstatic void test_imap_url_valid(void)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch unsigned int i;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch for (i = 0; i < valid_url_test_count; i++) T_BEGIN {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch enum imap_url_parse_flags flags = valid_url_tests[i].flags;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch struct imap_url *urlt = &valid_url_tests[i].url_parsed;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch struct imap_url *urlb = &valid_url_tests[i].url_base;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_begin(t_strdup_printf("imap url valid [%d]", i));
639bb36b12b9f9bb54c8bb1be50eac623622f8a0Timo Sirainen if (imap_url_parse(url, urlb, flags, &urlp, &error) < 0)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out_reason(t_strdup_printf("imap_url_parse(%s)",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch valid_url_tests[i].url), urlp != NULL, error);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->host_name == NULL || urlt->host_name == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->host_name = %s", urlp->host_name),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->host_name = %s", urlp->host_name),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch strcmp(urlp->host_name, urlt->host_name) == 0);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->userid == NULL || urlt->userid == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->userid = %s", urlp->userid),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->userid = %s", urlp->userid),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->auth_type == NULL || urlt->auth_type == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch strcmp(urlp->auth_type, urlt->auth_type) == 0);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->port = %u", urlp->port),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch urlp->have_port == urlt->have_port && urlp->port == urlt->port);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->mailbox == NULL || urlt->mailbox == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uidvalidity = %u", urlp->uidvalidity),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uid = %u", urlp->uid),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->section == NULL || urlt->section == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->section = %s", urlp->section),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->section = %s", urlp->section),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->partial = %"PRIuUOFF_T".%"PRIuUOFF_T,
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch urlp->partial_offset == urlt->partial_offset &&
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->search_program == NULL || urlt->search_program == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->search_program = %s", urlp->search_program),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch urlp->search_program == urlt->search_program);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->search_program = %s", urlp->search_program),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch strcmp(urlp->search_program, urlt->search_program) == 0);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->uauth_rumpurl = %s", urlp->uauth_rumpurl), FALSE);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->uauth_rumpurl = %s", urlp->uauth_rumpurl),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch strcmp(urlp->uauth_rumpurl, urlt->uauth_rumpurl) == 0);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uauth_access_application = %s",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch urlp->uauth_access_application == urlt->uauth_access_application);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uauth_access_application = %s",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uauth_access_user = %s",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch urlp->uauth_access_user == urlt->uauth_access_user);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uauth_access_user = %s",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->uauth_mechanism == NULL || urlt->uauth_mechanism == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->uauth_mechanism = %s", urlp->uauth_mechanism),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch urlp->uauth_mechanism == urlt->uauth_mechanism);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->uauth_mechanism = %s", urlp->uauth_mechanism),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch strcmp(urlp->uauth_mechanism, urlt->uauth_mechanism) == 0);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->uauth_token == NULL || urlt->uauth_token == NULL) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch bool equal = urlp->uauth_token_size == urlt->uauth_token_size;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch "url->uauth_token_size = %"PRIuSIZE_T, urlp->uauth_token_size),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch for (i = 0; i < urlp->uauth_token_size; i++) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch if (urlp->uauth_token[i] != urlt->uauth_token[i]) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out(t_strdup_printf("url->uauth_token [index=%d]", (int)i),
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch const char *url;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschstruct invalid_imap_url_test invalid_url_tests[] = {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/;UID=377/;SECTION=TEXT?ALL"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user@example.com/INBOX/#Fragment"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://[v08.234:232:234:234:2221]/INBOX"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://user;AUTH=frop;friep@example.com"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX;UIDVALIDITY=23423;FROP=friep/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX;UIDVALIDITY=0/;UID=377"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX;UIDVALIDITY=/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX;UIDVALIDITY=33a/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;FROP=friep/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=35/;SECTION=ALL;FROP=43/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=35/;SECTION=/"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL="
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0."
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0.e10"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=.3"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=5t4.3"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0.0"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0.23409823409820938409823"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377/;FROP=34"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;FROP=34"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2010-02-02T12:00:12Z"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous:internal:0ad89fafd79f54afe4523f45aadf2afe"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2011-15-02T00:00:00Z"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous:internal:0ad89fafd79f54afe4523f45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2011-10-02T00:00:00Z",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "/INBOX/;UID=377;EXPIRE=2011-10-02T00:00:00Z"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous:internal:0ad89fafd79f54afe4523f45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;URLAUTH=",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=:internal:0ad89fafd79f54afe4523f45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=user+:internal:0ad89fafd79f54afe4523f45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=+frop:internal:0ad89fafd79f54afe4523f45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;URLAUTH=anonymous:",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous::0ad89fafd79f54afe4523f45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;URLAUTH=anonymous:internal:",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous:internal:fd79f54afe4523",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2011-10-02T00:00:00Z"
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch ";URLAUTH=anonymous:internal:0ad89fafd79f54afe4523q45aadf2afe",
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschunsigned int invalid_url_test_count = N_ELEMENTS(invalid_url_tests);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch unsigned int i;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch for (i = 0; i < invalid_url_test_count; i++) T_BEGIN {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch enum imap_url_parse_flags flags = invalid_url_tests[i].flags;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch struct imap_url *urlb = &invalid_url_tests[i].url_base;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_begin(t_strdup_printf("imap url invalid [%d]", i));
639bb36b12b9f9bb54c8bb1be50eac623622f8a0Timo Sirainen if (imap_url_parse(url, urlb, flags, &urlp, &error) < 0)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch test_out_reason(t_strdup_printf("parse %s", url), urlp == NULL, error);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch static void (*test_functions[])(void) = {