mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Rename XRPL_ASSERT2 to XRPL_ASSERT_PARTS, and document it
This commit is contained in:
@@ -39,13 +39,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#endif
|
||||
|
||||
#define XRPL_ASSERT ALWAYS_OR_UNREACHABLE
|
||||
#define XRPL_ASSERT2(cond, location, message, ...) \
|
||||
XRPL_ASSERT(cond, location " : " message)
|
||||
#define XRPL_ASSERT_PARTS(cond, function, description, ...) \
|
||||
XRPL_ASSERT(cond, function " : " description)
|
||||
|
||||
// How to use the instrumentation macros:
|
||||
//
|
||||
// * XRPL_ASSERT if cond must be true but the line might not be reached during
|
||||
// fuzzing. Same like `assert` in normal use.
|
||||
// * XRPL_ASSERT_PARTS is for convenience, and works like XRPL_ASSERT, but
|
||||
// splits the message param into "function" and "description", then joins
|
||||
// them with " : " before passing to XRPL_ASSERT.
|
||||
// * ALWAYS if cond must be true _and_ the line must be reached during fuzzing.
|
||||
// Same like `assert` in normal use.
|
||||
// * REACHABLE if the line must be reached during fuzzing
|
||||
|
||||
@@ -230,7 +230,7 @@ LoanPay::doApply()
|
||||
// Move funds
|
||||
STAmount const paidToVault(asset, totalPaidToVault);
|
||||
STAmount const paidToBroker(asset, totalFee);
|
||||
XRPL_ASSERT2(
|
||||
XRPL_ASSERT_PARTS(
|
||||
paidToVault + paidToBroker == amount,
|
||||
"ripple::LoanPay::doApply",
|
||||
"correct payment totals");
|
||||
|
||||
Reference in New Issue
Block a user