|
| 1 | + |
| 2 | +// Copyright 2010 Dean Michael Berris. |
| 3 | +// Distributed under the Boost Software License, Version 1.0. |
| 4 | +// (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | +// http://www.boost.org/LICENSE_1_0.txt) |
| 6 | + |
| 7 | +#define BOOST_TEST_MODULE HTTP Request Linearize Test |
| 8 | +#include <boost/network/protocol/http/request.hpp> |
| 9 | +#include <boost/network/protocol/http/algorithms/linearize.hpp> |
| 10 | +#include <boost/test/unit_test.hpp> |
| 11 | +#include <boost/mpl/list.hpp> |
| 12 | +#include <iostream> |
| 13 | + |
| 14 | +namespace http = boost::network::http; |
| 15 | +namespace tags = boost::network::http::tags; |
| 16 | +namespace mpl = boost::mpl; |
| 17 | +namespace net = boost::network; |
| 18 | + |
| 19 | +typedef mpl::list< |
| 20 | + tags::http_default_8bit_tcp_resolve |
| 21 | + , tags::http_default_8bit_udp_resolve |
| 22 | + , tags::http_async_8bit_tcp_resolve |
| 23 | + , tags::http_async_8bit_udp_resolve |
| 24 | + > tag_types; |
| 25 | + |
| 26 | +BOOST_AUTO_TEST_CASE_TEMPLATE(linearize_request, T, tag_types) { |
| 27 | + http::basic_request<T> request("http://www.boost.org"); |
| 28 | + linearize(request, "GET", 1, 0, std::ostream_iterator<typename net::char_<T>::type>(std::cout)); |
| 29 | + linearize(request, "GET", 1, 1, std::ostream_iterator<typename net::char_<T>::type>(std::cout)); |
| 30 | +} |
| 31 | + |
0 commit comments