Skip to content

Commit 60c2d49

Browse files
committed
Simple server integration test.
1 parent e598c3e commit 60c2d49

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

http/src/http/server.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
#include <utility>
1212
#include <functional>
1313
#include <boost/utility/string_ref.hpp>
14+
#include <http/server/simple_sessions.hpp>
1415

1516
namespace network {
1617
namespace http {
1718

1819
struct dynamic_dispatcher;
19-
struct simple_sessions;
2020
struct no_auth;
2121
struct default_connection_manager;
22+
struct connection;
2223

2324
template <class Handler = dynamic_dispatcher,
2425
class SessionManager = simple_sessions, class Authenticator = no_auth,
@@ -27,8 +28,8 @@ struct basic_server {
2728
void register_handler(
2829
boost::string_ref spec,
2930
std::function<void(
30-
typename SessionManager::session &,
31-
std::shared_ptr<typename ConnectionManager::connection>)> handler);
31+
session &,
32+
std::shared_ptr<connection>)> handler);
3233
};
3334

3435
typedef basic_server<> server;

http/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if (CPP-NETLIB_BUILD_TESTS)
8686
add_test(cpp-netlib-http-client_test
8787
${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-http-${test})
8888

89-
set (SERVER_TESTS server_simple_sessions_test server_dynamic_dispatcher_test)
89+
set (SERVER_TESTS server_simple_sessions_test server_dynamic_dispatcher_test server_test)
9090
foreach (test ${SERVER_TESTS})
9191
add_executable(cpp-netlib-http-${test} ${test}.cpp)
9292
add_dependencies(cpp-netlib-http-${test} cppnetlib-http-server)

http/test/server_test.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2013 (c) Google, Inc.
2+
// Copyright 2013 (c) Dean Michael Berris <dberris@google.com>
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+
#include <gtest/gtest.h>
8+
#include <http/server.hpp>
9+
10+
namespace http = network::http;
11+
namespace net = network;
12+
13+
namespace {
14+
15+
TEST(server_test, constructor) {
16+
http::server server;
17+
(void) server;
18+
}
19+
20+
} // namespace

0 commit comments

Comments
 (0)