20#include <xrpl/beast/unit_test.h>
21#include <xrpl/protocol/TER.h>
33 for (
auto i = -400; i < 400; ++i)
42 BEAST_EXPECT(inRange || !good);
43 BEAST_EXPECT(
transToken(t) == (good ? token :
"-"));
44 BEAST_EXPECT(
transHuman(t) == (good ? text :
"-"));
47 BEAST_EXPECT(good == !!code);
48 BEAST_EXPECT(!code || *code == t);
59 template <std::
size_t I1, std::
size_t I2>
63 template <
typename Tup>
98 template <std::
size_t, std::
size_t>
113 template <std::
size_t, std::
size_t>
121 testIterate<std::tuple_size<Tup>::value - 1, I2 - 1, Func>(tup, s);
128 template <std::
size_t, std::
size_t>
152 static int const hiIndex{
156 testIterate<hiIndex, hiIndex, NotConvertible>(terEnums, *
this);
159 auto isConvertable = [](
auto from,
auto to) {
177 isConvertable(notTec, notTec);
180 auto notConvertible = [](
auto from,
auto to) {
194 notConvertible(ter, notTec);
195 notConvertible(4, notTec);
204 isConvertable(notTec, ter);
205 isConvertable(ter, ter);
208 notConvertible(4, ter);
218 template <std::
size_t I1, std::
size_t I2>
222 template <
typename Tup>
284 testIterate<hiIndex, hiIndex, CheckComparable>(ters, *
this);
bool expect(Condition const &shouldBeTrue)
Evaluate a test condition.
static constexpr TERSubset fromInt(int from)
void operator()(Tup const &tup, beast::unit_test::suite &s) const
void operator()(Tup const &tup, beast::unit_test::suite &) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool operator<=(STAmount const &lhs, STAmount const &rhs)
std::string transHuman(TER code)
bool operator!=(Buffer const &lhs, Buffer const &rhs) noexcept
bool isTefFailure(TER x) noexcept
std::string transToken(TER code)
bool isTerRetry(TER x) noexcept
bool operator<(Slice const &lhs, Slice const &rhs) noexcept
bool isTesSuccess(TER x) noexcept
constexpr TERUnderlyingType TERtoInt(TELcodes v)
bool isTemMalformed(TER x) noexcept
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
bool transResultInfo(TER code, std::string &token, std::string &text)
bool operator>=(STAmount const &lhs, STAmount const &rhs)
bool isTecClaim(TER x) noexcept
bool isTelLocal(TER x) noexcept
std::optional< TER > transCode(std::string const &token)
void testTransResultInfo()
std::enable_if_t< I1==0 &&I2 !=0 > testIterate(Tup const &tup, beast::unit_test::suite &s)
std::enable_if_t< I1 !=0 > testIterate(Tup const &tup, beast::unit_test::suite &s)
void run() override
Runs the suite.
std::enable_if_t< I1==0 &&I2==0 > testIterate(Tup const &tup, beast::unit_test::suite &s)