|
| unsigned int | nextSeed () |
| | A seed unique to this chain within the suite.
|
| void | testLocalLedgerCompletesAcquire (jtx::Env &env) |
| | A ledger whose maps all resolve locally finishes on the spot, and the finished ledger is immutable and handed on.
|
| void | testInvalidatedLedgerFailsInDone (jtx::Env &env) |
| | A ledger whose map goes invalid on the way to being settled must be discarded rather than delivered.
|
| void | testLocalFailureSignalsDone (jtx::Env &env) |
| | An acquisition that fails on local data must still signal.
|
| void | testPeerZeroAccountHashFails (jtx::Env &env) |
| | A peer-supplied header whose account hash is zero fails the acquisition and signals, as a local one does.
|
| void | testPeerHeaderWithoutTransactionsCompletes (jtx::Env &env) |
| | A peer-supplied header with a zero transaction hash is taken, since that is an empty transaction set, and the acquisition finishes once the peer supplies the state map.
|
| void | testTimerRetriesThenGivesUp (jtx::Env &env) |
| | The retry timer re-asks, then gives up and signals.
|
| void | run () override |
| | Runs the suite.
|
| 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) |
| | DEPRECATED.
|
| 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 LedgerHeader | makeHeader (UInt256 const &txHash, UInt256 const &accountHash) |
| | A ledger header naming the given map roots, with a hash derived from the fields, so an acquisition accepts the header as its own however the roots are chosen.
|
| static LedgerHeader | makeHeader (DeepChain const &chain) |
| | The common shape: no transactions, so only the state map is in play.
|
| static void | storeHeader (jtx::Env &env, LedgerHeader const &header) |
| | Put the header in the local store, which is the first place tryDB() looks.
|
| static void | storeStateNodes (jtx::Env &env, LedgerHeader const &header, DeepChain const &chain, unsigned int maxDepth) |
| | Put every node of a chain in the local store, so a state-map walk resolves the whole map from the store.
|
| static std::shared_ptr< protocol::TMLedgerData > | headerPacket (LedgerHeader const &header) |
| | The header alone as a liBASE reply, so takeHeader() alone judges the packet.
|
| static std::shared_ptr< TestableInboundLedger > | startPeerAcquire (jtx::Env &env, LedgerHeader const &header) |
| | An acquisition started with nothing in the store for its hash, so it waits on its peers.
|
| static Suite * | thisSuite () |
| | Returns the "current" running suite.
|
Definition at line 110 of file InboundLedger_test.cpp.
| unsigned int xrpl::test::InboundLedger_test::nextSeed |
( |
| ) |
|
|
nodiscard |
A seed unique to this chain within the suite.
The Env below is shared, and its node store, fetch packs and remembered failures are all keyed by hash. A fresh seed per chain gives every chain distinct hashes, so each case resolves only its own nodes.
- Returns
- The seed.
Definition at line 128 of file InboundLedger_test.cpp.
| void xrpl::test::InboundLedger_test::testLocalFailureSignalsDone |
( |
jtx::Env & | env | ) |
|
An acquisition that fails on local data must still signal.
Both entry points that reach tryDB() are covered. done() is what signals, runs logFailure(), and lands the hash in recentFailures_, which stops the next round asking for the same ledger. recentFailures_ is what the assertions watch, since it is the caller-visible consequence of having signaled.
- Parameters
-
| env | The environment to run in. |
Definition at line 440 of file InboundLedger_test.cpp.
| void xrpl::test::InboundLedger_test::testTimerRetriesThenGivesUp |
( |
jtx::Env & | env | ) |
|
The retry timer re-asks, then gives up and signals.
The only case that drives onTimer() rather than trigger() directly, which is what covers the give-up: past kLedgerTimeoutRetriesMax the acquisition fails itself and done() records that, so the same doomed ledger is not asked for again on the next round. It is also what the retry interval is a constructor parameter for, since the chain runs past kLedgerTimeoutRetriesMax ticks of three seconds apiece in production.
The store is empty for this hash and no reply arrives, so every tick counts a timeout and the count climbs to the limit. A hash of its own, so this case owns its entry in the failure list.
- Parameters
-
| env | The environment to run in. |
Definition at line 622 of file InboundLedger_test.cpp.
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
-
| shouldBeTrue | The condition to test. The condition is evaluated in a boolean context. |
| reason | Optional added text to output on a failure. |
| file | The source code file where the test failed. |
| line | The source code line number where the test failed. |
- Returns
- true if the test condition indicates success.
Definition at line 235 of file suite.h.