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
1417using namespace boost ::network;
1518
@@ -46,7 +49,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test_timeout, T, tag_types) {
4649typename client::response response_;
4750 boost::uint16_t port_ =port (request);
4851BOOST_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
5255BOOST_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) {
7073BOOST_CHECK_NO_THROW ( response_ = client_.get (other_request) );
7174}
7275
76+ template <class Tag >
77+ struct status_ :
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+
7385BOOST_AUTO_TEST_CASE_TEMPLATE (http_redirection_test, T, tag_types) {
7486typedef http::basic_client<T,1 ,0 > client;
7587typename client::requestrequest (" http://boost.org" );
7688 clientclient_ (client::follow_redirect);
7789typename client::response response_;
7890BOOST_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