Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix conflicting "using std" declaration with "using boost::thread" #181

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
#

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Wextra -Werror ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Wextra ${CMAKE_CXX_FLAGS}")
# TODO: A better fix should handle ld's --as-needed flag
if(UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker '--no-as-needed'")
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/WireServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ using namespace boost::asio::ip;
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
using namespace boost::asio::local;
#endif
using namespace std;
using namespace testing;
using boost::bind;
using boost::thread;
namespace fs = boost::filesystem;

static const time_duration THREAD_TEST_TIMEOUT = milliseconds(4000);

MATCHER(IsConnected, string(negation ? "is not" : "is") +
" connected") { return arg.good(); }
MATCHER(IsConnected, std::string(negation ? "is not" : "is") + " connected") {
return arg.good();
}

MATCHER(HasTerminated, "") {
return !arg.joinable();
Expand Down Expand Up @@ -55,7 +55,7 @@ MATCHER_P(EventuallyReceives, value, "") {

class MockProtocolHandler : public ProtocolHandler {
public:
MOCK_CONST_METHOD1(handle, string(const string &request));
MOCK_CONST_METHOD1(handle, std::string(const std::string& request));
};

class SocketServerTest : public Test {
Expand Down Expand Up @@ -134,8 +134,8 @@ TEST_F(TCPSocketServerTest, receiveAndSendsSingleLineMassages) {
ASSERT_THAT(client, IsConnected());

// when
client << "1" << flush << "2" << endl << flush;
client << "3" << endl << "4" << endl << flush;
client << "1" << std::flush << "2" << std::endl << std::flush;
client << "3" << std::endl << "4" << std::endl << std::flush;

// then
EXPECT_THAT(client, EventuallyReceives("A"));
Expand Down Expand Up @@ -204,7 +204,7 @@ TEST_F(UnixSocketServerTest, fullLifecycle) {

// traffic flows
stream_protocol::iostream client(socketName);
client << "X" << endl << flush;
client << "X" << std::endl << std::flush;
EXPECT_THAT(client, EventuallyReceives("Y"));

// client disconnection terminates server
Expand Down