|
xrpld
|


Classes | |
| struct | Event |
| struct | Handler |
Public Member Functions | |
| reduce_relay_test () | |
| 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 Public Member Functions | |
| static Suite * | thisSuite () |
| Returns the "current" running suite. | |
Public Attributes | |
| LogOs< char > | log |
| Logging output stream. | |
| TestcaseT | testcase |
| Memberspace for declaring test cases. | |
Protected Types | |
| enum class | State { On , Off , WaitReset } |
| enum class | EventType { LinkDown = 0 , PeerDisconnected = 1 } |
Protected Member Functions | |
| void | printPeers (std::string const &msg, std::uint16_t validator=0) |
| void | random (bool log) |
| Randomly brings the link between a validator and a peer down. | |
| bool | checkCounting (PublicKey const &validator, bool isCountingState) |
| void | doTest (std::string const &msg, bool log, std::function< void(bool)> f) |
| void | testInitialRound (bool log) |
| Initial counting round: three peers receive message "faster" then others. | |
| void | testPeerUnsquelchedTooSoon (bool log) |
| Receiving message from squelched peer too soon should not change the slot's state to Counting. | |
| void | testPeerUnsquelched (bool log) |
| Receiving message from squelched peer should change the slot's state to Counting. | |
| bool | propagateAndSquelch (bool log, bool purge=true, bool resetClock=true) |
| Propagate enough messages to generate one squelch event. | |
| bool | propagateNoSquelch (bool log, std::uint16_t nMessages, bool countingState, bool purge=true, bool resetClock=true) |
| Send fewer message so that squelch event is not generated. | |
| void | testNewPeer (bool log) |
| Receiving a message from new peer should change the slot's state to Counting. | |
| void | testSelectedPeerDisconnects (bool log) |
| Selected peer disconnects. | |
| void | testSelectedPeerStopsRelaying (bool log) |
| Selected peer stops relaying. | |
| void | testSquelchedPeerDisconnects (bool log) |
| Squelched peer disconnects. | |
| void | testConfig (bool log) |
| void | testBaseSquelchReady (bool log) |
| void | testInternalHashRouter (bool log) |
| void | testRandomSquelch (bool l) |
| void | testHandshake (bool log) |
| Runner & | runner () const |
| Lets a suite compose other suites (e.g. | |
Static Protected Member Functions | |
| static Peer::ID | sendSquelch (PublicKey const &validator, PeerWPtr const &peerPtr, std::optional< std::uint32_t > duration) |
| Send squelch (if duration is set) or unsquelch (if duration not set). | |
Protected Attributes | |
| jtx::Env | env_ |
| Network | network_ |
Private Types | |
| using | Slot = reduce_relay::Slot<ManualClock> |
| using | ID = Peer::ID |
Private Member Functions | |
| void | propagateAbort () const |
Static Private Member Functions | |
| static Suite ** | pThisSuite () |
Private Attributes | |
| bool | abort_ = false |
| bool | aborted_ = false |
| Runner * | runner_ = nullptr |
Definition at line 773 of file reduce_relay_test.cpp.
|
private |
Definition at line 775 of file reduce_relay_test.cpp.
|
private |
Definition at line 776 of file reduce_relay_test.cpp.
|
strongprotected |
| Enumerator | |
|---|---|
| On | |
| Off | |
| WaitReset | |
Definition at line 811 of file reduce_relay_test.cpp.
|
strongprotected |
| Enumerator | |
|---|---|
| LinkDown | |
| PeerDisconnected | |
Definition at line 812 of file reduce_relay_test.cpp.
| xrpl::test::reduce_relay_test::reduce_relay_test | ( | ) |
Definition at line 1508 of file reduce_relay_test.cpp.
|
protected |
Definition at line 780 of file reduce_relay_test.cpp.
|
staticprotected |
Send squelch (if duration is set) or unsquelch (if duration not set).
Definition at line 794 of file reduce_relay_test.cpp.
|
protected |
Randomly brings the link between a validator and a peer down.
Randomly disconnects a peer. Those events are generated one at a time.
Definition at line 835 of file reduce_relay_test.cpp.
|
protected |
Definition at line 995 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1003 of file reduce_relay_test.cpp.
|
protected |
Initial counting round: three peers receive message "faster" then others.
Once the message count for the three peers reaches threshold the rest of the peers are squelched and the slot for the given validator is in Selected state.
Definition at line 1016 of file reduce_relay_test.cpp.
|
protected |
Receiving message from squelched peer too soon should not change the slot's state to Counting.
Definition at line 1026 of file reduce_relay_test.cpp.
|
protected |
Receiving message from squelched peer should change the slot's state to Counting.
Definition at line 1038 of file reduce_relay_test.cpp.
|
protected |
Propagate enough messages to generate one squelch event.
Definition at line 1050 of file reduce_relay_test.cpp.
|
protected |
Send fewer message so that squelch event is not generated.
Definition at line 1086 of file reduce_relay_test.cpp.
|
protected |
Receiving a message from new peer should change the slot's state to Counting.
Definition at line 1116 of file reduce_relay_test.cpp.
|
protected |
Selected peer disconnects.
Should change the state to counting and unsquelch squelched peers.
Definition at line 1130 of file reduce_relay_test.cpp.
|
protected |
Selected peer stops relaying.
Should change the state to counting and unsquelch squelched peers.
Definition at line 1151 of file reduce_relay_test.cpp.
|
protected |
Squelched peer disconnects.
Should not change the state to counting.
Definition at line 1172 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1192 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1300 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1328 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1378 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1450 of file reduce_relay_test.cpp.
|
overridevirtual |
Runs the suite.
Implements beast::unit_test::Suite.
Definition at line 1519 of file reduce_relay_test.cpp.
|
staticinherited |
|
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.
|
inherited |
|
inherited |
|
inherited |
|
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.
| 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. |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
staticprivateinherited |
|
privateinherited |
|
protected |
Definition at line 1504 of file reduce_relay_test.cpp.
|
protected |
Definition at line 1505 of file reduce_relay_test.cpp.
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
inherited |