Go to the source code of this file.
|
void | testParseURL (const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true) |
|
void | testHostIsIpAddress (const string &url, const bool expected) |
|
| TEST (ParseURL, HostNoBrackets) |
|
| TEST (ParseURL, FullyFormedURL) |
|
| TEST (ParseURL, ValidNonHttpScheme) |
|
| TEST (ParseURL, InvalidScheme) |
|
| TEST (ParseURL, NoScheme) |
|
| TEST (ParseURL, NoSchemeIP) |
|
| TEST (ParseURL, PathOnly) |
|
| TEST (ParseURL, QueryIsURL) |
|
| TEST (ParseURL, InvalidURL) |
|
| TEST (ParseURL, IsHostIPAddress) |
|
Definition at line 53 of file ParseURLTest.cpp.
References testParseURL().
54 testParseURL(
"http://localhost:80/foo?bar#qqq",
"http",
"/foo",
"bar",
55 "localhost", 80,
"localhost:80");
56 testParseURL(
"http://localhost:80/foo?bar",
"http",
"/foo",
"bar",
57 "localhost", 80,
"localhost:80");
58 testParseURL(
"http://localhost:80/foo",
"http",
"/foo",
"",
59 "localhost", 80,
"localhost:80");
61 "localhost", 80,
"localhost:80");
63 "localhost", 80,
"localhost:80");
65 "localhost", 0,
"localhost");
66 testParseURL(
"http://[2401:db00:2110:3051:face:0:3f:0]/",
"http",
"/",
"",
67 "[2401:db00:2110:3051:face:0:3f:0]", 0,
68 "[2401:db00:2110:3051:face:0:3f:0]");
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 71 of file ParseURLTest.cpp.
References testParseURL().
72 testParseURL(
"https://localhost:80/foo?bar#qqq",
"https",
"/foo",
"bar",
73 "localhost", 80,
"localhost:80");
74 testParseURL(
"rtmp://localhost:80/foo?bar#qqq",
"rtmp",
"/foo",
"bar",
75 "localhost", 80,
"localhost:80");
76 testParseURL(
"ftp://localhost:80/foo?bar#qqq",
"ftp",
"/foo",
"bar",
77 "localhost", 80,
"localhost:80");
78 testParseURL(
"proxygen://localhost:80/foo?bar#qqq",
"proxygen",
"/foo",
"bar",
79 "localhost", 80,
"localhost:80");
80 testParseURL(
"test://localhost:80/foo?bar#qqq",
"test",
"/foo",
"bar",
81 "localhost", 80,
"localhost:80");
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 84 of file ParseURLTest.cpp.
References testParseURL().
85 testParseURL(
"test123://localhost:80",
"",
"",
"",
"", 0,
"",
false);
86 testParseURL(
"test.1://localhost:80",
"",
"",
"",
"", 0,
"",
false);
87 testParseURL(
"://localhost:80",
"",
"",
"",
"", 0,
"",
false);
88 testParseURL(
"123://localhost:80",
"",
"",
"",
"", 0,
"",
false);
89 testParseURL(
"---://localhost:80",
"",
"",
"",
"", 0,
"",
false);
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 92 of file ParseURLTest.cpp.
References testParseURL().
93 testParseURL(
"localhost:80/foo?bar#qqq",
"",
"/foo",
"bar",
94 "localhost", 80,
"localhost:80");
96 "localhost", 80,
"localhost:80");
98 "localhost", 80,
"localhost:80");
100 "localhost", 80,
"localhost:80");
102 "localhost", 80,
"localhost:80");
104 "localhost", 0,
"localhost");
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 107 of file ParseURLTest.cpp.
References testParseURL().
109 "/foo",
"bar",
"1.2.3.4", 54321,
"1.2.3.4:54321");
110 testParseURL(
"[::1]:80/foo?bar",
"",
"/foo",
"bar",
"[::1]", 80,
"[::1]:80");
111 testParseURL(
"[::1]/foo?bar",
"",
"/foo",
"bar",
"[::1]", 0,
"[::1]");
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 114 of file ParseURLTest.cpp.
References testParseURL().
115 testParseURL(
"/f/o/o?bar#qqq",
"",
"/f/o/o",
"bar",
"", 0,
"");
116 testParseURL(
"/f/o/o?bar",
"",
"/f/o/o",
"bar",
"", 0,
"");
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 124 of file ParseURLTest.cpp.
References testParseURL().
125 testParseURL(
"/?ids=http://vlc.afreecodec.com/download/",
"",
126 "/",
"ids=http://vlc.afreecodec.com/download/",
"", 0,
"");
127 testParseURL(
"/plugins/facepile.php?href=http://www.vakan.nl/hotels",
128 "",
"/plugins/facepile.php",
129 "href=http://www.vakan.nl/hotels",
"", 0,
"");
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
Definition at line 132 of file ParseURLTest.cpp.
References testParseURL().
133 testParseURL(
"http://tel:198433511/",
"",
"",
"",
"", 0,
"",
false);
134 testParseURL(
"localhost:80/foo#bar?qqq",
"",
"",
"",
"", 0,
"",
false);
137 testParseURL(
"[::1/foo?bar",
"",
"",
"",
"", 0,
"",
false);
139 testParseURL(
"http://tel:198433511/test\n",
"",
"",
"",
"", 0,
"",
false);
void testParseURL(const string &url, const string &expectedScheme, const string &expectedPath, const string &expectedQuery, const string &expectedHost, const uint16_t expectedPort, const string &expectedAuthority, const bool expectedValid=true)
void testHostIsIpAddress |
( |
const string & |
url, |
|
|
const bool |
expected |
|
) |
| |
void testParseURL |
( |
const string & |
url, |
|
|
const string & |
expectedScheme, |
|
|
const string & |
expectedPath, |
|
|
const string & |
expectedQuery, |
|
|
const string & |
expectedHost, |
|
|
const uint16_t |
expectedPort, |
|
|
const string & |
expectedAuthority, |
|
|
const bool |
expectedValid = true |
|
) |
| |
Definition at line 16 of file ParseURLTest.cpp.
References proxygen::ParseURL::authority(), EXPECT_EQ, proxygen::ParseURL::host(), proxygen::ParseURL::path(), proxygen::ParseURL::port(), proxygen::ParseURL::query(), proxygen::ParseURL::scheme(), proxygen::ParseURL::url(), and proxygen::ParseURL::valid().
Referenced by TEST().
33 EXPECT_EQ(expectedAuthority, u.authority());
#define EXPECT_EQ(val1, val2)