Skip to content

Commit

Permalink
disable emplace test
Browse files Browse the repository at this point in the history
emplace requires move assignability which the class in question doesn’t
support.
  • Loading branch information
Peter Thorson committed Mar 5, 2015
1 parent 45dfcbe commit 6300e09
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/logger/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ BOOST_AUTO_TEST_CASE( basic_concurrency ) {

BOOST_AUTO_TEST_CASE( copy_constructor ) {
std::stringstream out;

basic_access_log_type logger1(0xffffffff,&out);
basic_access_log_type logger2(logger1);

logger2.set_channels(0xffffffff);
logger2.write(websocketpp::log::alevel::devel,"devel");
BOOST_CHECK( out.str().size() > 0 );
Expand All @@ -97,45 +97,49 @@ BOOST_AUTO_TEST_CASE( copy_constructor ) {
#ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
BOOST_AUTO_TEST_CASE( move_constructor ) {
std::stringstream out;

basic_access_log_type logger1(0xffffffff,&out);
basic_access_log_type logger2(std::move(logger1));

logger2.set_channels(0xffffffff);
logger2.write(websocketpp::log::alevel::devel,"devel");
BOOST_CHECK( out.str().size() > 0 );
}

BOOST_AUTO_TEST_CASE( emplace ) {
// Emplace requires move assignment, which logger doesn't support right now
// due to const members. This is pretty irritating and will probably result in
// the const members being removed. For now though this test will fail to
// compile
/*BOOST_AUTO_TEST_CASE( emplace ) {
std::stringstream out1;
std::stringstream out2;
std::vector<basic_access_log_type> v;
v.emplace_back(websocketpp::log::level(0xffffffff),&out1);
v.emplace_back(websocketpp::log::level(0xffffffff),&out2);
v[0].set_channels(0xffffffff);
v[1].set_channels(0xffffffff);
v[0].write(websocketpp::log::alevel::devel,"devel");
v[1].write(websocketpp::log::alevel::devel,"devel");
BOOST_CHECK( out1.str().size() > 0 );
BOOST_CHECK( out2.str().size() > 0 );
}
}*/
#endif // #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_

// As long as there are const member variables these can't exist
// These remain commented as they are useful for testing the deleted operators
/*BOOST_AUTO_TEST_CASE( copy_assign ) {
basic_access_log_type logger1;
basic_access_log_type logger2;
logger2 = logger1;
}
BOOST_AUTO_TEST_CASE( move_assign ) {
basic_access_log_type logger1;
basic_access_log_type logger2;
logger2 = std::move(logger1);
}*/
}*/

0 comments on commit 6300e09

Please sign in to comment.