mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-09 19:56:46 +00:00
chore: Enable clang-tidy modernize checks (#6975)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com> Co-authored-by: Bart <bthomee@users.noreply.github.com>
This commit is contained in:
@@ -41,8 +41,7 @@
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
namespace xrpl {
|
||||
namespace test {
|
||||
namespace xrpl::test {
|
||||
|
||||
struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
@@ -1014,13 +1013,17 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) != aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), aa) != aod.end());
|
||||
}
|
||||
|
||||
{
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), aa) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), aa) != iod.end());
|
||||
}
|
||||
|
||||
env(escrow::create(bob, bob, USD(1'000)),
|
||||
@@ -1035,13 +1038,17 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
}
|
||||
|
||||
{
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 5);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), bb) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), bb) != iod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -1053,15 +1060,21 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), aa) == aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), bb) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), bb) != iod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -1073,11 +1086,15 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bb) == bod.end());
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), bb) == iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), bb) == iod.end());
|
||||
}
|
||||
}
|
||||
{
|
||||
@@ -1116,21 +1133,33 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) != aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ab) != aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 3);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) != bod.end());
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), ab) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(cod.begin(), cod.end(), bc) != cod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(cod.begin(), cod.end(), bc) != cod.end());
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 5);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), ab) != iod.end());
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), bc) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), ab) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), bc) != iod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -1141,20 +1170,30 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2);
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), ab) == iod.end());
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), bc) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), ab) == iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), bc) != iod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -1165,20 +1204,30 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bc) == bod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1);
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), ab) == iod.end());
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), bc) == iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), ab) == iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), bc) == iod.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1213,14 +1262,18 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ag) != aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ag) != aod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1);
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), ag) != iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), ag) != iod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -1230,14 +1283,18 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ag) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ag) == aod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1);
|
||||
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), ag) == iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), ag) == iod.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1260,21 +1317,53 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
std::array<TestAccountData, 8> const tests = {{
|
||||
// src > dst && src > issuer && dst no trustline
|
||||
{Account("alice2"), Account("bob0"), Account{"gw0"}, false, true},
|
||||
{.src = Account("alice2"),
|
||||
.dst = Account("bob0"),
|
||||
.gw = Account{"gw0"},
|
||||
.hasTrustline = false,
|
||||
.negative = true},
|
||||
// src < dst && src < issuer && dst no trustline
|
||||
{Account("carol0"), Account("dan1"), Account{"gw1"}, false, false},
|
||||
{.src = Account("carol0"),
|
||||
.dst = Account("dan1"),
|
||||
.gw = Account{"gw1"},
|
||||
.hasTrustline = false,
|
||||
.negative = false},
|
||||
// dst > src && dst > issuer && dst no trustline
|
||||
{Account("dan1"), Account("alice2"), Account{"gw0"}, false, true},
|
||||
{.src = Account("dan1"),
|
||||
.dst = Account("alice2"),
|
||||
.gw = Account{"gw0"},
|
||||
.hasTrustline = false,
|
||||
.negative = true},
|
||||
// dst < src && dst < issuer && dst no trustline
|
||||
{Account("bob0"), Account("carol0"), Account{"gw1"}, false, false},
|
||||
{.src = Account("bob0"),
|
||||
.dst = Account("carol0"),
|
||||
.gw = Account{"gw1"},
|
||||
.hasTrustline = false,
|
||||
.negative = false},
|
||||
// src > dst && src > issuer && dst has trustline
|
||||
{Account("alice2"), Account("bob0"), Account{"gw0"}, true, true},
|
||||
{.src = Account("alice2"),
|
||||
.dst = Account("bob0"),
|
||||
.gw = Account{"gw0"},
|
||||
.hasTrustline = true,
|
||||
.negative = true},
|
||||
// src < dst && src < issuer && dst has trustline
|
||||
{Account("carol0"), Account("dan1"), Account{"gw1"}, true, false},
|
||||
{.src = Account("carol0"),
|
||||
.dst = Account("dan1"),
|
||||
.gw = Account{"gw1"},
|
||||
.hasTrustline = true,
|
||||
.negative = false},
|
||||
// dst > src && dst > issuer && dst has trustline
|
||||
{Account("dan1"), Account("alice2"), Account{"gw0"}, true, true},
|
||||
{.src = Account("dan1"),
|
||||
.dst = Account("alice2"),
|
||||
.gw = Account{"gw0"},
|
||||
.hasTrustline = true,
|
||||
.negative = true},
|
||||
// dst < src && dst < issuer && dst has trustline
|
||||
{Account("bob0"), Account("carol0"), Account{"gw1"}, true, false},
|
||||
{.src = Account("bob0"),
|
||||
.dst = Account("carol0"),
|
||||
.gw = Account{"gw1"},
|
||||
.hasTrustline = true,
|
||||
.negative = false},
|
||||
}};
|
||||
|
||||
for (auto const& t : tests)
|
||||
@@ -1366,13 +1455,13 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
std::array<TestAccountData, 4> const gwDstTests = {{
|
||||
// src > dst && src > issuer && dst has trustline
|
||||
{Account("alice2"), Account{"gw0"}, true},
|
||||
{.src = Account("alice2"), .dst = Account{"gw0"}, .hasTrustline = true},
|
||||
// src < dst && src < issuer && dst has trustline
|
||||
{Account("carol0"), Account{"gw1"}, true},
|
||||
{.src = Account("carol0"), .dst = Account{"gw1"}, .hasTrustline = true},
|
||||
// dst > src && dst > issuer && dst has trustline
|
||||
{Account("dan1"), Account{"gw0"}, true},
|
||||
{.src = Account("dan1"), .dst = Account{"gw0"}, .hasTrustline = true},
|
||||
// dst < src && dst < issuer && dst has trustline
|
||||
{Account("bob0"), Account{"gw1"}, true},
|
||||
{.src = Account("bob0"), .dst = Account{"gw1"}, .hasTrustline = true},
|
||||
}};
|
||||
|
||||
// issuer is destination
|
||||
@@ -3131,13 +3220,17 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) != aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), aa) != aod.end());
|
||||
}
|
||||
|
||||
{
|
||||
xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id()));
|
||||
BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(iod.begin(), iod.end(), aa) == iod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(iod.begin(), iod.end(), aa) == iod.end());
|
||||
}
|
||||
|
||||
env(escrow::create(bob, bob, MPT(1'000)),
|
||||
@@ -3152,7 +3245,9 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -3164,11 +3259,15 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), aa) == aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bb) != bod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -3180,7 +3279,9 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bb) == bod.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3222,16 +3323,24 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
{
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) != aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ab) != aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 3);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) != bod.end());
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), ab) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(cod.begin(), cod.end(), bc) != cod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(cod.begin(), cod.end(), bc) != cod.end());
|
||||
}
|
||||
|
||||
env.close(5s);
|
||||
@@ -3242,12 +3351,18 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bc) != bod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2);
|
||||
@@ -3261,12 +3376,18 @@ struct EscrowToken_test : public beast::unit_test::suite
|
||||
|
||||
xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id()));
|
||||
BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(aod.begin(), aod.end(), ab) == aod.end());
|
||||
|
||||
xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id()));
|
||||
BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1);
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), ab) == bod.end());
|
||||
BEAST_EXPECT(
|
||||
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||
std::find(bod.begin(), bod.end(), bc) == bod.end());
|
||||
|
||||
xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id()));
|
||||
BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1);
|
||||
@@ -3815,5 +3936,4 @@ public:
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(EscrowToken, app, xrpl);
|
||||
|
||||
} // namespace test
|
||||
} // namespace xrpl
|
||||
} // namespace xrpl::test
|
||||
|
||||
Reference in New Issue
Block a user