|
| 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) |
|
| void | doTest (std::string const &msg, bool log, std::function< void(bool)> f) |
| void | testConfig (bool log) |
| void | addPeer (jtx::Env &env, std::vector< std::shared_ptr< TxReducePeer > > &peers, std::uint16_t &nDisabled) |
| | Build one peer and register it with the overlay.
|
| void | testRelay (std::string const &test, bool txRREnabled, std::uint16_t nPeers, std::uint16_t nDisabled, std::uint16_t minPeers, std::uint16_t relayPercentage, std::uint16_t expectRelay, std::uint16_t expectQueue, std::size_t nSkip=0) |
| | Relay one transaction to nPeers peers and check the split.
|
| void | testQueueOnly (std::string const &test, bool txRREnabled, std::uint16_t nPeers, std::uint16_t nDisabled, std::uint16_t expectQueue) |
| | Exercises the branch that only queues, reached when relay() is handed no transaction to send: a pseudo-transaction, or an explicit nullopt as here.
|
| void | run () override |
| | Runs the suite.
|
| void | propagateAbort () const |
Definition at line 35 of file tx_reduce_relay_test.cpp.
Exercises the branch that only queues, reached when relay() is handed no transaction to send: a pseudo-transaction, or an explicit nullopt as here.
A queued hash is announced later in a TMHaveTransactions, a type only a peer that negotiated tx reduce-relay recognizes, so a peer without it must not be queued. The relay branch below checks that; this one has to as well, since the check is only as good as its least-guarded send path.
- Parameters
-
| test | Name of the case. |
| txRREnabled | Whether the server's tx reduce-relay is configured on. |
| nPeers | How many peers to attach. |
| nDisabled | How many of those did not negotiate the feature. |
| expectQueue | How many peers are expected to be queued. |
Definition at line 248 of file tx_reduce_relay_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.