|
| 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 Server Construtor Tests |
| 8 | + |
| 9 | +#include <boost/network/include/http/server.hpp> |
| 10 | +#include <boost/test/unit_test.hpp> |
| 11 | + |
| 12 | +namespace http = boost::network::http; |
| 13 | +namespace util = boost::network::utils; |
| 14 | + |
| 15 | +struct dummy_sync_handler; |
| 16 | +struct dummy_async_handler; |
| 17 | +typedef http::server<dummy_sync_handler> sync_server; |
| 18 | +typedef http::async_server<dummy_async_handler> async_server; |
| 19 | + |
| 20 | +struct dummy_sync_handler { |
| 21 | + void operator()(sync_server::request const & req, |
| 22 | + sync_server::response & res) { |
| 23 | + // Really, this is just for testing purposes |
| 24 | + } |
| 25 | + |
| 26 | + void log(char const *) { |
| 27 | + } |
| 28 | +}; |
| 29 | + |
| 30 | +struct dummy_async_handler { |
| 31 | + void operator()(async_server::request const & req, |
| 32 | + async_server::connection_ptr conn) { |
| 33 | + // Really, this is just for testing purposes |
| 34 | + } |
| 35 | +}; |
| 36 | + |
| 37 | +BOOST_AUTO_TEST_CASE(minimal_constructor) { |
| 38 | + dummy_sync_handler sync_handler; |
| 39 | + dummy_async_handler async_handler; |
| 40 | + util::thread_pool pool; |
| 41 | + |
| 42 | + BOOST_CHECK_NO_THROW(sync_server sync_instance("127.0.0.1", "80", sync_handler) ); |
| 43 | + BOOST_CHECK_NO_THROW(async_server async_instance("127.0.0.1", "80", async_handler, pool) ); |
| 44 | +} |
| 45 | + |
| 46 | +BOOST_AUTO_TEST_CASE(with_io_service_parameter) { |
| 47 | +} |
| 48 | + |
| 49 | +BOOST_AUTO_TEST_CASE(with_socket_options_parameter) { |
| 50 | +} |
0 commit comments