xrpld
Loading...
Searching...
No Matches
xrpl::test::LoanArbitrary_test Class Reference
Inheritance diagram for xrpl::test::LoanArbitrary_test:
Collaboration diagram for xrpl::test::LoanArbitrary_test:

Public Member Functions

template<class = void>
void operator() (Runner &r)
 Invokes the test using the specified runner.
template<class = void>
void pass ()
 Record a successful test condition.
template<class F, class String>
bool except (F &&f, String const &reason)
template<class F>
bool except (F &&f)
template<class E, class F, class String>
bool except (F &&f, String const &reason)
template<class E, class F>
bool except (F &&f)
template<class F, class String>
bool unexcept (F &&f, String const &reason)
template<class F>
bool unexcept (F &&f)
std::string const & arg () const
 Return the argument associated with the runner.
template<class Condition, class String>
bool unexpected (Condition shouldBeFalse, String const &reason)
template<class Condition>
bool unexpected (Condition shouldBeFalse)
template<class String>
void fail (String const &reason, char const *file, int line)
 Record a failure.
template<class = void>
void fail (std::string const &reason="")
template<class Condition>
bool expect (Condition const &shouldBeTrue)
 Evaluate a test condition.
template<class Condition, class String>
bool expect (Condition const &shouldBeTrue, String const &reason)
template<class Condition>
bool expect (Condition const &shouldBeTrue, char const *file, int line)
template<class Condition, class String>
bool expect (Condition const &shouldBeTrue, String const &reason, char const *file, int line)

Static Public Member Functions

static SuitethisSuite ()
 Returns the "current" running suite.

Public Attributes

LogOs< char > log
 Logging output stream.
TestcaseT testcase
 Memberspace for declaring test cases.

Protected Types

enum class  AssetType { XRP = 0 , IOU = 1 , MPT = 2 }

Protected Member Functions

void testRandomLoan ()
void testDisabled ()
BrokerInfo createVaultAndBroker (jtx::Env &env, jtx::PrettyAsset const &asset, jtx::Account const &lender, BrokerParameters const &params=BrokerParameters::defaults())
LoanState getCurrentState (jtx::Env const &env, BrokerInfo const &broker, Keylet const &loanKeylet)
 Get the state without checking anything.
LoanState getCurrentState (jtx::Env const &env, BrokerInfo const &broker, Keylet const &loanKeylet, VerifyLoanStatus const &verifyLoanStatus)
 Get the state and check the values against the parameters used in lifecycle.
bool canImpairLoan (jtx::Env const &env, BrokerInfo const &broker, LoanState const &state)
jtx::PrettyAsset createAsset (jtx::Env &env, AssetType assetType, BrokerParameters const &brokerParams, jtx::Account const &issuer, jtx::Account const &lender, jtx::Account const &borrower)
void describeLoan (jtx::Env &env, BrokerParameters const &brokerParams, LoanParameters const &loanParams, AssetType assetType, jtx::Account const &issuer, jtx::Account const &lender, jtx::Account const &borrower)
std::optional< std::tuple< BrokerInfo, Keylet, jtx::Account > > createLoan (jtx::Env &env, AssetType assetType, BrokerParameters const &brokerParams, LoanParameters const &loanParams, jtx::Account const &issuer, jtx::Account const &lender, jtx::Account const &borrower)
void makeLoanPayments (jtx::Env &env, BrokerInfo const &broker, LoanParameters const &loanParams, Keylet const &loanKeylet, VerifyLoanStatus const &verifyLoanStatus, jtx::Account const &issuer, jtx::Account const &lender, jtx::Account const &borrower, PaymentParameters const &paymentParams=PaymentParameters::defaults())
void runLoan (AssetType assetType, BrokerParameters const &brokerParams, LoanParameters const &loanParams, FeatureBitset features)
void lifecycle (std::string const &caseLabel, char const *label, jtx::Env &env, Number const &loanAmount, int interestExponent, jtx::Account const &lender, jtx::Account const &borrower, jtx::Account const &evan, BrokerInfo const &broker, jtx::Account const &pseudoAcct, std::uint32_t flags, std::function< void(Keylet const &loanKeylet, VerifyLoanStatus const &verifyLoanStatus)> toEndOfLife)
 Runs through the complete lifecycle of a loan.
template<class TAsset, std::size_t NAsset>
void testCaseWrapper (jtx::Env &env, jtx::MPTTester &mptt, std::array< TAsset, NAsset > const &assets, BrokerInfo const &broker, Number const &loanAmount, int interestExponent)
 Wrapper to run a series of lifecycle tests for a given asset and loan amount.
void testLoanSet (FeatureBitset features)
void testLifecycle (FeatureBitset features)
void testSelfLoan (FeatureBitset features)
void testBatchBypassCounterparty (FeatureBitset features)
void testWrongMaxDebtBehavior (FeatureBitset features)
void testLoanPayComputePeriodicPaymentValidRateInvariant (FeatureBitset features)
void testRPC (FeatureBitset features)
void testServiceFeeOnBrokerDeepFreeze ()
void testIssuerLoan ()
void testInvalidLoanDelete ()
void testInvalidLoanManage ()
void testInvalidLoanPay ()
void testInvalidLoanSet ()
void testAccountSendMptMinAmountInvariant (FeatureBitset features)
void testLoanPayDebtDecreaseInvariant (FeatureBitset features)
void testLoanPayComputePeriodicPaymentValidTotalInterestInvariant (FeatureBitset features)
void testDosLoanPay (FeatureBitset features)
void testLoanPayComputePeriodicPaymentValidTotalPrincipalPaidInvariant (FeatureBitset features)
void testLoanPayComputePeriodicPaymentValidTotalInterestPaidInvariant (FeatureBitset features)
void testLoanNextPaymentDueDateOverflow (FeatureBitset features)
void testRequireAuth ()
void testLendingCanTradeDisabledNoImpact ()
void testPoCUnsignedUnderflowOnFullPayAfterEarlyPeriodic (FeatureBitset features)
void testDustManipulation (FeatureBitset features)
void testRIPD3831 (FeatureBitset features)
void testRIPD3459 (FeatureBitset features)
void testRIPD3901 ()
void testRoundingAllowsUndercoverage (FeatureBitset features)
void testRIPD3902 (FeatureBitset features)
void testBorrowerIsBroker ()
void testIssuerIsBorrower (FeatureBitset features)
void testLimitExceeded ()
void testOverpaymentManagementFee (FeatureBitset features)
void testLoanPayBrokerOwnerMissingTrustline (FeatureBitset features)
void testLoanPayBrokerOwnerUnauthorizedMPT (FeatureBitset features)
void testLoanPayBrokerOwnerNoPermissionedDomainMPT (FeatureBitset features)
void testLoanSetBrokerOwnerNoPermissionedDomainMPT (FeatureBitset features)
void testSequentialFLCDepletion (FeatureBitset features)
void testYieldTheftRounding (std::uint32_t flags)
void testWithdrawReflectsUnrealizedLoss (FeatureBitset features)
void testBugOverpaymentPrincipalChange ()
void testLoanSetNearZeroInterestRateSucceeds ()
void testBugOverpayUnroundedAmount ()
void testIntegerScalePrincipalSticks (FeatureBitset features)
void testBugInterestDueDeltaCrash ()
void testFullLifecycleVaultPnLNearZeroRate ()
void testMinimumBrokerCoverConsistency (FeatureBitset features)
void runAmendmentIndependent ()
void runAmendmentSensitive (FeatureBitset features)

Static Protected Member Functions

static void topUpBorrower (jtx::Env &env, BrokerInfo const &broker, jtx::Account const &issuer, jtx::Account const &borrower, LoanState const &state, std::optional< Number > const &servFee)
static std::string getCurrencyLabel (Asset const &asset)

Protected Attributes

beast::xor_shift_engine engine_
std::uniform_int_distribution assetDist_ {0, 2}
std::uniform_int_distribution< std::int64_tprincipalDist_ {100'000, 1'000'000'000}
std::uniform_int_distribution< std::uint32_tinterestRateDist_ {0, 10000}
std::uniform_int_distribution paymentTotalDist_ {12, 10000}
std::uniform_int_distribution paymentIntervalDist_ {60, 3600 * 24 * 30}
std::uniform_int_distribution< std::uint16_tmanagementFeeRateDist_ {0, 10'000}
std::uniform_int_distribution serviceFeeDist_ {0, 20}
FeatureBitset const all_ {jtx::testableAmendments()}
std::string const iouCurrency_ {"IOU"}

Private Member Functions

void run () override
 Runs the suite.
void propagateAbort () const

Static Private Member Functions

static Suite ** pThisSuite ()

Private Attributes

bool abort_ = false
bool aborted_ = false
Runner * runner_ = nullptr

Detailed Description

Definition at line 8714 of file Loan_test.cpp.

Member Enumeration Documentation

◆ AssetType

enum class xrpl::test::Loan_test::AssetType
strongprotectedinherited
Enumerator
XRP 
IOU 
MPT 

Definition at line 638 of file Loan_test.cpp.

Member Function Documentation

◆ run()

void xrpl::test::LoanArbitrary_test::run ( )
overrideprivatevirtual

Runs the suite.

Reimplemented from xrpl::test::Loan_test.

Definition at line 8717 of file Loan_test.cpp.

◆ testRandomLoan()

void xrpl::test::LoanBatch_test::testRandomLoan ( )
protectedinherited

Definition at line 8644 of file Loan_test.cpp.

◆ testDisabled()

void xrpl::test::Loan_test::testDisabled ( )
protectedinherited

Definition at line 98 of file Loan_test.cpp.

◆ createVaultAndBroker()

BrokerInfo xrpl::test::Loan_test::createVaultAndBroker ( jtx::Env & env,
jtx::PrettyAsset const & asset,
jtx::Account const & lender,
BrokerParameters const & params = BrokerParameters::defaults() )
protectedinherited

Definition at line 494 of file Loan_test.cpp.

◆ getCurrentState() [1/2]

LoanState xrpl::test::Loan_test::getCurrentState ( jtx::Env const & env,
BrokerInfo const & broker,
Keylet const & loanKeylet )
protectedinherited

Get the state without checking anything.

Definition at line 544 of file Loan_test.cpp.

◆ getCurrentState() [2/2]

LoanState xrpl::test::Loan_test::getCurrentState ( jtx::Env const & env,
BrokerInfo const & broker,
Keylet const & loanKeylet,
VerifyLoanStatus const & verifyLoanStatus )
protectedinherited

Get the state and check the values against the parameters used in lifecycle.

Definition at line 573 of file Loan_test.cpp.

◆ canImpairLoan()

bool xrpl::test::Loan_test::canImpairLoan ( jtx::Env const & env,
BrokerInfo const & broker,
LoanState const & state )
protectedinherited

Definition at line 615 of file Loan_test.cpp.

◆ createAsset()

jtx::PrettyAsset xrpl::test::Loan_test::createAsset ( jtx::Env & env,
AssetType assetType,
BrokerParameters const & brokerParams,
jtx::Account const & issuer,
jtx::Account const & lender,
jtx::Account const & borrower )
protectedinherited

Definition at line 642 of file Loan_test.cpp.

◆ describeLoan()

void xrpl::test::Loan_test::describeLoan ( jtx::Env & env,
BrokerParameters const & brokerParams,
LoanParameters const & loanParams,
AssetType assetType,
jtx::Account const & issuer,
jtx::Account const & lender,
jtx::Account const & borrower )
protectedinherited

Definition at line 702 of file Loan_test.cpp.

◆ createLoan()

std::optional< std::tuple< BrokerInfo, Keylet, jtx::Account > > xrpl::test::Loan_test::createLoan ( jtx::Env & env,
AssetType assetType,
BrokerParameters const & brokerParams,
LoanParameters const & loanParams,
jtx::Account const & issuer,
jtx::Account const & lender,
jtx::Account const & borrower )
protectedinherited

Definition at line 751 of file Loan_test.cpp.

◆ topUpBorrower()

void xrpl::test::Loan_test::topUpBorrower ( jtx::Env & env,
BrokerInfo const & broker,
jtx::Account const & issuer,
jtx::Account const & borrower,
LoanState const & state,
std::optional< Number > const & servFee )
staticprotectedinherited

Definition at line 823 of file Loan_test.cpp.

◆ makeLoanPayments()

void xrpl::test::Loan_test::makeLoanPayments ( jtx::Env & env,
BrokerInfo const & broker,
LoanParameters const & loanParams,
Keylet const & loanKeylet,
VerifyLoanStatus const & verifyLoanStatus,
jtx::Account const & issuer,
jtx::Account const & lender,
jtx::Account const & borrower,
PaymentParameters const & paymentParams = PaymentParameters::defaults() )
protectedinherited

Definition at line 862 of file Loan_test.cpp.

◆ runLoan()

void xrpl::test::Loan_test::runLoan ( AssetType assetType,
BrokerParameters const & brokerParams,
LoanParameters const & loanParams,
FeatureBitset features )
protectedinherited

Definition at line 1207 of file Loan_test.cpp.

◆ lifecycle()

void xrpl::test::Loan_test::lifecycle ( std::string const & caseLabel,
char const * label,
jtx::Env & env,
Number const & loanAmount,
int interestExponent,
jtx::Account const & lender,
jtx::Account const & borrower,
jtx::Account const & evan,
BrokerInfo const & broker,
jtx::Account const & pseudoAcct,
std::uint32_t flags,
std::function< void(Keylet const &loanKeylet, VerifyLoanStatus const &verifyLoanStatus)> toEndOfLife )
protectedinherited

Runs through the complete lifecycle of a loan.

  1. Create a loan.
  2. Test a bunch of transaction failure conditions.
  3. Use the toEndOfLife callback to take the loan to 0. How that is done depends on the callback. e.g. Default, Early payoff, make all the normal payments, etc.
  4. Delete the loan. The loan will alternate between being deleted by the lender and the borrower.

Definition at line 1255 of file Loan_test.cpp.

◆ getCurrencyLabel()

std::string xrpl::test::Loan_test::getCurrencyLabel ( Asset const & asset)
staticprotectedinherited

Definition at line 1551 of file Loan_test.cpp.

◆ testCaseWrapper()

template<class TAsset, std::size_t NAsset>
void xrpl::test::Loan_test::testCaseWrapper ( jtx::Env & env,
jtx::MPTTester & mptt,
std::array< TAsset, NAsset > const & assets,
BrokerInfo const & broker,
Number const & loanAmount,
int interestExponent )
protectedinherited

Wrapper to run a series of lifecycle tests for a given asset and loan amount.

Will be used in the future to vary the loan parameters. For now, it is only called once.

Tests a bunch of LoanSet failure conditions before lifecycle.

Definition at line 1572 of file Loan_test.cpp.

◆ testLoanSet()

void xrpl::test::Loan_test::testLoanSet ( FeatureBitset features)
protectedinherited

Definition at line 2908 of file Loan_test.cpp.

◆ testLifecycle()

void xrpl::test::Loan_test::testLifecycle ( FeatureBitset features)
protectedinherited

Definition at line 3465 of file Loan_test.cpp.

◆ testSelfLoan()

void xrpl::test::Loan_test::testSelfLoan ( FeatureBitset features)
protectedinherited

Definition at line 3559 of file Loan_test.cpp.

◆ testBatchBypassCounterparty()

void xrpl::test::Loan_test::testBatchBypassCounterparty ( FeatureBitset features)
protectedinherited

Definition at line 3694 of file Loan_test.cpp.

◆ testWrongMaxDebtBehavior()

void xrpl::test::Loan_test::testWrongMaxDebtBehavior ( FeatureBitset features)
protectedinherited

Definition at line 3761 of file Loan_test.cpp.

◆ testLoanPayComputePeriodicPaymentValidRateInvariant()

void xrpl::test::Loan_test::testLoanPayComputePeriodicPaymentValidRateInvariant ( FeatureBitset features)
protectedinherited

Definition at line 3807 of file Loan_test.cpp.

◆ testRPC()

void xrpl::test::Loan_test::testRPC ( FeatureBitset features)
protectedinherited

Definition at line 3875 of file Loan_test.cpp.

◆ testServiceFeeOnBrokerDeepFreeze()

void xrpl::test::Loan_test::testServiceFeeOnBrokerDeepFreeze ( )
protectedinherited

Definition at line 4179 of file Loan_test.cpp.

◆ testIssuerLoan()

void xrpl::test::Loan_test::testIssuerLoan ( )
protectedinherited

Definition at line 4264 of file Loan_test.cpp.

◆ testInvalidLoanDelete()

void xrpl::test::Loan_test::testInvalidLoanDelete ( )
protectedinherited

Definition at line 4302 of file Loan_test.cpp.

◆ testInvalidLoanManage()

void xrpl::test::Loan_test::testInvalidLoanManage ( )
protectedinherited

Definition at line 4319 of file Loan_test.cpp.

◆ testInvalidLoanPay()

void xrpl::test::Loan_test::testInvalidLoanPay ( )
protectedinherited

Definition at line 4336 of file Loan_test.cpp.

◆ testInvalidLoanSet()

void xrpl::test::Loan_test::testInvalidLoanSet ( )
protectedinherited

Definition at line 4414 of file Loan_test.cpp.

◆ testAccountSendMptMinAmountInvariant()

void xrpl::test::Loan_test::testAccountSendMptMinAmountInvariant ( FeatureBitset features)
protectedinherited

Definition at line 4554 of file Loan_test.cpp.

◆ testLoanPayDebtDecreaseInvariant()

void xrpl::test::Loan_test::testLoanPayDebtDecreaseInvariant ( FeatureBitset features)
protectedinherited

Definition at line 4614 of file Loan_test.cpp.

◆ testLoanPayComputePeriodicPaymentValidTotalInterestInvariant()

void xrpl::test::Loan_test::testLoanPayComputePeriodicPaymentValidTotalInterestInvariant ( FeatureBitset features)
protectedinherited

Definition at line 4707 of file Loan_test.cpp.

◆ testDosLoanPay()

void xrpl::test::Loan_test::testDosLoanPay ( FeatureBitset features)
protectedinherited

Definition at line 4772 of file Loan_test.cpp.

◆ testLoanPayComputePeriodicPaymentValidTotalPrincipalPaidInvariant()

void xrpl::test::Loan_test::testLoanPayComputePeriodicPaymentValidTotalPrincipalPaidInvariant ( FeatureBitset features)
protectedinherited

Definition at line 4914 of file Loan_test.cpp.

◆ testLoanPayComputePeriodicPaymentValidTotalInterestPaidInvariant()

void xrpl::test::Loan_test::testLoanPayComputePeriodicPaymentValidTotalInterestPaidInvariant ( FeatureBitset features)
protectedinherited

Definition at line 5016 of file Loan_test.cpp.

◆ testLoanNextPaymentDueDateOverflow()

void xrpl::test::Loan_test::testLoanNextPaymentDueDateOverflow ( FeatureBitset features)
protectedinherited

Definition at line 5101 of file Loan_test.cpp.

◆ testRequireAuth()

void xrpl::test::Loan_test::testRequireAuth ( )
protectedinherited

Definition at line 5351 of file Loan_test.cpp.

◆ testLendingCanTradeDisabledNoImpact()

void xrpl::test::Loan_test::testLendingCanTradeDisabledNoImpact ( )
protectedinherited

Definition at line 5408 of file Loan_test.cpp.

◆ testPoCUnsignedUnderflowOnFullPayAfterEarlyPeriodic()

void xrpl::test::Loan_test::testPoCUnsignedUnderflowOnFullPayAfterEarlyPeriodic ( FeatureBitset features)
protectedinherited

Definition at line 5712 of file Loan_test.cpp.

◆ testDustManipulation()

void xrpl::test::Loan_test::testDustManipulation ( FeatureBitset features)
protectedinherited

Definition at line 5937 of file Loan_test.cpp.

◆ testRIPD3831()

void xrpl::test::Loan_test::testRIPD3831 ( FeatureBitset features)
protectedinherited

Definition at line 6077 of file Loan_test.cpp.

◆ testRIPD3459()

void xrpl::test::Loan_test::testRIPD3459 ( FeatureBitset features)
protectedinherited

Definition at line 6150 of file Loan_test.cpp.

◆ testRIPD3901()

void xrpl::test::Loan_test::testRIPD3901 ( )
protectedinherited

Definition at line 6219 of file Loan_test.cpp.

◆ testRoundingAllowsUndercoverage()

void xrpl::test::Loan_test::testRoundingAllowsUndercoverage ( FeatureBitset features)
protectedinherited

Definition at line 6275 of file Loan_test.cpp.

◆ testRIPD3902()

void xrpl::test::Loan_test::testRIPD3902 ( FeatureBitset features)
protectedinherited

Definition at line 6354 of file Loan_test.cpp.

◆ testBorrowerIsBroker()

void xrpl::test::Loan_test::testBorrowerIsBroker ( )
protectedinherited

Definition at line 6408 of file Loan_test.cpp.

◆ testIssuerIsBorrower()

void xrpl::test::Loan_test::testIssuerIsBorrower ( FeatureBitset features)
protectedinherited

Definition at line 6525 of file Loan_test.cpp.

◆ testLimitExceeded()

void xrpl::test::Loan_test::testLimitExceeded ( )
protectedinherited

Definition at line 6572 of file Loan_test.cpp.

◆ testOverpaymentManagementFee()

void xrpl::test::Loan_test::testOverpaymentManagementFee ( FeatureBitset features)
protectedinherited

Definition at line 6642 of file Loan_test.cpp.

◆ testLoanPayBrokerOwnerMissingTrustline()

void xrpl::test::Loan_test::testLoanPayBrokerOwnerMissingTrustline ( FeatureBitset features)
protectedinherited

Definition at line 6695 of file Loan_test.cpp.

◆ testLoanPayBrokerOwnerUnauthorizedMPT()

void xrpl::test::Loan_test::testLoanPayBrokerOwnerUnauthorizedMPT ( FeatureBitset features)
protectedinherited

Definition at line 6763 of file Loan_test.cpp.

◆ testLoanPayBrokerOwnerNoPermissionedDomainMPT()

void xrpl::test::Loan_test::testLoanPayBrokerOwnerNoPermissionedDomainMPT ( FeatureBitset features)
protectedinherited

Definition at line 6844 of file Loan_test.cpp.

◆ testLoanSetBrokerOwnerNoPermissionedDomainMPT()

void xrpl::test::Loan_test::testLoanSetBrokerOwnerNoPermissionedDomainMPT ( FeatureBitset features)
protectedinherited

Definition at line 6947 of file Loan_test.cpp.

◆ testSequentialFLCDepletion()

void xrpl::test::Loan_test::testSequentialFLCDepletion ( FeatureBitset features)
protectedinherited

Definition at line 7019 of file Loan_test.cpp.

◆ testYieldTheftRounding()

void xrpl::test::Loan_test::testYieldTheftRounding ( std::uint32_t flags)
protectedinherited

Definition at line 7138 of file Loan_test.cpp.

◆ testWithdrawReflectsUnrealizedLoss()

void xrpl::test::Loan_test::testWithdrawReflectsUnrealizedLoss ( FeatureBitset features)
protectedinherited

Definition at line 7279 of file Loan_test.cpp.

◆ testBugOverpaymentPrincipalChange()

void xrpl::test::Loan_test::testBugOverpaymentPrincipalChange ( )
protectedinherited

Definition at line 7437 of file Loan_test.cpp.

◆ testLoanSetNearZeroInterestRateSucceeds()

void xrpl::test::Loan_test::testLoanSetNearZeroInterestRateSucceeds ( )
protectedinherited

Definition at line 7665 of file Loan_test.cpp.

◆ testBugOverpayUnroundedAmount()

void xrpl::test::Loan_test::testBugOverpayUnroundedAmount ( )
protectedinherited

Definition at line 7773 of file Loan_test.cpp.

◆ testIntegerScalePrincipalSticks()

void xrpl::test::Loan_test::testIntegerScalePrincipalSticks ( FeatureBitset features)
protectedinherited

Definition at line 7847 of file Loan_test.cpp.

◆ testBugInterestDueDeltaCrash()

void xrpl::test::Loan_test::testBugInterestDueDeltaCrash ( )
protectedinherited

Definition at line 7944 of file Loan_test.cpp.

◆ testFullLifecycleVaultPnLNearZeroRate()

void xrpl::test::Loan_test::testFullLifecycleVaultPnLNearZeroRate ( )
protectedinherited

Definition at line 8019 of file Loan_test.cpp.

◆ testMinimumBrokerCoverConsistency()

void xrpl::test::Loan_test::testMinimumBrokerCoverConsistency ( FeatureBitset features)
protectedinherited

Definition at line 8127 of file Loan_test.cpp.

◆ runAmendmentIndependent()

void xrpl::test::Loan_test::runAmendmentIndependent ( )
protectedinherited

Definition at line 8528 of file Loan_test.cpp.

◆ runAmendmentSensitive()

void xrpl::test::Loan_test::runAmendmentSensitive ( FeatureBitset features)
protectedinherited

Definition at line 8554 of file Loan_test.cpp.

◆ thisSuite()

Suite * beast::unit_test::Suite::thisSuite ( )
staticinherited

Returns the "current" running suite.

If no suite is running, nullptr is returned.

Definition at line 155 of file suite.h.

◆ operator()()

template<class>
void beast::unit_test::Suite::operator() ( Runner & r)
inherited

Invokes the test using the specified runner.

Data members are set up here instead of the constructor as a convenience to writing the derived class to avoid repetition of forwarded constructor arguments to the base. Normally this is called by the framework for you.

Definition at line 388 of file suite.h.

◆ pass()

template<class>
void beast::unit_test::Suite::pass ( )
inherited

Record a successful test condition.

Definition at line 500 of file suite.h.

◆ fail() [1/2]

template<class String>
void beast::unit_test::Suite::fail ( String const & reason,
char const * file,
int line )
inherited

Record a failure.

Parameters
reasonOptional text added to the output on a failure.
fileThe source code file where the test failed.
lineThe source code line number where the test failed.

Definition at line 522 of file suite.h.

◆ fail() [2/2]

template<class>
void beast::unit_test::Suite::fail ( std::string const & reason = "")
inherited

Definition at line 509 of file suite.h.

◆ expect() [1/4]

template<class Condition>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue)
inherited

Evaluate a test condition.

This function provides improved logging by incorporating the file name and line number into the reported output on failure, as well as additional text specified by the caller.

Parameters
shouldBeTrueThe condition to test. The condition is evaluated in a boolean context.
reasonOptional added text to output on a failure.
fileThe source code file where the test failed.
lineThe source code line number where the test failed.
Returns
true if the test condition indicates success.

Definition at line 223 of file suite.h.

◆ expect() [2/4]

template<class Condition, class String>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue,
String const & reason )
inherited

Definition at line 405 of file suite.h.

◆ expect() [3/4]

template<class Condition>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue,
char const * file,
int line )
inherited

Definition at line 234 of file suite.h.

◆ expect() [4/4]

template<class Condition, class String>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue,
String const & reason,
char const * file,
int line )
inherited

Definition at line 418 of file suite.h.

◆ except() [1/4]

template<class F, class String>
bool beast::unit_test::Suite::except ( F && f,
String const & reason )
inherited

Definition at line 433 of file suite.h.

◆ except() [2/4]

template<class F>
bool beast::unit_test::Suite::except ( F && f)
inherited

Definition at line 253 of file suite.h.

◆ except() [3/4]

template<class E, class F, class String>
bool beast::unit_test::Suite::except ( F && f,
String const & reason )
inherited

Definition at line 450 of file suite.h.

◆ except() [4/4]

template<class E, class F>
bool beast::unit_test::Suite::except ( F && f)
inherited

Definition at line 262 of file suite.h.

◆ unexcept() [1/2]

template<class F, class String>
bool beast::unit_test::Suite::unexcept ( F && f,
String const & reason )
inherited

Definition at line 467 of file suite.h.

◆ unexcept() [2/2]

template<class F>
bool beast::unit_test::Suite::unexcept ( F && f)
inherited

Definition at line 271 of file suite.h.

◆ arg()

std::string const & beast::unit_test::Suite::arg ( ) const
inherited

Return the argument associated with the runner.

Definition at line 278 of file suite.h.

◆ unexpected() [1/2]

template<class Condition, class String>
bool beast::unit_test::Suite::unexpected ( Condition shouldBeFalse,
String const & reason )
inherited

Definition at line 484 of file suite.h.

◆ unexpected() [2/2]

template<class Condition>
bool beast::unit_test::Suite::unexpected ( Condition shouldBeFalse)
inherited

Definition at line 291 of file suite.h.

◆ pThisSuite()

Suite ** beast::unit_test::Suite::pThisSuite ( )
staticprivateinherited

Definition at line 300 of file suite.h.

◆ propagateAbort()

void beast::unit_test::Suite::propagateAbort ( ) const
privateinherited

Definition at line 528 of file suite.h.

Member Data Documentation

◆ engine_

beast::xor_shift_engine xrpl::test::LoanBatch_test::engine_
protectedinherited

Definition at line 8619 of file Loan_test.cpp.

◆ assetDist_

std::uniform_int_distribution xrpl::test::LoanBatch_test::assetDist_ {0, 2}
protectedinherited

Definition at line 8621 of file Loan_test.cpp.

◆ principalDist_

std::uniform_int_distribution<std::int64_t> xrpl::test::LoanBatch_test::principalDist_ {100'000, 1'000'000'000}
protectedinherited

Definition at line 8622 of file Loan_test.cpp.

◆ interestRateDist_

std::uniform_int_distribution<std::uint32_t> xrpl::test::LoanBatch_test::interestRateDist_ {0, 10000}
protectedinherited

Definition at line 8623 of file Loan_test.cpp.

◆ paymentTotalDist_

std::uniform_int_distribution xrpl::test::LoanBatch_test::paymentTotalDist_ {12, 10000}
protectedinherited

Definition at line 8624 of file Loan_test.cpp.

◆ paymentIntervalDist_

std::uniform_int_distribution xrpl::test::LoanBatch_test::paymentIntervalDist_ {60, 3600 * 24 * 30}
protectedinherited

Definition at line 8625 of file Loan_test.cpp.

◆ managementFeeRateDist_

std::uniform_int_distribution<std::uint16_t> xrpl::test::LoanBatch_test::managementFeeRateDist_ {0, 10'000}
protectedinherited

Definition at line 8626 of file Loan_test.cpp.

◆ serviceFeeDist_

std::uniform_int_distribution xrpl::test::LoanBatch_test::serviceFeeDist_ {0, 20}
protectedinherited

Definition at line 8627 of file Loan_test.cpp.

◆ all_

FeatureBitset const xrpl::test::Loan_test::all_ {jtx::testableAmendments()}
protectedinherited

Definition at line 94 of file Loan_test.cpp.

◆ iouCurrency_

std::string const xrpl::test::Loan_test::iouCurrency_ {"IOU"}
protectedinherited

Definition at line 95 of file Loan_test.cpp.

◆ abort_

bool beast::unit_test::Suite::abort_ = false
privateinherited

Definition at line 52 of file suite.h.

◆ aborted_

bool beast::unit_test::Suite::aborted_ = false
privateinherited

Definition at line 53 of file suite.h.

◆ runner_

Runner* beast::unit_test::Suite::runner_ = nullptr
privateinherited

Definition at line 54 of file suite.h.

◆ log

LogOs<char> beast::unit_test::Suite::log
inherited

Logging output stream.

Text sent to the log output stream will be forwarded to the output stream associated with the runner.

Definition at line 146 of file suite.h.

◆ testcase

TestcaseT beast::unit_test::Suite::testcase
inherited

Memberspace for declaring test cases.

Definition at line 149 of file suite.h.