Move to clang-format-16 (#908)

Fixes #848
This commit is contained in:
Alex Kremer
2023-10-19 16:55:04 +01:00
committed by GitHub
parent 5de87b9ef8
commit 1aab2b94b1
265 changed files with 3950 additions and 4743 deletions

View File

@@ -34,9 +34,7 @@ constexpr static auto NFTID = "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875
constexpr static auto INDEX1 = "E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC321";
constexpr static auto INDEX2 = "E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC322";
class RPCNFTSellOffersHandlerTest : public HandlerBaseTest
{
};
class RPCNFTSellOffersHandlerTest : public HandlerBaseTest {};
TEST_F(RPCNFTSellOffersHandlerTest, LimitNotInt)
{
@@ -47,7 +45,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitNotInt)
"nft_id": "{}",
"limit": "xxx"
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -65,7 +64,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitNegative)
"nft_id": "{}",
"limit": -1
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -83,7 +83,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitZero)
"nft_id": "{}",
"limit": 0
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -101,7 +102,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonHexLedgerHash)
"nft_id": "{}",
"ledger_hash": "xxx"
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -120,7 +122,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonStringLedgerHash)
"nft_id": "{}",
"ledger_hash": 123
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -139,7 +142,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, InvalidLedgerIndexString)
"nft_id": "{}",
"ledger_index": "notvalidated"
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -198,7 +202,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerHash)
"ledger_hash": "{}"
}})",
NFTID,
LEDGERHASH));
LEDGERHASH
));
runSpawn([&, this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -225,7 +230,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerIndex)
"nft_id": "{}",
"ledger_index": "4"
}})",
NFTID));
NFTID
));
runSpawn([&, this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -254,7 +260,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerHash2)
"ledger_hash": "{}"
}})",
NFTID,
LEDGERHASH));
LEDGERHASH
));
runSpawn([&, this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -280,7 +287,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerIndex2)
"nft_id": "{}",
"ledger_index": "31"
}})",
NFTID));
NFTID
));
runSpawn([&, this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -309,7 +317,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NoNFT)
"ledger_hash": "{}"
}})",
NFTID,
LEDGERHASH));
LEDGERHASH
));
runSpawn([&, this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -329,7 +338,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, MarkerNotString)
"nft_id": "{}",
"marker": 9
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -350,7 +360,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, InvalidMarker)
"nft_id": "{}",
"marker": "123invalid"
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -365,7 +376,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, InvalidMarker)
"nft_id": "{}",
"marker": 250
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_FALSE(output);
@@ -423,7 +435,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, DefaultParameters)
R"({{
"nft_id": "{}"
}})",
NFTID));
NFTID
));
runSpawn([&, this](auto yield) {
auto handler = AnyHandler{NFTSellOffersHandler{this->mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -450,8 +463,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, MultipleResultsWithMarkerAndLimitOutput)
auto repetitions = 500;
auto const offer = CreateNFTSellOffer(NFTID, ACCOUNT);
auto idx = ripple::uint256{INDEX1};
while ((repetitions--) != 0)
{
while ((repetitions--) != 0) {
indexes.push_back(idx++);
bbs.push_back(offer.getSerializer().peekData());
}
@@ -468,7 +480,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, MultipleResultsWithMarkerAndLimitOutput)
"nft_id": "{}",
"limit": 50
}})",
NFTID));
NFTID
));
runSpawn([&, this](auto yield) {
auto handler = AnyHandler{NFTSellOffersHandler{this->mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -477,8 +490,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, MultipleResultsWithMarkerAndLimitOutput)
EXPECT_EQ(output->at("offers").as_array().size(), 50);
EXPECT_EQ(output->at("limit").as_uint64(), 50);
EXPECT_STREQ(
output->at("marker").as_string().c_str(),
"E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC353");
output->at("marker").as_string().c_str(), "E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC353"
);
});
}
@@ -499,8 +512,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsForInputWithMarkerAndLimit)
auto repetitions = 500;
auto const offer = CreateNFTSellOffer(NFTID, ACCOUNT);
auto idx = ripple::uint256{INDEX1};
while ((repetitions--) != 0)
{
while ((repetitions--) != 0) {
indexes.push_back(idx++);
bbs.push_back(offer.getSerializer().peekData());
}
@@ -530,7 +542,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsForInputWithMarkerAndLimit)
"marker": "E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC353",
"limit": 50
}})",
NFTID));
NFTID
));
runSpawn([&, this](auto yield) {
auto handler = AnyHandler{NFTSellOffersHandler{this->mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -540,8 +553,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsForInputWithMarkerAndLimit)
EXPECT_EQ(output->at("limit").as_uint64(), 50);
// marker also progressed by 50
EXPECT_STREQ(
output->at("marker").as_string().c_str(),
"E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC385");
output->at("marker").as_string().c_str(), "E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC385"
);
});
}
@@ -563,8 +576,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLim
auto repetitions = 100;
auto const offer = CreateNFTSellOffer(NFTID, ACCOUNT);
auto idx = ripple::uint256{INDEX1};
while ((repetitions--) != 0)
{
while ((repetitions--) != 0) {
indexes.push_back(idx++);
bbs.push_back(offer.getSerializer().peekData());
}
@@ -596,7 +608,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLim
"marker": "E6DBAFC99223B42257915A63DFC6B0C032D4070F9A574B255AD97466726FC353",
"limit": 50
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_TRUE(output);
@@ -613,7 +626,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLim
"nft_id": "{}",
"limit": 49
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_TRUE(output); // todo: check limit?
});
@@ -625,7 +639,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLim
"nft_id": "{}",
"limit": 501
}})",
NFTID));
NFTID
));
auto const output = handler.process(input, Context{yield});
ASSERT_TRUE(output); // todo: check limit?
});
@@ -665,7 +680,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitLessThanMin)
"limit": {}
}})",
NFTID,
NFTSellOffersHandler::LIMIT_MIN - 1));
NFTSellOffersHandler::LIMIT_MIN - 1
));
runSpawn([&, this](auto yield) {
auto handler = AnyHandler{NFTSellOffersHandler{this->mockBackendPtr}};
auto const output = handler.process(input, Context{yield});
@@ -710,7 +726,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitMoreThanMax)
"limit": {}
}})",
NFTID,
NFTSellOffersHandler::LIMIT_MAX + 1));
NFTSellOffersHandler::LIMIT_MAX + 1
));
runSpawn([&, this](auto yield) {
auto handler = AnyHandler{NFTSellOffersHandler{this->mockBackendPtr}};
auto const output = handler.process(input, Context{yield});