mirror of
https://github.com/XRPLF/clio.git
synced 2026-06-03 16:56:45 +00:00
28 lines
680 B
C++
28 lines
680 B
C++
#include "etl/CorruptionDetector.hpp"
|
|
#include "etl/SystemState.hpp"
|
|
#include "util/MockLedgerCache.hpp"
|
|
#include "util/MockPrometheus.hpp"
|
|
|
|
#include <gmock/gmock.h>
|
|
#include <gtest/gtest.h>
|
|
|
|
using namespace data;
|
|
using namespace util::prometheus;
|
|
using namespace testing;
|
|
|
|
struct CorruptionDetectorTest : WithPrometheus {};
|
|
|
|
TEST_F(CorruptionDetectorTest, DisableCacheOnCorruption)
|
|
{
|
|
using namespace ripple;
|
|
auto state = etl::SystemState{};
|
|
auto cache = MockLedgerCache{};
|
|
auto detector = etl::CorruptionDetector{state, cache};
|
|
|
|
EXPECT_CALL(cache, setDisabled()).Times(1);
|
|
|
|
detector.onCorruptionDetected();
|
|
|
|
EXPECT_TRUE(state.isCorruptionDetected);
|
|
}
|