20 #include <ripple/beast/unit_test.h>
21 #include <ripple/overlay/impl/ProtocolVersion.h>
28 template <
class FwdIt>
30 join(FwdIt first, FwdIt last,
char const* sep =
",")
45 BEAST_EXPECT(
join(result.begin(), result.end()) == answer);
52 testcase(
"Convert protocol version to string");
59 testcase(
"Convert strings to protocol versions");
64 "RTXP/1.1,RTXP/1.2,RTXP/1.3,XRPL/2.1,XRPL/2.0",
67 "RTXP/0.9,RTXP/1.01,XRPL/0.3,XRPL/2.01,XRPL/19.04,Oscar/"
71 "XRPL/2.0,RTXP/1.2,XRPL/2.0,XRPL/19.4,XRPL/7.89,XRPL/"
73 "XRPL/2.0,XRPL/7.89,XRPL/19.4");
75 "XRPL/2.0,XRPL/3.0,XRPL/4,XRPL/,XRPL,OPT XRPL/2.2,XRPL/5.67",
76 "XRPL/2.0,XRPL/3.0,XRPL/5.67");
80 testcase(
"Protocol version negotiation");
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
constexpr ProtocolVersion make_protocol(std::uint16_t major, std::uint16_t minor)
std::vector< ProtocolVersion > parseProtocolVersions(boost::beast::string_view const &value)
Parse a set of protocol versions.
std::pair< std::uint16_t, std::uint16_t > ProtocolVersion
Represents a particular version of the peer-to-peer protocol.
void check(std::string const &s, std::string const &answer)
static std::string join(FwdIt first, FwdIt last, char const *sep=",")
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
std::optional< ProtocolVersion > negotiateProtocolVersion(std::vector< ProtocolVersion > const &versions)
Given a list of supported protocol versions, choose the one we prefer.