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

@@ -163,7 +163,8 @@ TEST_P(AccountNFTParameterTest, InvalidParams)
TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaHash)
{
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
EXPECT_CALL(*rawBackendPtr, fetchLedgerByHash).Times(1);
@@ -191,7 +192,8 @@ TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaHash)
TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaStringIndex)
{
auto constexpr seq = 12;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -218,7 +220,8 @@ TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaStringIndex)
TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaIntIndex)
{
auto constexpr seq = 12;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1);
@@ -244,7 +247,8 @@ TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaIntIndex)
TEST_F(RPCAccountNFTsHandlerTest, AccountNotFound)
{
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, MAXSEQ);
@@ -297,7 +301,8 @@ TEST_F(RPCAccountNFTsHandlerTest, NormalPath)
ISSUER,
TAXON,
SERIAL);
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, MAXSEQ);
@@ -332,7 +337,8 @@ TEST_F(RPCAccountNFTsHandlerTest, NormalPath)
TEST_F(RPCAccountNFTsHandlerTest, Limit)
{
static auto constexpr limit = 20;
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, MAXSEQ);
@@ -369,7 +375,8 @@ TEST_F(RPCAccountNFTsHandlerTest, Limit)
TEST_F(RPCAccountNFTsHandlerTest, Marker)
{
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, MAXSEQ);
@@ -431,7 +438,8 @@ TEST_F(RPCAccountNFTsHandlerTest, LimitLessThanMin)
TAXON,
SERIAL,
AccountNFTsHandler::LIMIT_MIN);
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, MAXSEQ);
@@ -494,7 +502,8 @@ TEST_F(RPCAccountNFTsHandlerTest, LimitMoreThanMax)
TAXON,
SERIAL,
AccountNFTsHandler::LIMIT_MAX);
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
ASSERT_NE(rawBackendPtr, nullptr);
mockBackendPtr->updateRange(MINSEQ);
mockBackendPtr->updateRange(MAXSEQ);
auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, MAXSEQ);