mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
refactor: Use expected<void, error> instead of optional<error> (#2565)
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
@@ -48,7 +48,7 @@ struct MockConnectionImpl : web::ng::Connection {
|
||||
|
||||
MOCK_METHOD(void, setTimeout, (std::chrono::steady_clock::duration), (override));
|
||||
|
||||
using SendReturnType = std::optional<web::ng::Error>;
|
||||
using SendReturnType = std::expected<void, web::ng::Error>;
|
||||
MOCK_METHOD(SendReturnType, send, (web::ng::Response, boost::asio::yield_context), (override));
|
||||
|
||||
using ReceiveReturnType = std::expected<web::ng::Request, web::ng::Error>;
|
||||
|
||||
@@ -44,7 +44,7 @@ struct MockHttpConnectionImpl : web::ng::impl::UpgradableConnection {
|
||||
|
||||
MOCK_METHOD(void, setTimeout, (std::chrono::steady_clock::duration), (override));
|
||||
|
||||
using SendReturnType = std::optional<web::ng::Error>;
|
||||
using SendReturnType = std::expected<void, web::ng::Error>;
|
||||
MOCK_METHOD(SendReturnType, send, (web::ng::Response, boost::asio::yield_context), (override));
|
||||
|
||||
MOCK_METHOD(
|
||||
|
||||
@@ -42,7 +42,7 @@ struct MockWsConnectionImpl : web::ng::impl::WsConnectionBase {
|
||||
|
||||
MOCK_METHOD(void, setTimeout, (std::chrono::steady_clock::duration), (override));
|
||||
|
||||
using SendReturnType = std::optional<web::ng::Error>;
|
||||
using SendReturnType = std::expected<void, web::ng::Error>;
|
||||
MOCK_METHOD(SendReturnType, send, (web::ng::Response, boost::asio::yield_context), (override));
|
||||
|
||||
using ReceiveReturnType = std::expected<web::ng::Request, web::ng::Error>;
|
||||
@@ -50,13 +50,7 @@ struct MockWsConnectionImpl : web::ng::impl::WsConnectionBase {
|
||||
|
||||
MOCK_METHOD(void, close, (boost::asio::yield_context), (override));
|
||||
|
||||
using SendBufferReturnType = std::optional<web::ng::Error>;
|
||||
MOCK_METHOD(
|
||||
SendBufferReturnType,
|
||||
sendShared,
|
||||
(std::shared_ptr<std::string>, boost::asio::yield_context),
|
||||
(override)
|
||||
);
|
||||
MOCK_METHOD(SendReturnType, sendShared, (std::shared_ptr<std::string>, boost::asio::yield_context), (override));
|
||||
};
|
||||
|
||||
using MockWsConnection = testing::NiceMock<MockWsConnectionImpl>;
|
||||
|
||||
Reference in New Issue
Block a user