Commit 0ba1ca56 authored by Dominik Charousset's avatar Dominik Charousset

Integrate review feedback

parent 66bbe75c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* | |___ / ___ \| _| Framework * * | |___ / ___ \| _| Framework *
* \____/_/ \_|_| * * \____/_/ \_|_| *
* * * *
* Copyright 2011-2019 Dominik Charousset * * Copyright 2011-2020 Dominik Charousset *
* * * *
* Distributed under the terms and conditions of the BSD 3-Clause License or * * Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software * * (at your option) under the terms and conditions of the Boost Software *
......
...@@ -49,7 +49,7 @@ struct fixture { ...@@ -49,7 +49,7 @@ struct fixture {
auto result = T{}; auto result = T{};
binary_deserializer source{nullptr, buf}; binary_deserializer source{nullptr, buf};
if (auto err = source(result)) if (auto err = source(result))
CAF_FAIL("binary_deserializer failed to load: " << to_string(err)); CAF_FAIL("binary_deserializer failed to load: " << err);
return result; return result;
} }
...@@ -57,7 +57,7 @@ struct fixture { ...@@ -57,7 +57,7 @@ struct fixture {
void load(const std::vector<byte>& buf, Ts&... xs) { void load(const std::vector<byte>& buf, Ts&... xs) {
binary_deserializer source{nullptr, buf}; binary_deserializer source{nullptr, buf};
if (auto err = source(xs...)) if (auto err = source(xs...))
CAF_FAIL("binary_deserializer failed to load: " << to_string(err)); CAF_FAIL("binary_deserializer failed to load: " << err);
} }
}; };
......
...@@ -161,7 +161,7 @@ public: ...@@ -161,7 +161,7 @@ public:
byte_buffer buf; byte_buffer buf;
binary_serializer bs{mpx_, buf}; binary_serializer bs{mpx_, buf};
if (auto err = bs(const_cast<message&>(msg))) if (auto err = bs(const_cast<message&>(msg)))
CAF_FAIL("returned to serialize message: " << to_string(err)); CAF_FAIL("returned to serialize message: " << err);
return static_cast<uint32_t>(buf.size()); return static_cast<uint32_t>(buf.size());
} }
...@@ -219,7 +219,7 @@ public: ...@@ -219,7 +219,7 @@ public:
void to_payload(byte_buffer& buf, const Ts&... xs) { void to_payload(byte_buffer& buf, const Ts&... xs) {
binary_serializer sink{mpx_, buf}; binary_serializer sink{mpx_, buf};
if (auto err = sink(xs...)) if (auto err = sink(xs...))
CAF_FAIL("failed to serialize payload: " << to_string(err)); CAF_FAIL("failed to serialize payload: " << err);
} }
void to_buf(byte_buffer& buf, basp::header& hdr, payload_writer* writer) { void to_buf(byte_buffer& buf, basp::header& hdr, payload_writer* writer) {
...@@ -347,7 +347,7 @@ public: ...@@ -347,7 +347,7 @@ public:
{ // lifetime scope of source { // lifetime scope of source
binary_deserializer source{this_->mpx(), ob}; binary_deserializer source{this_->mpx(), ob};
if (auto err = source(hdr)) if (auto err = source(hdr))
CAF_FAIL("unable to deserialize header: " << to_string(err)); CAF_FAIL("unable to deserialize header: " << err);
} }
byte_buffer payload; byte_buffer payload;
if (hdr.payload_len > 0) { if (hdr.payload_len > 0) {
...@@ -484,7 +484,7 @@ CAF_TEST(non_empty_server_handshake) { ...@@ -484,7 +484,7 @@ CAF_TEST(non_empty_server_handshake) {
std::set<std::string> ifs{"caf::replies_to<@u16>::with<@u16>"}; std::set<std::string> ifs{"caf::replies_to<@u16>::with<@u16>"};
binary_serializer sink{nullptr, expected_payload}; binary_serializer sink{nullptr, expected_payload};
if (auto err = sink(instance().this_node(), app_ids, self()->id(), ifs)) if (auto err = sink(instance().this_node(), app_ids, self()->id(), ifs))
CAF_FAIL("serializing handshake failed: " << to_string(err)); CAF_FAIL("serializing handshake failed: " << err);
CAF_CHECK_EQUAL(hexstr(payload), hexstr(expected_payload)); CAF_CHECK_EQUAL(hexstr(payload), hexstr(expected_payload));
} }
...@@ -607,7 +607,7 @@ CAF_TEST(remote_actor_and_send) { ...@@ -607,7 +607,7 @@ CAF_TEST(remote_actor_and_send) {
CAF_REQUIRE(proxy == res); CAF_REQUIRE(proxy == res);
result = actor_cast<actor>(res); result = actor_cast<actor>(res);
}, },
[&](error& err) { CAF_FAIL("error: " << to_string(err)); }); [&](error& err) { CAF_FAIL("error: " << err); });
CAF_MESSAGE("send message to proxy"); CAF_MESSAGE("send message to proxy");
anon_send(actor_cast<actor>(result), 42); anon_send(actor_cast<actor>(result), 42);
mpx()->flush_runnables(); mpx()->flush_runnables();
......
...@@ -50,7 +50,7 @@ struct fixture : test_coordinator_fixture<> { ...@@ -50,7 +50,7 @@ struct fixture : test_coordinator_fixture<> {
byte_buffer buf; byte_buffer buf;
binary_serializer sink{sys, buf}; binary_serializer sink{sys, buf};
if (auto err = sink(x, xs...)) if (auto err = sink(x, xs...))
CAF_FAIL("serialization failed: " << to_string(err)); CAF_FAIL("serialization failed: " << err);
return buf; return buf;
} }
...@@ -58,7 +58,7 @@ struct fixture : test_coordinator_fixture<> { ...@@ -58,7 +58,7 @@ struct fixture : test_coordinator_fixture<> {
void deserialize(const Buffer& buf, T& x, Ts&... xs) { void deserialize(const Buffer& buf, T& x, Ts&... xs) {
binary_deserializer source{sys, buf}; binary_deserializer source{sys, buf};
if (auto err = source(x, xs...)) if (auto err = source(x, xs...))
CAF_FAIL("serialization failed: " << to_string(err)); CAF_FAIL("serialization failed: " << err);
} }
}; };
......
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