1#include <xrpl/beast/unit_test.h>
2#include <xrpl/protocol/TER.h>
14 for (
auto i = -400; i < 400; ++i)
23 BEAST_EXPECT(inRange || !good);
24 BEAST_EXPECT(
transToken(t) == (good ? token :
"-"));
25 BEAST_EXPECT(
transHuman(t) == (good ? text :
"-"));
28 BEAST_EXPECT(good == !!code);
29 BEAST_EXPECT(!code || *code == t);
40 template <std::
size_t I1, std::
size_t I2>
44 template <
typename Tup>
79 template <std::
size_t, std::
size_t>
94 template <std::
size_t, std::
size_t>
102 testIterate<std::tuple_size<Tup>::value - 1, I2 - 1, Func>(tup, s);
109 template <std::
size_t, std::
size_t>
133 static int const hiIndex{
137 testIterate<hiIndex, hiIndex, NotConvertible>(terEnums, *
this);
140 auto isConvertable = [](
auto from,
auto to) {
158 isConvertable(notTec, notTec);
161 auto notConvertible = [](
auto from,
auto to) {
175 notConvertible(ter, notTec);
176 notConvertible(4, notTec);
185 isConvertable(notTec, ter);
186 isConvertable(ter, ter);
189 notConvertible(4, ter);
199 template <std::
size_t I1, std::
size_t I2>
203 template <
typename Tup>
265 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)