Lines Matching defs:url
5 #include "imap-url.h"
9 const char *url;
19 .url = "imap://localhost",
23 .url = "imap://user@localhost",
28 .url = "imap://user;AUTH=PLAIN@localhost",
34 .url = "imap://;AUTH=PLAIN@localhost",
39 .url = "imap://%68endri%6B;AUTH=GSS%41PI@%65%78%61%6d%70%6c%65.com",
45 .url = "imap://user@localhost:993",
51 .url = "imap://user@127.0.0.1",
58 .url = "imap://user@[::1]",
65 .url = "imap://user@4example.com:423",
71 .url = "imap://beelzebub@666.4example.com:999",
77 .url = "imap://user@example.com/",
83 .url = "imap://user@example.com/./",
89 .url = "imap://user@example.com/INBOX",
95 .url = "imap://user@example.com/INBOX/",
101 .url = "imap://user@example.com//",
106 .url = "imap://user@example.com/INBOX/Trash",
112 .url = "imap://user@example.com/INBOX/Trash/..",
118 .url = "imap://user@example.com/INBOX/Trash/../",
124 .url = "imap://user@example.com/INBOX/Trash/../..",
130 .url = "imap://user@example.com/INBOX.Trash",
136 .url = "imap://user@example.com/INBOX%3BTrash",
142 .url = "imap://user@example.com/INBOX;UIDVALIDITY=1341",
148 .url = "imap://user@example.com/INBOX/;UIDVALIDITY=23423",
154 .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=6567",
160 .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=788/;UID=16",
167 .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=788/;UID=16/..",
174 .url = "imap://user@example.com/INBOX/Drafts;UIDVALIDITY=788/;UID=16/../..",
181 .url = "imap://user@example.com/INBOX/Junk;UIDVALIDITY=27667/"
189 .url = "imap://user@example.com/INBOX/Important/"
197 .url = "imap://user@example.com/INBOX/Important/;UID=56/;SECTION=AA/BB",
204 .url = "imap://user@example.com/INBOX/Important/;UID=56/;SECTION=AA/BB/..",
211 .url = "imap://user@example.com/INBOX/Important/;UID=56/"
219 .url = "imap://user@example.com/INBOX/Important/;UID=234/"
227 .url = "imap://user@example.com/INBOX/Important/;UID=234/"
235 .url = "imap://hendrik@example.com/INBOX/Important/;UID=34534/"
244 .url = "imap://hendrik@example.com/INBOX/Sent"
252 .url = "//hendrik@example.org/INBOX/Trash",
261 .url = "/INBOX/Trash",
270 .url = "user@example.com",
280 .url = "Drafts",
290 .url = "../Drafts",
300 .url = "../Junk",
312 .url = "../Junk;UIDVALIDITY=23",
324 .url = "../../%23shared;UIDVALIDITY=23452",
336 .url = "../../%23news;UIDVALIDITY=546/;UID=456",
350 .url = "",
362 .url = "",
376 .url = "",
394 .url = "",
410 .url = ";UID=4767",
424 .url = ";UID=4767",
437 .url = "../;UID=4767",
451 .url = "../;UID=4767/;SECTION=TEXT",
467 .url = ";SECTION=TEXT",
483 .url = "..",
498 .url = "../;SECTION=CC",
514 .url = "CC",
530 .url = ";PARTIAL=1024.1024",
546 .url = "../CC/;PARTIAL=0.512",
564 .url = "imap://user@example.com/INBOX/;UID=377;URLAUTH=anonymous",
575 .url = "imap://user@example.com/INBOX/;UID=377"
590 .url = "imap://user@example.com/INBOX/;UID=377"
616 const char *url = valid_url_tests[i].url;
623 test_begin(t_strdup_printf("imap url valid [%d]", i));
626 if (imap_url_parse(url, urlb, flags, &urlp, &error) < 0)
630 valid_url_tests[i].url), urlp != NULL, error);
633 test_out_quiet(t_strdup_printf("url->host.name = %s", urlp->host.name),
636 test_out_quiet(t_strdup_printf("url->host.name = %s", urlp->host.name),
640 test_out_quiet(t_strdup_printf("url->userid = %s", urlp->userid),
643 test_out_quiet(t_strdup_printf("url->userid = %s", urlp->userid),
647 test_out_quiet(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
650 test_out_quiet(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
654 test_out_quiet("url->port = (unspecified)",
657 test_out_quiet(t_strdup_printf("url->port = %u", urlp->port),
661 test_out_quiet("url->host.ip = (unspecified)",
664 test_out_quiet("url->host.ip = (valid)",
668 test_out_quiet(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
671 test_out_quiet(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
674 test_out_quiet(t_strdup_printf("url->uidvalidity = %u", urlp->uidvalidity),
676 test_out_quiet(t_strdup_printf("url->uid = %u", urlp->uid),
679 test_out_quiet(t_strdup_printf("url->section = %s", urlp->section),
682 test_out_quiet(t_strdup_printf("url->section = %s", urlp->section),
685 test_out_quiet(t_strdup_printf("url->partial = %"PRIuUOFF_T".%"PRIuUOFF_T,
691 "url->search_program = %s", urlp->search_program),
695 "url->search_program = %s", urlp->search_program),
701 "url->uauth_rumpurl = %s", urlp->uauth_rumpurl), FALSE);
704 "url->uauth_rumpurl = %s", urlp->uauth_rumpurl),
709 test_out_quiet(t_strdup_printf("url->uauth_access_application = %s",
713 test_out_quiet(t_strdup_printf("url->uauth_access_application = %s",
720 test_out_quiet(t_strdup_printf("url->uauth_access_user = %s",
724 test_out_quiet(t_strdup_printf("url->uauth_access_user = %s",
731 "url->uauth_mechanism = %s", urlp->uauth_mechanism),
735 "url->uauth_mechanism = %s", urlp->uauth_mechanism),
740 "url->uauth_token = %s", urlp->uauth_token),
746 "url->uauth_token_size = %"PRIuSIZE_T, urlp->uauth_token_size),
756 test_out_quiet(t_strdup_printf("url->uauth_token [index=%d]", (int)i),
768 const char *url;
775 .url = "http://www.dovecot.org"
777 .url = "imap:/INBOX"
779 .url = "imap://user@example.com/INBOX",
785 .url = ""
787 .url = "/INBOX/;UID=377"
789 .url = "imap://user@example.com/INBOX/;UID=377/;SECTION=TEXT?ALL"
791 .url = "imap://user@example.com/INBOX/?"
793 .url = "imap://user@example.com/INBOX/#Fragment"
795 .url = "imap://user@example.com/INBOX/\""
797 .url = "imap:///INBOX"
799 .url = "imap://[]/INBOX"
801 .url = "imap://[v08.234:232:234:234:2221]/INBOX"
803 .url = "imap://[1::34a:34:234::6]/INBOX"
805 .url = "imap://example%a.com/INBOX"
807 .url = "imap://example.com%/INBOX"
809 .url = "imap://example%00.com/INBOX"
811 .url = "imap://example.com:65539/INBOX"
813 .url = "imap://user;ATH=frop@example.com"
815 .url = "imap://user;AUTH=frop;friep@example.com"
817 .url = "imap://user;AUTH=@example.com"
819 .url = "imap://user:password@example.com"
821 .url = "imap://user;AUTH=A:B@example.com"
823 .url = "imap://user%@example.com"
825 .url = "imap://user%00@example.com"
827 .url = "imap://user%ar;AUTH=*@example.com"
829 .url = "imap://;AUTH=FR%etD@example.com"
831 .url = "imap://user;AUTH=%@example.com"
833 .url = "imap://user;AUTH=%00@example.com"
835 .url = "imap://example.com/INBOX/%00/"
837 .url = "imap://example.com/INBOX/%0r/"
839 .url = "imap://example.com/INBOX/Trash/%/"
841 .url = "imap://example.com/INBOX;UIDVALIDITY=23423;FROP=friep/"
843 .url = "imap://example.com/INBOX;UIDVALIDITY=0/;UID=377"
845 .url = "imap://example.com/INBOX;UIDVALIDITY=/"
847 .url = "imap://example.com/INBOX;UIDVALIDITY=33a/"
849 .url = "imap://example.com/INBOX;FROP=friep/"
851 .url = "imap://example.com/INBOX/;UID=377;FROP=friep/"
853 .url = "imap://example.com/INBOX/;UID=0/"
855 .url = "imap://example.com/INBOX/;UID=/"
857 .url = "imap://example.com/INBOX/;UID=5e6/"
859 .url = "imap://example.com/INBOX/;UID=35/;SECTION=ALL;FROP=43/"
861 .url = "imap://example.com/INBOX/;UID=35/;SECTION=/"
863 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL="
865 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0."
867 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0.e10"
869 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=.3"
871 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=5t4.3"
873 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0.0"
875 .url = "imap://example.com/INBOX/;UID=34/;PARTIAL=0.23409823409820938409823"
877 .url = "imap://example.com/INBOX/;UID=377/;FROP=34"
879 .url = "imap://example.com/INBOX/;UID=377;FROP=34"
881 .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2010-02-02T12:00:12Z"
883 .url = "imap://example.com/INBOX/;UID=377"
886 .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2011-15-02T00:00:00Z"
890 .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2011-10-02T00:00:00Z",
893 .url = "/INBOX/;UID=377;EXPIRE=2011-10-02T00:00:00Z"
897 .url = "imap://example.com/INBOX/;UID=377;URLAUTH=",
900 .url = "imap://example.com/INBOX/;UID=377"
904 .url = "imap://example.com/INBOX/;UID=377"
908 .url = "imap://example.com/INBOX/;UID=377"
912 .url = "imap://example.com/INBOX/;UID=377;URLAUTH=anonymous:",
915 .url = "imap://example.com/INBOX/;UID=377"
919 .url = "imap://example.com/INBOX/;UID=377;URLAUTH=anonymous:internal:",
922 .url = "imap://example.com/INBOX/;UID=377"
926 .url = "imap://example.com/INBOX/;UID=377;EXPIRE=2011-10-02T00:00:00Z"
939 const char *url = invalid_url_tests[i].url;
948 test_begin(t_strdup_printf("imap url invalid [%d]", i));
950 if (imap_url_parse(url, urlb, flags, &urlp, &error) < 0)
952 test_out_reason(t_strdup_printf("parse %s", url), urlp == NULL, error);
999 const char *url = parse_create_url_tests[i];
1003 test_begin(t_strdup_printf("imap url parse/create [%d]", i));
1006 (url, NULL, IMAP_URL_PARSE_ALLOW_URLAUTH, &urlp, &error) < 0)
1008 test_out_reason(t_strdup_printf("parse %s", url), urlp != NULL, error);
1012 ("create %s", urlnew), strcmp(url, urlnew) == 0);