Skip to content

Commit 6300e09

Browse files
author
Peter Thorson
committed
disable emplace test
emplace requires move assignability which the class in question doesn’t support.
1 parent 45dfcbe commit 6300e09

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

test/logger/basic.cpp

+16-12
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ BOOST_AUTO_TEST_CASE( basic_concurrency ) {
8585

8686
BOOST_AUTO_TEST_CASE( copy_constructor ) {
8787
std::stringstream out;
88-
88+
8989
basic_access_log_type logger1(0xffffffff,&out);
9090
basic_access_log_type logger2(logger1);
91-
91+
9292
logger2.set_channels(0xffffffff);
9393
logger2.write(websocketpp::log::alevel::devel,"devel");
9494
BOOST_CHECK( out.str().size() > 0 );
@@ -97,45 +97,49 @@ BOOST_AUTO_TEST_CASE( copy_constructor ) {
9797
#ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
9898
BOOST_AUTO_TEST_CASE( move_constructor ) {
9999
std::stringstream out;
100-
100+
101101
basic_access_log_type logger1(0xffffffff,&out);
102102
basic_access_log_type logger2(std::move(logger1));
103-
103+
104104
logger2.set_channels(0xffffffff);
105105
logger2.write(websocketpp::log::alevel::devel,"devel");
106106
BOOST_CHECK( out.str().size() > 0 );
107107
}
108108

109-
BOOST_AUTO_TEST_CASE( emplace ) {
109+
// Emplace requires move assignment, which logger doesn't support right now
110+
// due to const members. This is pretty irritating and will probably result in
111+
// the const members being removed. For now though this test will fail to
112+
// compile
113+
/*BOOST_AUTO_TEST_CASE( emplace ) {
110114
std::stringstream out1;
111115
std::stringstream out2;
112-
116+
113117
std::vector<basic_access_log_type> v;
114-
118+
115119
v.emplace_back(websocketpp::log::level(0xffffffff),&out1);
116120
v.emplace_back(websocketpp::log::level(0xffffffff),&out2);
117-
121+
118122
v[0].set_channels(0xffffffff);
119123
v[1].set_channels(0xffffffff);
120124
v[0].write(websocketpp::log::alevel::devel,"devel");
121125
v[1].write(websocketpp::log::alevel::devel,"devel");
122126
BOOST_CHECK( out1.str().size() > 0 );
123127
BOOST_CHECK( out2.str().size() > 0 );
124-
}
128+
}*/
125129
#endif // #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
126130

127131
// As long as there are const member variables these can't exist
128132
// These remain commented as they are useful for testing the deleted operators
129133
/*BOOST_AUTO_TEST_CASE( copy_assign ) {
130134
basic_access_log_type logger1;
131135
basic_access_log_type logger2;
132-
136+
133137
logger2 = logger1;
134138
}
135139
136140
BOOST_AUTO_TEST_CASE( move_assign ) {
137141
basic_access_log_type logger1;
138142
basic_access_log_type logger2;
139-
143+
140144
logger2 = std::move(logger1);
141-
}*/
145+
}*/

0 commit comments

Comments
 (0)