Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1e7c3e

Browse files
committed
Making a change to the test to make the HTTP 1.0 interface pass.
1 parenta8779d8 commita1e7c3e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎libs/network/test/http_1_0_test.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
#include<boost/test/unit_test.hpp>
1010
#include<boost/network/include/http/client.hpp>
1111
#include<iostream>
12+
#include<boost/mpl/integral_c.hpp>
13+
#include<boost/mpl/if.hpp>
1214
#include<boost/mpl/list.hpp>
15+
#include<boost/network/support/is_async.hpp>
1316

1417
usingnamespaceboost::network;
1518

@@ -46,7 +49,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test_timeout, T, tag_types) {
4649
typename client::response response_;
4750
boost::uint16_t port_ =port(request);
4851
BOOST_CHECK_EQUAL (12121, port_ );
49-
BOOST_CHECK_THROW ( response_ = client_.get(request), boost::system::system_error );
52+
BOOST_CHECK_THROW ( response_ = client_.get(request);body(response_);, boost::system::system_error );
5053
}
5154

5255
BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_details, T, tag_types) {
@@ -70,12 +73,21 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_cached_resolve, T, tag_types) {
7073
BOOST_CHECK_NO_THROW ( response_ = client_.get(other_request) );
7174
}
7275

76+
template<classTag>
77+
structstatus_ :
78+
boost::mpl::if_<
79+
boost::network::is_async<Tag>,
80+
boost::mpl::integral_c<boost::uint16_t,301u>,
81+
boost::mpl::integral_c<boost::uint16_t,200u>
82+
>::type
83+
{};
84+
7385
BOOST_AUTO_TEST_CASE_TEMPLATE(http_redirection_test, T, tag_types) {
7486
typedef http::basic_client<T,1,0> client;
7587
typename client::requestrequest("http://boost.org");
7688
clientclient_(client::follow_redirect);
7789
typename client::response response_;
7890
BOOST_CHECK_NO_THROW ( response_ = client_.get(request) );
79-
BOOST_CHECK_EQUAL ( response_.status(),200u );
91+
BOOST_CHECK_EQUAL ( response_.status(),status_<T>::value );
8092
}
8193

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp