6
6
#define BOOST_TEST_MODULE URL Test
7
7
#include < boost/config/warning_disable.hpp>
8
8
#include < boost/test/unit_test.hpp>
9
+ #include < boost/network/uri.hpp>
9
10
#include < boost/network/uri/uri.hpp>
10
11
#include < boost/network/uri/accessors.hpp>
11
- #include < boost/network/tags.hpp>
12
12
#include < boost/mpl/list.hpp>
13
13
#include < boost/range/algorithm/equal.hpp>
14
14
#include < boost/range/algorithm/copy.hpp>
18
18
19
19
using namespace boost ::network;
20
20
21
-
22
21
typedef boost::mpl::list<
23
- tags::default_string
24
- , tags::default_wstring
25
- > tag_types ;
22
+ uri::uri
23
+ , uri::wuri
24
+ > uri_types ;
26
25
27
26
28
- BOOST_AUTO_TEST_CASE_TEMPLATE (uri_test, T, tag_types ) {
29
- typedef uri::basic_uri<T> uri_type;
27
+ BOOST_AUTO_TEST_CASE_TEMPLATE (uri_test, T, uri_types ) {
28
+ typedef T uri_type;
30
29
typedef typename uri_type::string_type string_type;
31
30
32
31
const std::string url (" http://www.example.com/" );
@@ -41,8 +40,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(uri_test, T, tag_types) {
41
40
BOOST_CHECK (boost::equal (uri::path (instance), path));
42
41
}
43
42
44
- BOOST_AUTO_TEST_CASE_TEMPLATE (full_uri_test, T, tag_types ) {
45
- typedef uri::basic_uri<T> uri_type;
43
+ BOOST_AUTO_TEST_CASE_TEMPLATE (full_uri_test, T, uri_types ) {
44
+ typedef T uri_type;
46
45
typedef typename uri_type::string_type string_type;
47
46
48
47
const std::string url (" http://user:password@www.example.com:80/path?query#fragment" );
@@ -66,8 +65,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(full_uri_test, T, tag_types) {
66
65
BOOST_CHECK (boost::equal (uri::fragment (instance), fragment));
67
66
}
68
67
69
- BOOST_AUTO_TEST_CASE_TEMPLATE (mailto_test, T, tag_types ) {
70
- typedef uri::basic_uri<T> uri_type;
68
+ BOOST_AUTO_TEST_CASE_TEMPLATE (mailto_test, T, uri_types ) {
69
+ typedef T uri_type;
71
70
typedef typename uri_type::string_type string_type;
72
71
73
72
const std::string url (" mailto:john.doe@example.com" );
@@ -81,8 +80,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(mailto_test, T, tag_types) {
81
80
BOOST_CHECK (boost::equal (uri::path (instance), path));
82
81
}
83
82
84
- BOOST_AUTO_TEST_CASE_TEMPLATE (file_test, T, tag_types ) {
85
- typedef uri::basic_uri<T> uri_type;
83
+ BOOST_AUTO_TEST_CASE_TEMPLATE (file_test, T, uri_types ) {
84
+ typedef T uri_type;
86
85
typedef typename uri_type::string_type string_type;
87
86
88
87
const std::string url (" file:///bin/bash" );
@@ -95,8 +94,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(file_test, T, tag_types) {
95
94
BOOST_CHECK (boost::equal (uri::path (instance), path));
96
95
}
97
96
98
- BOOST_AUTO_TEST_CASE_TEMPLATE (xmpp_test, T, tag_types ) {
99
- typedef uri::basic_uri<T> uri_type;
97
+ BOOST_AUTO_TEST_CASE_TEMPLATE (xmpp_test, T, uri_types ) {
98
+ typedef T uri_type;
100
99
typedef typename uri_type::string_type string_type;
101
100
102
101
const std::string url (" xmpp:example-node@example.com?message;subject=Hello%20World" );
@@ -112,8 +111,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(xmpp_test, T, tag_types) {
112
111
BOOST_CHECK (boost::equal (uri::query (instance), query));
113
112
}
114
113
115
- BOOST_AUTO_TEST_CASE_TEMPLATE (ipv4_address_test, T, tag_types ) {
116
- typedef uri::basic_uri<T> uri_type;
114
+ BOOST_AUTO_TEST_CASE_TEMPLATE (ipv4_address_test, T, uri_types ) {
115
+ typedef T uri_type;
117
116
typedef typename uri_type::string_type string_type;
118
117
119
118
const std::string url (" http://129.79.245.252/" );
@@ -128,8 +127,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(ipv4_address_test, T, tag_types) {
128
127
BOOST_CHECK (boost::equal (uri::path (instance), path));
129
128
}
130
129
131
- BOOST_AUTO_TEST_CASE_TEMPLATE (ipv6_address_test_1, T, tag_types ) {
132
- typedef uri::basic_uri<T> uri_type;
130
+ BOOST_AUTO_TEST_CASE_TEMPLATE (ipv6_address_test_1, T, uri_types ) {
131
+ typedef T uri_type;
133
132
typedef typename uri_type::string_type string_type;
134
133
135
134
const std::string url (" http://[1080:0:0:0:8:800:200C:417A]/" );
@@ -144,8 +143,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(ipv6_address_test_1, T, tag_types) {
144
143
BOOST_CHECK (boost::equal (uri::path (instance), path));
145
144
}
146
145
147
- BOOST_AUTO_TEST_CASE_TEMPLATE (ipv6_address_test_2, T, tag_types ) {
148
- typedef uri::basic_uri<T> uri_type;
146
+ BOOST_AUTO_TEST_CASE_TEMPLATE (ipv6_address_test_2, T, uri_types ) {
147
+ typedef T uri_type;
149
148
typedef typename uri_type::string_type string_type;
150
149
151
150
const std::string url (" http://[2001:db8:85a3:8d3:1319:8a2e:370:7348]/" );
@@ -160,8 +159,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(ipv6_address_test_2, T, tag_types) {
160
159
BOOST_CHECK (boost::equal (uri::path (instance), path));
161
160
}
162
161
163
- BOOST_AUTO_TEST_CASE_TEMPLATE (ftp_test, T, tag_types ) {
164
- typedef uri::basic_uri<T> uri_type;
162
+ BOOST_AUTO_TEST_CASE_TEMPLATE (ftp_test, T, uri_types ) {
163
+ typedef T uri_type;
165
164
typedef typename uri_type::string_type string_type;
166
165
167
166
const std::string url (" ftp://john.doe@ftp.example.com/" );
@@ -178,8 +177,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(ftp_test, T, tag_types) {
178
177
BOOST_CHECK (boost::equal (uri::path (instance), path));
179
178
}
180
179
181
- BOOST_AUTO_TEST_CASE_TEMPLATE (news_test, T, tag_types ) {
182
- typedef uri::basic_uri<T> uri_type;
180
+ BOOST_AUTO_TEST_CASE_TEMPLATE (news_test, T, uri_types ) {
181
+ typedef T uri_type;
183
182
typedef typename uri_type::string_type string_type;
184
183
185
184
const std::string url (" news:comp.infosystems.www.servers.unix" );
@@ -192,8 +191,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(news_test, T, tag_types) {
192
191
BOOST_CHECK (boost::equal (uri::path (instance), path));
193
192
}
194
193
195
- BOOST_AUTO_TEST_CASE_TEMPLATE (tel_test, T, tag_types ) {
196
- typedef uri::basic_uri<T> uri_type;
194
+ BOOST_AUTO_TEST_CASE_TEMPLATE (tel_test, T, uri_types ) {
195
+ typedef T uri_type;
197
196
typedef typename uri_type::string_type string_type;
198
197
199
198
const std::string url (" tel:+1-816-555-1212" );
@@ -206,8 +205,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(tel_test, T, tag_types) {
206
205
BOOST_CHECK (boost::equal (uri::path (instance), path));
207
206
}
208
207
209
- BOOST_AUTO_TEST_CASE_TEMPLATE (encoded_uri_test, T, tag_types ) {
210
- typedef uri::basic_uri<T> uri_type;
208
+ BOOST_AUTO_TEST_CASE_TEMPLATE (encoded_uri_test, T, uri_types ) {
209
+ typedef T uri_type;
211
210
typedef typename uri_type::string_type string_type;
212
211
213
212
const std::string url (" http://www.example.com/Path%20With%20%28Some%29%20Encoded%20Characters%21" );
@@ -224,8 +223,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(encoded_uri_test, T, tag_types) {
224
223
BOOST_CHECK (boost::equal (uri::decoded_path (instance), decoded_path));
225
224
}
226
225
227
- BOOST_AUTO_TEST_CASE_TEMPLATE (copy_constructor_test, T, tag_types ) {
228
- typedef uri::basic_uri<T> uri_type;
226
+ BOOST_AUTO_TEST_CASE_TEMPLATE (copy_constructor_test, T, uri_types ) {
227
+ typedef T uri_type;
229
228
typedef typename uri_type::string_type string_type;
230
229
231
230
const std::string url (" http://www.example.com/" );
@@ -235,8 +234,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(copy_constructor_test, T, tag_types) {
235
234
BOOST_CHECK (instance == copy);
236
235
}
237
236
238
- BOOST_AUTO_TEST_CASE_TEMPLATE (assignment_test, T, tag_types ) {
239
- typedef uri::basic_uri<T> uri_type;
237
+ BOOST_AUTO_TEST_CASE_TEMPLATE (assignment_test, T, uri_types ) {
238
+ typedef T uri_type;
240
239
typedef typename uri_type::string_type string_type;
241
240
242
241
const std::string url (" http://www.example.com/" );
@@ -248,8 +247,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(assignment_test, T, tag_types) {
248
247
BOOST_CHECK (instance == copy);
249
248
}
250
249
251
- BOOST_AUTO_TEST_CASE_TEMPLATE (username_test, T, tag_types ) {
252
- typedef uri::basic_uri<T> uri_type;
250
+ BOOST_AUTO_TEST_CASE_TEMPLATE (username_test, T, uri_types ) {
251
+ typedef T uri_type;
253
252
typedef typename uri_type::string_type string_type;
254
253
255
254
const std::string url (" ftp://john.doe:password@ftp.example.com/" );
@@ -263,8 +262,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(username_test, T, tag_types) {
263
262
BOOST_CHECK (boost::equal (uri::password (instance), password));
264
263
}
265
264
266
- BOOST_AUTO_TEST_CASE_TEMPLATE (authority_test, T, tag_types ) {
267
- typedef uri::basic_uri<T> uri_type;
265
+ BOOST_AUTO_TEST_CASE_TEMPLATE (authority_test, T, uri_types ) {
266
+ typedef T uri_type;
268
267
typedef typename uri_type::string_type string_type;
269
268
270
269
const std::string url (" http://user:password@www.example.com:80/path?query#fragment" );
@@ -275,8 +274,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(authority_test, T, tag_types) {
275
274
BOOST_CHECK (boost::equal (uri::authority (instance), authority));
276
275
}
277
276
278
- BOOST_AUTO_TEST_CASE_TEMPLATE (http_query_map_test, T, tag_types ) {
279
- typedef uri::basic_uri<T> uri_type;
277
+ BOOST_AUTO_TEST_CASE_TEMPLATE (http_query_map_test, T, uri_types ) {
278
+ typedef T uri_type;
280
279
typedef typename uri_type::string_type string_type;
281
280
282
281
const std::string url (" http://user:password@www.example.com:80/path?query#fragment" );
@@ -293,8 +292,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_query_map_test, T, tag_types) {
293
292
BOOST_CHECK (boost::equal (queries.begin ()->second , value));
294
293
}
295
294
296
- BOOST_AUTO_TEST_CASE_TEMPLATE (xmpp_query_map_test, T, tag_types ) {
297
- typedef uri::basic_uri<T> uri_type;
295
+ BOOST_AUTO_TEST_CASE_TEMPLATE (xmpp_query_map_test, T, uri_types ) {
296
+ typedef T uri_type;
298
297
typedef typename uri_type::string_type string_type;
299
298
300
299
const std::string url (" xmpp:example-node@example.com?message;subject=Hello%20World" );
@@ -313,9 +312,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(xmpp_query_map_test, T, tag_types) {
313
312
BOOST_CHECK (boost::equal ((++queries.begin ())->second , value_2));
314
313
}
315
314
316
- BOOST_AUTO_TEST_CASE_TEMPLATE (range_test, T, tag_types )
315
+ BOOST_AUTO_TEST_CASE_TEMPLATE (range_test, T, uri_types )
317
316
{
318
- typedef uri::basic_uri<T> uri_type;
317
+ typedef T uri_type;
319
318
typedef typename uri_type::string_type string_type;
320
319
321
320
const std::string url (" http://www.example.com/" );
0 commit comments