X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fsocket_test.cc;h=64c15480841513ed6a90f7ed5410250e89926cb9;hb=b3846a3f0f650ded3019bb4305b63d5675fb9d74;hp=872136a7196c02f2beaed2b4962425e6bee3475a;hpb=387488c4d18ce616e3f0f64e8339ca20b843fb7e;p=dcpomatic.git diff --git a/test/socket_test.cc b/test/socket_test.cc index 872136a71..64c154808 100644 --- a/test/socket_test.cc +++ b/test/socket_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,19 @@ */ -#include "lib/server.h" + #include "lib/dcpomatic_socket.h" +#include "lib/server.h" #include -#include #include -#include +#include #include #include +using std::make_shared; +using std::shared_ptr; using std::string; -using boost::shared_ptr; using boost::bind; @@ -83,7 +84,7 @@ public: } private: - void handle (boost::shared_ptr socket) + void handle (std::shared_ptr socket) { boost::mutex::scoped_lock lm (_mutex); BOOST_REQUIRE (_size); @@ -116,6 +117,7 @@ send (shared_ptr socket, char const* message) socket->write (reinterpret_cast(message), strlen(message) + 1); } + /** Basic test to see if Socket can send and receive data */ BOOST_AUTO_TEST_CASE (socket_basic_test) { @@ -129,7 +131,7 @@ BOOST_AUTO_TEST_CASE (socket_basic_test) tcp::resolver::query query ("127.0.0.1", dcp::raw_convert(TEST_SERVER_PORT)); tcp::resolver::iterator endpoint_iterator = resolver.resolve (query); - shared_ptr socket (new Socket); + auto socket = make_shared(); socket->connect (*endpoint_iterator); send (socket, "Hello world!");