95
95
"//www.apache.org/",
96
96
0, NULL, "www.apache.org", NULL, NULL, "www.apache.org", NULL, "/", NULL, NULL, 0
100
0, "file", NULL, NULL, NULL, NULL, NULL, "image.jpg", NULL, NULL, 0
104
0, "file", NULL, NULL, NULL, NULL, NULL, "/image.jpg", NULL, NULL, 0
108
0, "file", "", NULL, NULL, "", NULL, "/image.jpg", NULL, NULL, 0
111
"file:///tmp/photos/image.jpg",
112
0, "file", "", NULL, NULL, "", NULL, "/tmp/photos/image.jpg", NULL, NULL, 0
116
0, "file", NULL, NULL, NULL, NULL, NULL, "./image.jpg", NULL, NULL, 0
119
"file:../photos/image.jpg",
120
0, "file", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0
100
124
struct uph_test {
182
206
ABTS_ASSERT(tc, msg, rv == t->rv);
183
207
if (t->rv == APR_SUCCESS) {
184
ABTS_STR_EQUAL(tc, info.scheme, t->scheme);
185
ABTS_STR_EQUAL(tc, info.hostinfo, t->hostinfo);
186
ABTS_STR_EQUAL(tc, info.user, t->user);
187
ABTS_STR_EQUAL(tc, info.password, t->password);
188
ABTS_STR_EQUAL(tc, info.hostname, t->hostname);
189
ABTS_STR_EQUAL(tc, info.port_str, t->port_str);
208
ABTS_STR_EQUAL(tc, t->scheme, info.scheme);
209
ABTS_STR_EQUAL(tc, t->hostinfo, info.hostinfo);
210
ABTS_STR_EQUAL(tc, t->user, info.user);
211
ABTS_STR_EQUAL(tc, t->password, info.password);
212
ABTS_STR_EQUAL(tc, t->hostname, info.hostname);
213
ABTS_STR_EQUAL(tc, t->port_str, info.port_str);
214
ABTS_STR_EQUAL(tc, t->path, info.path);
215
ABTS_STR_EQUAL(tc, t->query, info.query);
216
ABTS_STR_EQUAL(tc, t->user, info.user);
217
ABTS_INT_EQUAL(tc, t->port, info.port);
219
s = apr_uri_unparse(p, &info, APR_URI_UNP_REVEALPASSWORD);
220
ABTS_STR_EQUAL(tc, t->uri, s);
222
s = apr_uri_unparse(p, &info, APR_URI_UNP_OMITSITEPART);
223
rv = apr_uri_parse(p, s, &info);
224
ABTS_STR_EQUAL(tc, info.scheme, NULL);
225
ABTS_STR_EQUAL(tc, info.hostinfo, NULL);
226
ABTS_STR_EQUAL(tc, info.user, NULL);
227
ABTS_STR_EQUAL(tc, info.password, NULL);
228
ABTS_STR_EQUAL(tc, info.hostname, NULL);
229
ABTS_STR_EQUAL(tc, info.port_str, NULL);
190
230
ABTS_STR_EQUAL(tc, info.path, t->path);
191
231
ABTS_STR_EQUAL(tc, info.query, t->query);
192
ABTS_STR_EQUAL(tc, info.user, t->user);
193
ABTS_INT_EQUAL(tc, info.port, t->port);
195
s = apr_uri_unparse(p, &info, APR_URI_UNP_REVEALPASSWORD);
196
ABTS_STR_EQUAL(tc, s, t->uri);
232
ABTS_STR_EQUAL(tc, info.user, NULL);
233
ABTS_INT_EQUAL(tc, info.port, 0);
209
246
memset(&info, 0, sizeof(info));
210
247
t = &uph_tests[i];
211
248
rv = apr_uri_parse_hostinfo(p, t->hostinfo, &info);
212
ABTS_INT_EQUAL(tc, rv, t->rv);
249
ABTS_INT_EQUAL(tc, t->rv, rv);
213
250
if (t->rv == APR_SUCCESS) {
214
ABTS_STR_EQUAL(tc, info.hostname, t->hostname);
215
ABTS_STR_EQUAL(tc, info.port_str, t->port_str);
216
ABTS_INT_EQUAL(tc, info.port, t->port);
251
ABTS_STR_EQUAL(tc, t->hostname, info.hostname);
252
ABTS_STR_EQUAL(tc, t->port_str, info.port_str);
253
ABTS_INT_EQUAL(tc, t->port, info.port);