Commit c2f54dbd authored by Dominik Charousset's avatar Dominik Charousset

Fix build in C++17 mode

parent 6ebea452
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "caf/optional.hpp" #include "caf/optional.hpp"
using namespace std;
using namespace caf; using namespace caf;
namespace { namespace {
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#define ERROR_HANDLER \ #define ERROR_HANDLER \
[&](error& err) { CAF_FAIL(system.render(err)); } [&](error& err) { CAF_FAIL(system.render(err)); }
using namespace std; using std::string;
using namespace caf; using namespace caf;
using passed_atom = caf::atom_constant<caf::atom("passed")>; using passed_atom = caf::atom_constant<caf::atom("passed")>;
...@@ -423,7 +424,7 @@ CAF_TEST(event_testee_series) { ...@@ -423,7 +424,7 @@ CAF_TEST(event_testee_series) {
[&](const string& str) { [&](const string& str) {
result = str; result = str;
}, },
after(chrono::minutes(1)) >> [&] { after(std::chrono::minutes(1)) >> [&] {
CAF_FAIL("event_testee does not reply"); CAF_FAIL("event_testee does not reply");
} }
); );
...@@ -435,7 +436,7 @@ CAF_TEST(string_delegator_chain) { ...@@ -435,7 +436,7 @@ CAF_TEST(string_delegator_chain) {
auto aut = self->spawn<monitored>(string_delegator, auto aut = self->spawn<monitored>(string_delegator,
system.spawn(string_reverter), system.spawn(string_reverter),
true); true);
set<string> iface{"caf::replies_to<@str>::with<@str>"}; std::set<string> iface{"caf::replies_to<@str>::with<@str>"};
CAF_CHECK_EQUAL(aut->message_types(), iface); CAF_CHECK_EQUAL(aut->message_types(), iface);
self->request(aut, infinite, "Hello World!").receive( self->request(aut, infinite, "Hello World!").receive(
[](const string& answer) { [](const string& answer) {
......
...@@ -33,6 +33,14 @@ ...@@ -33,6 +33,14 @@
#include "caf/all.hpp" #include "caf/all.hpp"
#include "caf/io/all.hpp" #include "caf/io/all.hpp"
#include "caf/deep_to_string.hpp"
#include "caf/io/network/interfaces.hpp"
#include "caf/io/network/test_multiplexer.hpp"
using namespace caf;
using namespace caf::io;
namespace { namespace {
using caf::make_message_id; using caf::make_message_id;
...@@ -72,14 +80,6 @@ constexpr auto basp_atom = caf::atom("BASP"); ...@@ -72,14 +80,6 @@ constexpr auto basp_atom = caf::atom("BASP");
constexpr auto spawn_serv_atom = caf::atom("SpawnServ"); constexpr auto spawn_serv_atom = caf::atom("SpawnServ");
constexpr auto config_serv_atom = caf::atom("ConfigServ"); constexpr auto config_serv_atom = caf::atom("ConfigServ");
} // namespace
using namespace std;
using namespace caf;
using namespace caf::io;
namespace {
constexpr uint32_t num_remote_nodes = 2; constexpr uint32_t num_remote_nodes = 2;
using buffer = std::vector<char>; using buffer = std::vector<char>;
...@@ -259,10 +259,9 @@ public: ...@@ -259,10 +259,9 @@ public:
return {hdr, std::move(payload)}; return {hdr, std::move(payload)};
} }
void connect_node( void connect_node(node& n, optional<accept_handle> ax = none,
node& n, optional<accept_handle> ax = none,
actor_id published_actor_id = invalid_actor_id, actor_id published_actor_id = invalid_actor_id,
const set<string>& published_actor_ifs = std::set<std::string>{}) { const std::set<std::string>& published_actor_ifs = {}) {
auto src = ax ? *ax : ahdl_; auto src = ax ? *ax : ahdl_;
CAF_MESSAGE("connect remote node " CAF_MESSAGE("connect remote node "
<< n.name << ", connection ID = " << n.connection.id() << n.name << ", connection ID = " << n.connection.id()
...@@ -412,8 +411,8 @@ private: ...@@ -412,8 +411,8 @@ private:
accept_handle ahdl_; accept_handle ahdl_;
network::test_multiplexer* mpx_; network::test_multiplexer* mpx_;
node_id this_node_; node_id this_node_;
unique_ptr<scoped_actor> self_; std::unique_ptr<scoped_actor> self_;
array<node, num_remote_nodes> nodes_; std::array<node, num_remote_nodes> nodes_;
/* /*
array<node_id, num_remote_nodes> remote_node_; array<node_id, num_remote_nodes> remote_node_;
array<connection_handle, num_remote_nodes> remote_hdl_; array<connection_handle, num_remote_nodes> remote_hdl_;
...@@ -493,7 +492,7 @@ CAF_TEST(non_empty_server_handshake) { ...@@ -493,7 +492,7 @@ CAF_TEST(non_empty_server_handshake) {
buffer expected_payload; buffer expected_payload;
binary_serializer bd{nullptr, expected_payload}; binary_serializer bd{nullptr, expected_payload};
bd(instance().this_node(), defaults::middleman::app_identifiers, self()->id(), bd(instance().this_node(), defaults::middleman::app_identifiers, self()->id(),
set<string>{"caf::replies_to<@u16>::with<@u16>"}); std::set<std::string>{"caf::replies_to<@u16>::with<@u16>"});
CAF_CHECK_EQUAL(hexstr(payload), hexstr(expected_payload)); CAF_CHECK_EQUAL(hexstr(payload), hexstr(expected_payload));
} }
...@@ -633,7 +632,7 @@ CAF_TEST(remote_actor_and_send) { ...@@ -633,7 +632,7 @@ CAF_TEST(remote_actor_and_send) {
{basp::message_type::direct_message, 0, 0, 0, {basp::message_type::direct_message, 0, 0, 0,
jupiter().dummy_actor->id(), self()->id()}, jupiter().dummy_actor->id(), self()->id()},
std::vector<strong_actor_ptr>{}, make_message("hi there!")); std::vector<strong_actor_ptr>{}, make_message("hi there!"));
self()->receive([&](const string& str) { self()->receive([&](const std::string& str) {
CAF_CHECK_EQUAL(to_string(self()->current_sender()), to_string(result)); CAF_CHECK_EQUAL(to_string(self()->current_sender()), to_string(result));
CAF_CHECK_EQUAL(self()->current_sender(), result.address()); CAF_CHECK_EQUAL(self()->current_sender(), result.address());
CAF_CHECK_EQUAL(str, "hi there!"); CAF_CHECK_EQUAL(str, "hi there!");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment