Skip to content

Commit 358a035

Browse files
committed
also replaced boost::bind by std::bind in test cases now
1 parent a5cb138 commit 358a035

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

http/test/server_async_less_copy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct async_hello_world {
4242
connection->set_headers(boost::make_iterator_range(headers, headers + 4));
4343
std::vector<boost::asio::const_buffer> iovec;
4444
iovec.push_back(boost::asio::const_buffer(hello_world, 13));
45-
connection->write(iovec, boost::bind(&async_hello_world::error, this, _1));
45+
connection->write(iovec, std::bind(&async_hello_world::error, this, _1));
4646
}
4747

4848
void error(boost::system::error_code const& ec) {

http/test/server_async_run_stop_concurrency.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main(int argc, char* argv[]) {
4646
util::thread_pool pool;
4747
async_server server_instance(ASYNC_SERVER_TEST_CONFIG);
4848

49-
boost::thread running_thread(boost::bind(&async_server::run,
49+
boost::thread running_thread(std::bind(&async_server::run,
5050
&server_instance));
5151
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
5252

@@ -60,11 +60,11 @@ int main(int argc, char* argv[]) {
6060
util::thread_pool pool;
6161
async_server server_instance(ASYNC_SERVER_TEST_CONFIG);
6262

63-
boost::thread running_thread(boost::bind(&async_server::run,
63+
boost::thread running_thread(std::bind(&async_server::run,
6464
&server_instance));
6565
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
6666

67-
boost::thread stopping_thread(boost::bind(&async_server::stop,
67+
boost::thread stopping_thread(std::bind(&async_server::stop,
6868
&server_instance));
6969
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
7070

@@ -78,19 +78,19 @@ int main(int argc, char* argv[]) {
7878
util::thread_pool pool;
7979
async_server server_instance(ASYNC_SERVER_TEST_CONFIG);
8080

81-
boost::thread running_thread(boost::bind(&async_server::run,
81+
boost::thread running_thread(std::bind(&async_server::run,
8282
&server_instance));
8383
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
8484

85-
boost::thread stopping_thread(boost::bind(&async_server::stop,
85+
boost::thread stopping_thread(std::bind(&async_server::stop,
8686
&server_instance));
8787
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
8888

89-
boost::thread second_running_thread(boost::bind(&async_server::run,
89+
boost::thread second_running_thread(std::bind(&async_server::run,
9090
&server_instance));
9191
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
9292

93-
boost::thread second_stopping_thread(boost::bind(&async_server::stop,
93+
boost::thread second_stopping_thread(std::bind(&async_server::stop,
9494
&server_instance));
9595
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
9696

@@ -106,15 +106,15 @@ int main(int argc, char* argv[]) {
106106
util::thread_pool pool;
107107
async_server server_instance(ASYNC_SERVER_TEST_CONFIG);
108108

109-
boost::thread running_thread(boost::bind(&async_server::run,
109+
boost::thread running_thread(std::bind(&async_server::run,
110110
&server_instance));
111111
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
112112

113-
boost::thread second_running_thread(boost::bind(&async_server::run,
113+
boost::thread second_running_thread(std::bind(&async_server::run,
114114
&server_instance));
115115
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
116116

117-
boost::thread stopping_thread(boost::bind(&async_server::stop,
117+
boost::thread stopping_thread(std::bind(&async_server::stop,
118118
&server_instance));
119119
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
120120

@@ -129,15 +129,15 @@ int main(int argc, char* argv[]) {
129129
util::thread_pool pool;
130130
async_server server_instance(ASYNC_SERVER_TEST_CONFIG);
131131

132-
boost::thread running_thread(boost::bind(&async_server::run,
132+
boost::thread running_thread(std::bind(&async_server::run,
133133
&server_instance));
134134
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
135135

136-
boost::thread stopping_thread(boost::bind(&async_server::stop,
136+
boost::thread stopping_thread(std::bind(&async_server::stop,
137137
&server_instance));
138138
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
139139

140-
boost::thread second_stopping_thread(boost::bind(&async_server::stop,
140+
boost::thread second_stopping_thread(std::bind(&async_server::stop,
141141
&server_instance));
142142
boost::this_thread::sleep(ASYNC_SERVER_SLEEP_TIME);
143143

http/test/server_include_inlined.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int main(int argc, char* argv[]) {
5151
if (argc > 1)
5252
port = argv[1];
5353
server server_("127.0.0.1", port, handler, http::_reuse_address = true);
54-
boost::thread runner(boost::bind(&server::run, &server_));
54+
boost::thread runner(std::bind(&server::run, &server_));
5555
try {
5656
server_.stop();
5757
runner.join();

mime/test/mime-roundtrip.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
*/
1111

1212
#include <boost/mime.hpp>
13-
#include <boost/bind.hpp>
13+
// #include <boost/bind.hpp>
14+
#include <functional>
1415

1516
#include <boost/test/included/unit_test.hpp>
1617

@@ -83,15 +84,15 @@ using namespace boost::unit_test;
8384
test_suite*
8485
init_unit_test_suite( int argc, char* argv[] )
8586
{
86-
framework::master_test_suite().add ( BOOST_TEST_CASE( boost::bind ( test_roundtrip, "TestMessages/00000001" )));
87-
framework::master_test_suite().add ( BOOST_TEST_CASE( boost::bind ( test_roundtrip, "TestMessages/00000019" )));
88-
framework::master_test_suite().add ( BOOST_TEST_CASE( boost::bind ( test_roundtrip, "TestMessages/00000431" )));
89-
framework::master_test_suite().add ( BOOST_TEST_CASE( boost::bind ( test_roundtrip, "TestMessages/00000975" )));
87+
framework::master_test_suite().add ( BOOST_TEST_CASE( std::bind ( test_roundtrip, "TestMessages/00000001" )));
88+
framework::master_test_suite().add ( BOOST_TEST_CASE( std::bind ( test_roundtrip, "TestMessages/00000019" )));
89+
framework::master_test_suite().add ( BOOST_TEST_CASE( std::bind ( test_roundtrip, "TestMessages/00000431" )));
90+
framework::master_test_suite().add ( BOOST_TEST_CASE( std::bind ( test_roundtrip, "TestMessages/00000975" )));
9091

9192
// Following test is removed because the file it used often tripped false-positives when scanned by virus checkers.
92-
// framework::master_test_suite().add ( BOOST_TEST_CASE( boost::bind ( test_roundtrip, "TestMessages/00001136" )));
93+
// framework::master_test_suite().add ( BOOST_TEST_CASE( std::bind ( test_roundtrip, "TestMessages/00001136" )));
9394

9495
// test cases that fail
95-
// framework::master_test_suite().add ( BOOST_TEST_CASE( boost::bind ( test_roundtrip, "TestMessages/0019-NoBoundary" )));
96+
// framework::master_test_suite().add ( BOOST_TEST_CASE( std::bind ( test_roundtrip, "TestMessages/0019-NoBoundary" )));
9697
return 0;
9798
}

0 commit comments

Comments
 (0)