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

Commit60c2d49

Browse files
committed
Simple server integration test.
1 parente598c3e commit60c2d49

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
namespacenetwork {
1617
namespacehttp {
1718

1819
structdynamic_dispatcher;
19-
structsimple_sessions;
2020
structno_auth;
2121
structdefault_connection_manager;
22+
structconnection;
2223

2324
template<classHandler = dynamic_dispatcher,
2425
classSessionManager = simple_sessions,classAuthenticator = no_auth,
@@ -27,8 +28,8 @@ struct basic_server {
2728
voidregister_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_TESTSserver_simple_sessions_testserver_dynamic_dispatcher_test)
89+
set (SERVER_TESTSserver_simple_sessions_testserver_dynamic_dispatcher_testserver_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+
namespacehttp= network::http;
11+
namespacenet= 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)

[8]ページ先頭

©2009-2025 Movatter.jp