Add clang tidy (#864)

Fixes #863
This commit is contained in:
Sergey Kuznetsov
2023-10-03 10:43:54 +01:00
committed by GitHub
parent 69f5025a29
commit 4b53bef1f5
198 changed files with 2168 additions and 1288 deletions

View File

@@ -182,7 +182,8 @@ INSTANTIATE_TEST_SUITE_P(
TEST_F(RPCGatewayBalancesHandlerTest, LedgerNotFoundViaStringIndex)
{
auto const seq = 123;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(10); // min
mockBackendPtr->updateRange(300); // max
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -210,7 +211,8 @@ TEST_F(RPCGatewayBalancesHandlerTest, LedgerNotFoundViaStringIndex)
TEST_F(RPCGatewayBalancesHandlerTest, LedgerNotFoundViaIntIndex)
{
auto const seq = 123;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(10); // min
mockBackendPtr->updateRange(300); // max
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -237,7 +239,8 @@ TEST_F(RPCGatewayBalancesHandlerTest, LedgerNotFoundViaIntIndex)
TEST_F(RPCGatewayBalancesHandlerTest, LedgerNotFoundViaHash)
{
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(10); // min
mockBackendPtr->updateRange(300); // max
EXPECT_CALL(*rawBackendPtr, fetchLedgerByHash).Times(1);
@@ -266,7 +269,8 @@ TEST_F(RPCGatewayBalancesHandlerTest, LedgerNotFoundViaHash)
TEST_F(RPCGatewayBalancesHandlerTest, AccountNotFound)
{
auto const seq = 300;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(10); // min
mockBackendPtr->updateRange(seq); // max
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -298,7 +302,8 @@ TEST_F(RPCGatewayBalancesHandlerTest, AccountNotFound)
TEST_F(RPCGatewayBalancesHandlerTest, InvalidHotWallet)
{
auto const seq = 300;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(10); // min
mockBackendPtr->updateRange(seq); // max
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -369,7 +374,8 @@ TEST_P(NormalPathTest, CheckOutput)
{
auto const& bundle = GetParam();
auto const seq = 300;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(10); // min
mockBackendPtr->updateRange(seq); // max
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -419,7 +425,7 @@ generateNormalPathTestBundles()
frozenState.setFieldU32(ripple::sfFlags, ripple::lsfLowFreeze);
auto overflowState = CreateRippleStateLedgerObject("JPY", ISSUER, 50, ACCOUNT, 10, ACCOUNT3, 20, TXNID, 123);
int64_t min64 = -9922966390934554;
int64_t const min64 = -9922966390934554;
overflowState.setFieldAmount(ripple::sfBalance, ripple::STAmount(GetIssue("JPY", ISSUER), min64, 80));
return std::vector<NormalTestBundle>{
NormalTestBundle{