diff --git a/src/test/app/Flow_test.cpp b/src/test/app/Flow_test.cpp index 521addc5c3..89393dfcc3 100644 --- a/src/test/app/Flow_test.cpp +++ b/src/test/app/Flow_test.cpp @@ -747,8 +747,9 @@ struct Flow_test : public beast::unit_test::suite auto const timeDelta = Env{*this}.closed ()->info ().closeTimeResolution; - for(auto const& d: {-timeDelta*100, +timeDelta*100}){ - auto const closeTime = fix1141Time () + d; + for (auto const& d : {-100 * timeDelta, +100 * timeDelta}) + { + auto const closeTime = fix1141Time () + d ; Env env (*this, no_features); env.close (closeTime); @@ -1112,7 +1113,7 @@ struct Flow_test : public beast::unit_test::suite using namespace jtx; Env env(*this, with_features(featureFlow)); auto const timeDelta = env.closed ()->info ().closeTimeResolution; - auto const d = withFix ? timeDelta*100 : -timeDelta*100; + auto const d = withFix ? 100*timeDelta : -100*timeDelta; auto closeTime = fix1443Time() + d; env.close(closeTime); @@ -1165,7 +1166,7 @@ struct Flow_test : public beast::unit_test::suite using namespace jtx; Env env(*this, with_features(featureFlow)); auto const timeDelta = env.closed ()->info ().closeTimeResolution; - auto const d = withFix ? timeDelta*100 : -timeDelta*100; + auto const d = withFix ? 100*timeDelta : -100*timeDelta; auto closeTime = fix1449Time() + d; env.close(closeTime); diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index db66854098..003b4c06e1 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -253,11 +253,10 @@ public: for (int i=0;i<101;++i) env (offer (carol, USD (1), EUR (2))); - for (auto timeDelta : { - - env.closed()->info().closeTimeResolution, - env.closed()->info().closeTimeResolution} ) + for (auto d : {-1, 1}) { - auto const closeTime = STAmountSO::soTime + timeDelta; + auto const closeTime = STAmountSO::soTime + + d * env.closed()->info().closeTimeResolution; env.close (closeTime); *stAmountCalcSwitchover = closeTime > STAmountSO::soTime; // Will fail without the underflow fix diff --git a/src/test/beast/aged_associative_container_test.cpp b/src/test/beast/aged_associative_container_test.cpp index 8c2354a2f5..0f6e5fe332 100644 --- a/src/test/beast/aged_associative_container_test.cpp +++ b/src/test/beast/aged_associative_container_test.cpp @@ -142,6 +142,13 @@ public: return true; } + template + bool operator!= (AllocT const& o) const + { + return !(*this == o); + } + + T* allocate (std::size_t n, T const* = 0) { return static_cast ( diff --git a/src/test/ledger/Invariants_test.cpp b/src/test/ledger/Invariants_test.cpp index 65f35805ac..c59d9de0cf 100644 --- a/src/test/ledger/Invariants_test.cpp +++ b/src/test/ledger/Invariants_test.cpp @@ -250,7 +250,7 @@ class Invariants_test : public beast::unit_test::suite auto const sle = ac.view().peek (keylet::account(A1.id())); if(! sle) return false; - STAmount nonNative {A2["USD"](51)}; + STAmount nonNative (A2["USD"](51)); sle->setFieldAmount (sfBalance, nonNative); ac.view().update (sle); return true; @@ -366,7 +366,7 @@ class Invariants_test : public beast::unit_test::suite return false; auto sleNew = std::make_shared ( keylet::escrow(A1, (*sle)[sfSequence] + 2)); - STAmount nonNative {A2["USD"](51)}; + STAmount nonNative (A2["USD"](51)); sleNew->setFieldAmount (sfAmount, nonNative); ac.view().insert (sleNew); return true; diff --git a/src/test/ledger/PaymentSandbox_test.cpp b/src/test/ledger/PaymentSandbox_test.cpp index 7cee87c662..0ab0efef29 100644 --- a/src/test/ledger/PaymentSandbox_test.cpp +++ b/src/test/ledger/PaymentSandbox_test.cpp @@ -278,10 +278,10 @@ class PaymentSandbox_test : public beast::unit_test::suite STAmount hugeAmt (issue, STAmount::cMaxValue, STAmount::cMaxOffset - 1, false, false, STAmount::unchecked{}); - for (auto timeDelta : {-env.closed ()->info ().closeTimeResolution, - env.closed ()->info ().closeTimeResolution}) + for (auto d : {-1, 1}) { - auto const closeTime = fix1141Time () + timeDelta; + auto const closeTime = fix1141Time () + + d * env.closed()->info().closeTimeResolution; env.close (closeTime); ApplyViewImpl av (&*env.current (), tapNONE); PaymentSandbox pv (&av);