mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Add Antithesis intrumentation (#5042)
* Copy Antithesis SDK version 0.4.0 to directory external/ * Add build option `voidstar` to enable instrumentation with Antithesis SDK * Define instrumentation macros ASSERT and UNREACHABLE in terms of regular C assert * Replace asserts with named ASSERT or UNREACHABLE * Add UNREACHABLE to LogicError * Document instrumentation macros in CONTRIBUTING.md
This commit is contained in:
committed by
Ed Hennis
parent
f64cf9187a
commit
d7e949193f
@@ -23,8 +23,8 @@
|
||||
#include <xrpl/json/json_value.h>
|
||||
#include <xrpl/protocol/ApiVersion.h>
|
||||
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <concepts>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
@@ -159,8 +159,10 @@ struct MultiApiJson
|
||||
-> std::
|
||||
invoke_result_t<Fn, decltype(json.val[0]), Version, Args&&...>
|
||||
{
|
||||
assert(
|
||||
valid(version) && index(version) >= 0 && index(version) < size);
|
||||
ASSERT(
|
||||
valid(version) && index(version) >= 0 && index(version) < size,
|
||||
"ripple::detail::MultiApiJson::operator<Args...>() : valid "
|
||||
"version");
|
||||
return std::invoke(
|
||||
fn,
|
||||
json.val[index(version)],
|
||||
@@ -177,8 +179,9 @@ struct MultiApiJson
|
||||
operator()(Json& json, Version version, Fn fn) const
|
||||
-> std::invoke_result_t<Fn, decltype(json.val[0])>
|
||||
{
|
||||
assert(
|
||||
valid(version) && index(version) >= 0 && index(version) < size);
|
||||
ASSERT(
|
||||
valid(version) && index(version) >= 0 && index(version) < size,
|
||||
"ripple::detail::MultiApiJson::operator() : valid version");
|
||||
return std::invoke(fn, json.val[index(version)]);
|
||||
}
|
||||
} visitor = {};
|
||||
|
||||
Reference in New Issue
Block a user