mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Add command line unittest-fee
- Remove the cmake UNIT_TEST_REFERENCE_FEE setting - Replaced by --unittest-fee runtime param
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace beast {
|
||||
@@ -22,6 +23,7 @@ namespace unit_test {
|
||||
class runner
|
||||
{
|
||||
std::string arg_;
|
||||
std::optional<std::int64_t> referenceFee_;
|
||||
bool default_ = false;
|
||||
bool failed_ = false;
|
||||
bool cond_ = false;
|
||||
@@ -54,6 +56,24 @@ public:
|
||||
return arg_;
|
||||
}
|
||||
|
||||
/** Set the reference fee (in drops) for tests.
|
||||
|
||||
If provided, this value is used in every suite that
|
||||
does not override it.
|
||||
*/
|
||||
void
|
||||
referenceFee(std::int64_t fee)
|
||||
{
|
||||
referenceFee_ = fee;
|
||||
}
|
||||
|
||||
/** Returns the reference fee, if any. */
|
||||
std::optional<std::int64_t> const&
|
||||
referenceFee() const
|
||||
{
|
||||
return referenceFee_;
|
||||
}
|
||||
|
||||
/** Run the specified suite.
|
||||
@return `true` if any conditions failed.
|
||||
*/
|
||||
|
||||
@@ -281,6 +281,16 @@ public:
|
||||
return runner_->arg();
|
||||
}
|
||||
|
||||
/** Return the reference fee associated with the runner. */
|
||||
std::optional<std::int64_t>
|
||||
referenceFee() const
|
||||
{
|
||||
assert(runner_);
|
||||
if (!runner_)
|
||||
return {};
|
||||
return runner_->referenceFee();
|
||||
}
|
||||
|
||||
// DEPRECATED
|
||||
// @return `true` if the test condition indicates success(a false value)
|
||||
template <class Condition, class String>
|
||||
|
||||
@@ -20,6 +20,10 @@ removeTokenOffersWithLimit(
|
||||
Keylet const& directory,
|
||||
std::size_t maxDeletableOffers);
|
||||
|
||||
/** Returns tesSUCCESS if NFToken has few enough offers that it can be burned */
|
||||
TER
|
||||
notTooManyOffers(ReadView const& view, uint256 const& nftokenID);
|
||||
|
||||
/** Finds the specified token in the owner's token directory. */
|
||||
std::optional<STObject>
|
||||
findToken(ReadView const& view, AccountID const& owner, uint256 const& nftokenID);
|
||||
|
||||
Reference in New Issue
Block a user