diff --git a/src/test/ledger/CashDiff_test.cpp b/src/test/ledger/CashDiff_test.cpp index 22ed1a391d8..6c8d0f0c194 100644 --- a/src/test/ledger/CashDiff_test.cpp +++ b/src/test/ledger/CashDiff_test.cpp @@ -69,7 +69,8 @@ class CashDiff_test : public beast::unit_test::suite oldProbe = newProbe; newProbe = oldProbe * 10; e10 += 1; - } while (newProbe > oldProbe); + } while (newProbe > oldProbe && + newProbe < std::numeric_limits::max()); } { // Test XRP. @@ -92,7 +93,8 @@ class CashDiff_test : public beast::unit_test::suite oldProbe = newProbe; newProbe = oldProbe * 10; e10 += 1; - } while (newProbe > oldProbe); + } while (newProbe > oldProbe && + newProbe < std::numeric_limits::max()); } } diff --git a/src/test/ledger/Invariants_test.cpp b/src/test/ledger/Invariants_test.cpp index fea4ac8682b..ca9335c5a22 100644 --- a/src/test/ledger/Invariants_test.cpp +++ b/src/test/ledger/Invariants_test.cpp @@ -247,7 +247,7 @@ class Invariants_test : public beast::unit_test::suite doInvariantCheck (enabled, {{ "incorrect account XRP balance" }, { "XRP net change was positive: 99999999000000001" }}, - [self = this](Account const& A1, Account const&, ApplyContext& ac) + [this](Account const& A1, Account const&, ApplyContext& ac) { // balance exceeds genesis amount auto const sle = ac.view().peek (keylet::account(A1.id())); @@ -257,7 +257,7 @@ class Invariants_test : public beast::unit_test::suite // with an invalid value sle->setFieldAmount (sfBalance, INITIAL_XRP + drops(1)); - self->BEAST_EXPECT(!sle->getFieldAmount(sfBalance).negative()); + BEAST_EXPECT(!sle->getFieldAmount(sfBalance).negative()); ac.view().update (sle); return true; }); @@ -265,14 +265,14 @@ class Invariants_test : public beast::unit_test::suite doInvariantCheck (enabled, {{ "incorrect account XRP balance" }, { "XRP net change of -1000000001 doesn't match fee 0" }}, - [self = this](Account const& A1, Account const&, ApplyContext& ac) + [this](Account const& A1, Account const&, ApplyContext& ac) { // balance is negative auto const sle = ac.view().peek (keylet::account(A1.id())); if(! sle) return false; sle->setFieldAmount (sfBalance, {1, true}); - self->BEAST_EXPECT(sle->getFieldAmount(sfBalance).negative()); + BEAST_EXPECT(sle->getFieldAmount(sfBalance).negative()); ac.view().update (sle); return true; });