mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
@@ -19,8 +19,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "etl/ETLHelpers.hpp"
|
||||
#include "etl/NetworkValidatedLedgersInterface.hpp"
|
||||
|
||||
#include <boost/signals2/connection.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include <cstdint>
|
||||
@@ -31,6 +32,12 @@ struct MockNetworkValidatedLedgers : public etl::NetworkValidatedLedgersInterfac
|
||||
MOCK_METHOD(void, push, (uint32_t), (override));
|
||||
MOCK_METHOD(std::optional<uint32_t>, getMostRecent, (), (override));
|
||||
MOCK_METHOD(bool, waitUntilValidatedByNetwork, (uint32_t, std::optional<uint32_t>), (override));
|
||||
MOCK_METHOD(
|
||||
boost::signals2::scoped_connection,
|
||||
subscribe,
|
||||
(etl::NetworkValidatedLedgersInterface::SignalType::slot_type const& subscriber),
|
||||
(override)
|
||||
);
|
||||
};
|
||||
|
||||
template <template <typename> typename MockType>
|
||||
|
||||
@@ -48,4 +48,5 @@ struct MockRepeatingOperation {
|
||||
MOCK_METHOD(void, requestStop, (), (const));
|
||||
MOCK_METHOD(void, wait, (), (const));
|
||||
MOCK_METHOD(ValueType, get, (), (const));
|
||||
MOCK_METHOD(void, invoke, (), (const));
|
||||
};
|
||||
|
||||
@@ -41,6 +41,9 @@ struct MockStrand {
|
||||
template <typename T>
|
||||
using StoppableOperation = MockStoppableOperation<T>;
|
||||
|
||||
template <typename T>
|
||||
using RepeatingOperation = MockRepeatingOperation<T>;
|
||||
|
||||
MOCK_METHOD(Operation<std::any> const&, execute, (std::function<std::any()>), (const));
|
||||
MOCK_METHOD(
|
||||
Operation<std::any> const&,
|
||||
@@ -60,4 +63,10 @@ struct MockStrand {
|
||||
(std::function<std::any(util::async::AnyStopToken)>, std::optional<std::chrono::milliseconds>),
|
||||
(const)
|
||||
);
|
||||
MOCK_METHOD(
|
||||
RepeatingOperation<std::any> const&,
|
||||
executeRepeatedly,
|
||||
(std::chrono::milliseconds, std::function<std::any()>),
|
||||
(const)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user