mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 09:16:47 +00:00
refactor: Enable more clang-tidy readability checks (#6595)
Co-authored-by: Sergey Kuznetsov <kuzzz99@gmail.com>
This commit is contained in:
@@ -11,13 +11,13 @@ namespace test {
|
||||
|
||||
class OfferBaseUtil_test : public beast::unit_test::suite
|
||||
{
|
||||
XRPAmount
|
||||
static XRPAmount
|
||||
reserve(jtx::Env& env, std::uint32_t count)
|
||||
{
|
||||
return env.current()->fees().accountReserve(count);
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
static std::uint32_t
|
||||
lastClose(jtx::Env& env)
|
||||
{
|
||||
return env.current()->header().parentCloseTime.time_since_epoch().count();
|
||||
@@ -2253,7 +2253,7 @@ public:
|
||||
|
||||
// The gateway optionally creates an offer that would be crossed.
|
||||
auto const book = t.bookAmount;
|
||||
if (book)
|
||||
if (book != 0)
|
||||
env(offer(gw, XRP(book), USD(book)));
|
||||
env.close();
|
||||
std::uint32_t const gwOfferSeq = env.seq(gw) - 1;
|
||||
@@ -2285,7 +2285,7 @@ public:
|
||||
|
||||
auto acctOffers = offersOnAccount(env, acct);
|
||||
BEAST_EXPECT(acctOffers.size() == t.offers);
|
||||
if (!acctOffers.empty() && t.offers)
|
||||
if (!acctOffers.empty() && (t.offers != 0))
|
||||
{
|
||||
auto const& acctOffer = *(acctOffers.front());
|
||||
|
||||
@@ -2296,7 +2296,7 @@ public:
|
||||
|
||||
if (t.preTrust == noPreTrust)
|
||||
{
|
||||
if (t.balanceUsd.value().signum())
|
||||
if (t.balanceUsd.value().signum() != 0)
|
||||
{
|
||||
// Verify the correct contents of the trustline
|
||||
verifyDefaultTrustline(env, acct, t.balanceUsd);
|
||||
@@ -2773,7 +2773,7 @@ public:
|
||||
env.require(offers(acct, t.offers));
|
||||
env.require(owners(acct, t.owners));
|
||||
|
||||
if (t.offers)
|
||||
if (t.offers != 0)
|
||||
{
|
||||
auto const acctOffers = offersOnAccount(env, acct);
|
||||
if (!acctOffers.empty())
|
||||
@@ -3875,10 +3875,10 @@ public:
|
||||
// clang-format off
|
||||
TestData const tests[]{
|
||||
// btcStart --------------------- actor[0] --------------------- -------------------- actor[1] -------------------
|
||||
{0, 0, 1, BTC(20), {{"ann", 0, drops(3900000'000000 - 4 * baseFee), BTC(20.0), USD(3000)}, {"abe", 0, drops(4100000'000000 - 3 * baseFee), BTC( 0), USD(750)}}}, // no BTC xfer fee
|
||||
{0, 1, 0, BTC(20), {{"bev", 0, drops(4100000'000000 - 4 * baseFee), BTC( 7.5), USD(2000)}, {"bob", 0, drops(3900000'000000 - 3 * baseFee), BTC(10), USD( 0)}}}, // no USD xfer fee
|
||||
{0, 0, 0, BTC(20), {{"cam", 0, drops(4000000'000000 - 5 * baseFee), BTC(20.0), USD(2000)} }}, // no xfer fee
|
||||
{0, 1, 0, BTC( 5), {{"deb", 1, drops(4040000'000000 - 4 * baseFee), BTC( 0.0), USD(2000)}, {"dan", 1, drops(3960000'000000 - 3 * baseFee), BTC( 4), USD( 0)}}}, // no USD xfer fee
|
||||
{0, 0, 1, BTC(20), {{"ann", 0, drops(3900000'000000 - (4 * baseFee)), BTC(20.0), USD(3000)}, {"abe", 0, drops(4100000'000000 - (3 * baseFee)), BTC( 0), USD(750)}}}, // no BTC xfer fee
|
||||
{0, 1, 0, BTC(20), {{"bev", 0, drops(4100000'000000 - (4 * baseFee)), BTC( 7.5), USD(2000)}, {"bob", 0, drops(3900000'000000 - (3 * baseFee)), BTC(10), USD( 0)}}}, // no USD xfer fee
|
||||
{0, 0, 0, BTC(20), {{"cam", 0, drops(4000000'000000 - (5 * baseFee)), BTC(20.0), USD(2000)} }}, // no xfer fee
|
||||
{0, 1, 0, BTC( 5), {{"deb", 1, drops(4040000'000000 - (4 * baseFee)), BTC( 0.0), USD(2000)}, {"dan", 1, drops(3960000'000000 - (3 * baseFee)), BTC( 4), USD( 0)}}}, // no USD xfer fee
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -4026,8 +4026,8 @@ public:
|
||||
// clang-format off
|
||||
TestData const tests[]{
|
||||
// btcStart ------------------- actor[0] -------------------- ------------------- actor[1] --------------------
|
||||
{0, 0, 1, BTC(5), {{"gay", 1, drops(3950000'000000 - 4 * baseFee), BTC(5), USD(2500)}, {"gar", 1, drops(4050000'000000 - 3 * baseFee), BTC(0), USD(1375)}}}, // no BTC xfer fee
|
||||
{0, 0, 0, BTC(5), {{"hye", 2, drops(4000000'000000 - 5 * baseFee), BTC(5), USD(2000)} }} // no xfer fee
|
||||
{0, 0, 1, BTC(5), {{"gay", 1, drops(3950000'000000 - (4 * baseFee)), BTC(5), USD(2500)}, {"gar", 1, drops(4050000'000000 - (3 * baseFee)), BTC(0), USD(1375)}}}, // no BTC xfer fee
|
||||
{0, 0, 0, BTC(5), {{"hye", 2, drops(4000000'000000 - (5 * baseFee)), BTC(5), USD(2000)} }} // no xfer fee
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
Reference in New Issue
Block a user