aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/epee_levin_protocol_handler_async.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/epee_levin_protocol_handler_async.cpp')
-rw-r--r--tests/unit_tests/epee_levin_protocol_handler_async.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/unit_tests/epee_levin_protocol_handler_async.cpp b/tests/unit_tests/epee_levin_protocol_handler_async.cpp
index 314fcf9f2..ab6791324 100644
--- a/tests/unit_tests/epee_levin_protocol_handler_async.cpp
+++ b/tests/unit_tests/epee_levin_protocol_handler_async.cpp
@@ -56,13 +56,13 @@ namespace
{
}
- virtual int invoke(int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, test_levin_connection_context& context)
+ virtual int invoke(int command, const epee::span<const uint8_t> in_buff, epee::byte_slice& buff_out, test_levin_connection_context& context)
{
m_invoke_counter.inc();
boost::unique_lock<boost::mutex> lock(m_mutex);
m_last_command = command;
m_last_in_buf = std::string((const char*)in_buff.data(), in_buff.size());
- buff_out = m_invoke_out_buf;
+ buff_out = m_invoke_out_buf.clone();
return m_return_code;
}
@@ -102,8 +102,7 @@ namespace
int return_code() const { return m_return_code; }
void return_code(int v) { m_return_code = v; }
- const std::string& invoke_out_buf() const { return m_invoke_out_buf; }
- void invoke_out_buf(const std::string& v) { m_invoke_out_buf = v; }
+ void invoke_out_buf(std::string v) { m_invoke_out_buf = epee::byte_slice{std::move(v)}; }
int last_command() const { return m_last_command; }
const std::string& last_in_buf() const { return m_last_in_buf; }
@@ -118,7 +117,7 @@ namespace
boost::mutex m_mutex;
int m_return_code;
- std::string m_invoke_out_buf;
+ epee::byte_slice m_invoke_out_buf;
int m_last_command;
std::string m_last_in_buf;