Skip to content

Commit 910bd1a

Browse files
committed
Fixing unqualified calls to begin(...) and end(...) causing errors in MSVC.
1 parent 447841f commit 910bd1a

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

libs/network/test/hello_world.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2009 (c) Tarro, Inc.
2-
// Copyright 2009 (c) Dean Michael Berris <mikhailberis@gmail.com>
2+
// Copyright 2009-2010 (c) Dean Michael Berris <mikhailberis@gmail.com>
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)

libs/network/test/http_1_0_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test, T, tag_types) {
2121
http::basic_response<T> response_;
2222
response_ = client_.get(request);
2323
typename headers_range<typename http::basic_response<T> >::type range = headers(response_)["Content-Type"];
24-
BOOST_CHECK ( begin(range) != end(range) );
24+
BOOST_CHECK ( boost::begin(range) != boost::end(range) );
2525
BOOST_CHECK ( body(response_).size() != 0 );
2626
}
2727

@@ -31,7 +31,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test_different_port, T, tag_types) {
3131
http::basic_response<T> response_;
3232
response_ = client_.get(request);
3333
typename headers_range<typename http::basic_response<T> >::type range = headers(response_)["Content-Type"];
34-
BOOST_CHECK ( begin(range) != end(range) );
34+
BOOST_CHECK ( boost::begin(range) != boost::end(range) );
3535
BOOST_CHECK ( body(response_).size() != 0 );
3636
}
3737

libs/network/test/http_1_1_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test, T, tag_types) {
2121
http::basic_response<T> response_;
2222
BOOST_CHECK_NO_THROW ( response_ = client_.get(request) );
2323
typename headers_range<typename http::basic_response<T> >::type range = headers(response_)["Content-Type"];
24-
BOOST_CHECK ( begin(range) != end(range) );
24+
BOOST_CHECK ( boost::begin(range) != boost::end(range) );
2525
BOOST_CHECK ( body(response_).size() != 0 );
2626
}
2727

@@ -31,7 +31,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test_different_port, T, tag_types) {
3131
http::basic_response<T> response_;
3232
BOOST_CHECK_NO_THROW ( response_ = client_.get(request) );
3333
typename headers_range<typename http::basic_response<T> >::type range = headers(response_)["Content-Type"];
34-
BOOST_CHECK ( begin(range) != end(range) );
34+
BOOST_CHECK ( boost::begin(range) != boost::end(range) );
3535
BOOST_CHECK ( body(response_).size() != 0 );
3636
}
3737

libs/network/test/http_localhost_tests.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ BOOST_AUTO_TEST_CASE(text_content_type_test) {
110110
http::client::response response_ = client_.get(request_);
111111
BOOST_REQUIRE(headers(response_).count("Content-type") != 0);
112112
headers_range<http::client::response>::type range = headers(response_)["Content-type"];
113-
BOOST_CHECK(begin(range)->first == "Content-type");
114-
BOOST_CHECK(begin(range)->second == "text/html");
113+
BOOST_CHECK(boost::begin(range)->first == "Content-type");
114+
BOOST_CHECK(boost::begin(range)->second == "text/html");
115115
}
116116

117117
BOOST_AUTO_TEST_CASE(binary_content_type_test) {
@@ -122,8 +122,8 @@ BOOST_AUTO_TEST_CASE(binary_content_type_test) {
122122
http::client::response response_ = client_.get(request_);
123123
BOOST_REQUIRE(headers(response_).count("Content-type") != 0);
124124
headers_range<http::client::response>::type range = headers(response_)["Content-type"];
125-
BOOST_CHECK(begin(range)->first == "Content-type");
126-
BOOST_CHECK(begin(range)->second == "image/jpeg");
125+
BOOST_CHECK(boost::begin(range)->first == "Content-type");
126+
BOOST_CHECK(boost::begin(range)->second == "image/jpeg");
127127
}
128128

129129
BOOST_AUTO_TEST_CASE(content_length_header_test) {
@@ -134,8 +134,8 @@ BOOST_AUTO_TEST_CASE(content_length_header_test) {
134134
http::client::response response_ = client_.get(request_);
135135
BOOST_REQUIRE(headers(response_).count("Content-Length") != 0);
136136
headers_range<http::client::response>::type range = headers(response_)["Content-Length"];
137-
BOOST_CHECK_EQUAL(begin(range)->first, "Content-Length");
138-
BOOST_CHECK_EQUAL(begin(range)->second, "113");
137+
BOOST_CHECK_EQUAL(boost::begin(range)->first, "Content-Length");
138+
BOOST_CHECK_EQUAL(boost::begin(range)->second, "113");
139139
BOOST_CHECK(body(response_).length() != 0);
140140
}
141141

@@ -223,10 +223,10 @@ BOOST_AUTO_TEST_CASE(cgi_multi_line_headers) {
223223
BOOST_CHECK(body(r).length() != 0);
224224
BOOST_CHECK(boost::empty(headers(r)["Content-Type"]));
225225
headers_range<http::client::response>::type range=headers(r)["X-CppNetlib-Test"];
226-
BOOST_REQUIRE(begin(range) != end(range));
226+
BOOST_REQUIRE(boost::begin(range) != boost::end(range));
227227
BOOST_REQUIRE(distance(range) == 2);
228-
BOOST_CHECK_EQUAL(begin(range)->second, std::string("multi-line-header"));
229-
BOOST_CHECK_EQUAL((++begin(range))->second, std::string("that-should-concatenate"));
228+
BOOST_CHECK_EQUAL(boost::begin(range)->second, std::string("multi-line-header"));
229+
BOOST_CHECK_EQUAL((++boost::begin(range))->second, std::string("that-should-concatenate"));
230230
}
231231

232232
BOOST_AUTO_TEST_CASE(file_not_found) {
@@ -248,8 +248,8 @@ BOOST_AUTO_TEST_CASE(head_test) {
248248
http::client::response response_ = client_.head(request_);
249249
BOOST_REQUIRE(headers(response_).count("Content-Length") != 0);
250250
headers_range<http::client::response>::type range = headers(response_)["Content-Length"];
251-
BOOST_CHECK_EQUAL(begin(range)->first, "Content-Length");
252-
BOOST_CHECK_EQUAL(begin(range)->second, "113");
251+
BOOST_CHECK_EQUAL(boost::begin(range)->first, "Content-Length");
252+
BOOST_CHECK_EQUAL(boost::begin(range)->second, "113");
253253
BOOST_CHECK(body(response_).length() == 0);
254254
}
255255

libs/network/test/https_localhost_tests.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ BOOST_AUTO_TEST_CASE(text_content_type_test) {
110110
http::client::response response_ = client_.get(request_);
111111
BOOST_REQUIRE(headers(response_).count("Content-type") != 0);
112112
headers_range<http::client::response>::type range = headers(response_)["Content-type"];
113-
BOOST_CHECK(begin(range)->first == "Content-type");
114-
BOOST_CHECK(begin(range)->second == "text/html");
113+
BOOST_CHECK(boost::begin(range)->first == "Content-type");
114+
BOOST_CHECK(boost::begin(range)->second == "text/html");
115115
}
116116

117117
BOOST_AUTO_TEST_CASE(binary_content_type_test) {
@@ -122,8 +122,8 @@ BOOST_AUTO_TEST_CASE(binary_content_type_test) {
122122
http::client::response response_ = client_.get(request_);
123123
BOOST_REQUIRE(headers(response_).count("Content-type") != 0);
124124
headers_range<http::client::response>::type range = headers(response_)["Content-type"];
125-
BOOST_CHECK(begin(range)->first == "Content-type");
126-
BOOST_CHECK(begin(range)->second == "image/jpeg");
125+
BOOST_CHECK(boost::begin(range)->first == "Content-type");
126+
BOOST_CHECK(boost::begin(range)->second == "image/jpeg");
127127
}
128128

129129
BOOST_AUTO_TEST_CASE(content_length_header_test) {
@@ -134,8 +134,8 @@ BOOST_AUTO_TEST_CASE(content_length_header_test) {
134134
http::client::response response_ = client_.get(request_);
135135
BOOST_REQUIRE(headers(response_).count("Content-Length") != 0);
136136
headers_range<http::client::response>::type range = headers(response_)["Content-Length"];
137-
BOOST_CHECK_EQUAL(begin(range)->first, "Content-Length");
138-
BOOST_CHECK_EQUAL(begin(range)->second, "113");
137+
BOOST_CHECK_EQUAL(boost::begin(range)->first, "Content-Length");
138+
BOOST_CHECK_EQUAL(boost::begin(range)->second, "113");
139139
BOOST_CHECK(body(response_).length() != 0);
140140
}
141141

@@ -223,10 +223,10 @@ BOOST_AUTO_TEST_CASE(binary_file_query) {
223223
// BOOST_CHECK(body(r).length() != 0);
224224
// BOOST_CHECK(headers(r)["Content-Type"].begin() != headers(r)["Content-Type"].end());
225225
// headers_range<http::client::response>::type range=headers(r)["X-CppNetlib-Test"];
226-
// BOOST_REQUIRE(begin(range) != end(range));
226+
// BOOST_REQUIRE(boost::begin(range) != boost::end(range));
227227
// BOOST_REQUIRE(distance(range) == 2);
228-
// BOOST_CHECK_EQUAL(begin(range)->second, std::string("multi-line-header"));
229-
// BOOST_CHECK_EQUAL((++begin(range))->second, std::string("that-should-concatenate"));
228+
// BOOST_CHECK_EQUAL(boost::begin(range)->second, std::string("multi-line-header"));
229+
// BOOST_CHECK_EQUAL((++boost::begin(range))->second, std::string("that-should-concatenate"));
230230
//}
231231

232232
BOOST_AUTO_TEST_CASE(file_not_found) {
@@ -248,8 +248,8 @@ BOOST_AUTO_TEST_CASE(head_test) {
248248
http::client::response response_ = client_.head(request_);
249249
BOOST_REQUIRE(headers(response_).count("Content-Length") != 0);
250250
headers_range<http::client::response>::type range = headers(response_)["Content-Length"];
251-
BOOST_CHECK_EQUAL(begin(range)->first, "Content-Length");
252-
BOOST_CHECK_EQUAL(begin(range)->second, "113");
251+
BOOST_CHECK_EQUAL(boost::begin(range)->first, "Content-Length");
252+
BOOST_CHECK_EQUAL(boost::begin(range)->second, "113");
253253
BOOST_CHECK(body(response_).length() == 0);
254254
}
255255

libs/network/test/message_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(copy_constructor_test, T, tag_types) {
117117
basic_message<T> copy(instance);
118118
BOOST_CHECK_EQUAL(headers(copy).count(header_name<T>::string), static_cast<std::size_t>(1));
119119
typename headers_range<basic_message<T> >::type range = headers(copy)[header_name<T>::string];
120-
BOOST_CHECK (begin(range) != end(range));
120+
BOOST_CHECK (boost::begin(range) != boost::end(range));
121121
}
122122

123123
BOOST_AUTO_TEST_CASE_TEMPLATE(swap_test, T, tag_types) {
@@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(headers_directive_test, T, tag_types) {
134134
instance << header(header_name<T>::string, header_value<T>::string);
135135
BOOST_CHECK_EQUAL ( headers(instance).count(header_name<T>::string), static_cast<std::size_t>(1) );
136136
typename headers_range<basic_message<T> >::type range = headers(instance)[header_name<T>::string];
137-
BOOST_CHECK (begin(range) != end(range));
137+
BOOST_CHECK (boost::begin(range) != boost::end(range));
138138
}
139139

140140
BOOST_AUTO_TEST_CASE_TEMPLATE(body_directive_test, T, tag_types) {
@@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(remove_header_directive_test, T, tag_types) {
160160
instance << header(header_name<T>::string, header_value<T>::string)
161161
<< remove_header(header_name<T>::string);
162162
typename headers_range<basic_message<T> >::type range = headers(instance);
163-
BOOST_CHECK ( begin(range) == end(range) );
163+
BOOST_CHECK ( boost::begin(range) == boost::end(range) );
164164
}
165165

166166

0 commit comments

Comments
 (0)